Merge branch 'API-2023-03-12' of D:\workspace\iClear-api with conflicts.
Showing
30 changed files
with
389 additions
and
1050 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 | + ERROR_30105("30105","skuCode编码最少输入4位字符,skuName最少输入2个字符"); | ||
| 30 | + | ||
| 31 | + ErrorCodeEnum(String code,String name){ | ||
| 32 | + this.code = code; | ||
| 33 | + this.name = name; | ||
| 34 | + } | ||
| 35 | + | ||
| 36 | + private String code; | ||
| 37 | + private String name; | ||
| 38 | + public String getCode() { | ||
| 39 | + return code; | ||
| 40 | + } | ||
| 41 | + public String getName() { | ||
| 42 | + return name; | ||
| 43 | + } | ||
| 44 | +} |
| ... | @@ -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 | - | 354 | +} |
| 361 | -} | ||
| ... | \ 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 | } | 74 | } |
| 75 | iClearApiHsCodeLogService.saveIClearApiHsCodeLog(iclearApiHsCodeLog); | 75 | iClearApiHsCodeLogService.saveIClearApiHsCodeLog(iclearApiHsCodeLog); |
| 76 | } | 76 | } |
| 77 | } | 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) && skuCode.length() > 50){ | ||
| 102 | + skuCode = skuCode.substring(0,50); | ||
| 103 | + } | ||
| 104 | + String skuName = hscode.getSkuName(); | ||
| 105 | + if(!StringUtil.isEmpty(skuName) && skuName.length() > 1000){ | ||
| 106 | + skuName = skuName.substring(0,1000); | ||
| 107 | + } | ||
| 108 | + iclearApiHsCodeLog.setCode("[skuCode="+skuCode+"],[skuName="+skuName+"]"); | ||
| 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; | ||
| 117 | + } | ||
| 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 | - | 24 | +} |
| 25 | - | ||
| 26 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -94,5 +94,8 @@ public class Constant { | ... | @@ -94,5 +94,8 @@ public class Constant { |
| 94 | 94 | ||
| 95 | public static String DECLARED_DOC_TYPE_ZERO="declaredDocType_00"; | 95 | public static String DECLARED_DOC_TYPE_ZERO="declaredDocType_00"; |
| 96 | 96 | ||
| 97 | - | 97 | + /** |
| 98 | + * 监管条件 | ||
| 99 | + */ | ||
| 100 | + public static final String supervise_condition = "superviseRestrict"; | ||
| 98 | } | 101 | } | ... | ... |
| 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()); | ... | ... |
| ... | @@ -2,6 +2,8 @@ package com.erry.iclear.dateInterface.entity; | ... | @@ -2,6 +2,8 @@ package com.erry.iclear.dateInterface.entity; |
| 2 | 2 | ||
| 3 | import com.erry.iclear.dateInterface.common.BaseModel; | 3 | import com.erry.iclear.dateInterface.common.BaseModel; |
| 4 | import com.fasterxml.jackson.annotation.JsonIgnore; | 4 | import com.fasterxml.jackson.annotation.JsonIgnore; |
| 5 | +import lombok.Data; | ||
| 6 | +import org.hibernate.annotations.Persister; | ||
| 5 | 7 | ||
| 6 | import javax.persistence.*; | 8 | import javax.persistence.*; |
| 7 | import java.math.BigDecimal; | 9 | import java.math.BigDecimal; |
| ... | @@ -13,6 +15,7 @@ import java.util.Date; | ... | @@ -13,6 +15,7 @@ import java.util.Date; |
| 13 | */ | 15 | */ |
| 14 | @Entity | 16 | @Entity |
| 15 | @Table(name = "T_CC_HS_CODE") | 17 | @Table(name = "T_CC_HS_CODE") |
| 18 | +@Data | ||
| 16 | public class HsCode extends BaseModel { | 19 | public class HsCode extends BaseModel { |
| 17 | 20 | ||
| 18 | private static final long serialVersionUID = 2693103610036977383L; | 21 | private static final long serialVersionUID = 2693103610036977383L; |
| ... | @@ -449,820 +452,14 @@ public class HsCode extends BaseModel { | ... | @@ -449,820 +452,14 @@ public class HsCode extends BaseModel { |
| 449 | @Column(name = "OUT_RATE") | 452 | @Column(name = "OUT_RATE") |
| 450 | private BigDecimal outRate; | 453 | private BigDecimal outRate; |
| 451 | 454 | ||
| 455 | + /** | ||
| 456 | + * 是否限制出口C类申报 | ||
| 457 | + * 1表示限制,0表示不限制 | ||
| 458 | + */ | ||
| 459 | + @Transient | ||
| 460 | + Integer restrictedC; | ||
| 452 | 461 | ||
| 453 | - public static long getSerialVersionUID() { | ||
| 454 | - return serialVersionUID; | ||
| 455 | - } | ||
| 456 | - | ||
| 457 | - @Override | ||
| 458 | - public Long getId() { | ||
| 459 | - return id; | ||
| 460 | - } | ||
| 461 | - | ||
| 462 | - @Override | ||
| 463 | - public void setId(Long id) { | ||
| 464 | - this.id = id; | ||
| 465 | - } | ||
| 466 | - | ||
| 467 | - public String getSkuCode() { | ||
| 468 | - return skuCode; | ||
| 469 | - } | ||
| 470 | - | ||
| 471 | - public void setSkuCode(String skuCode) { | ||
| 472 | - this.skuCode = skuCode; | ||
| 473 | - } | ||
| 474 | - | ||
| 475 | - public String getSkuName() { | ||
| 476 | - return skuName; | ||
| 477 | - } | ||
| 478 | - | ||
| 479 | - public void setSkuName(String skuName) { | ||
| 480 | - this.skuName = skuName; | ||
| 481 | - } | ||
| 482 | - | ||
| 483 | - public BigDecimal getDutyRate() { | ||
| 484 | - return dutyRate; | ||
| 485 | - } | ||
| 486 | - | ||
| 487 | - public void setDutyRate(BigDecimal dutyRate) { | ||
| 488 | - this.dutyRate = dutyRate; | ||
| 489 | - } | ||
| 490 | - | ||
| 491 | - public BigDecimal getRegRate() { | ||
| 492 | - return regRate; | ||
| 493 | - } | ||
| 494 | - | ||
| 495 | - public void setRegRate(BigDecimal regRate) { | ||
| 496 | - this.regRate = regRate; | ||
| 497 | - } | ||
| 498 | - | ||
| 499 | - public BigDecimal getTaxRate() { | ||
| 500 | - return taxRate; | ||
| 501 | - } | ||
| 502 | - | ||
| 503 | - public void setTaxRate(BigDecimal taxRate) { | ||
| 504 | - this.taxRate = taxRate; | ||
| 505 | - } | ||
| 506 | - | ||
| 507 | - public String getMeasureUnit() { | ||
| 508 | - return measureUnit; | ||
| 509 | - } | ||
| 510 | - | ||
| 511 | - public void setMeasureUnit(String measureUnit) { | ||
| 512 | - this.measureUnit = measureUnit; | ||
| 513 | - } | ||
| 514 | - | ||
| 515 | - public String getMonitorCondition() { | ||
| 516 | - return monitorCondition; | ||
| 517 | - } | ||
| 518 | - | ||
| 519 | - public void setMonitorCondition(String monitorCondition) { | ||
| 520 | - this.monitorCondition = monitorCondition; | ||
| 521 | - } | ||
| 522 | - | ||
| 523 | - public String getRemark() { | ||
| 524 | - return remark; | ||
| 525 | - } | ||
| 526 | - | ||
| 527 | - public void setRemark(String remark) { | ||
| 528 | - this.remark = remark; | ||
| 529 | - } | ||
| 530 | - | ||
| 531 | - public Date getCreateTime() { | ||
| 532 | - return createTime; | ||
| 533 | - } | ||
| 534 | - | ||
| 535 | - public void setCreateTime(Date createTime) { | ||
| 536 | - this.createTime = createTime; | ||
| 537 | - } | ||
| 538 | - | ||
| 539 | - public SysUser getCreatorId() { | ||
| 540 | - return creatorId; | ||
| 541 | - } | ||
| 542 | - | ||
| 543 | - public void setCreatorId(SysUser creatorId) { | ||
| 544 | - this.creatorId = creatorId; | ||
| 545 | - } | ||
| 546 | - | ||
| 547 | - public String getCreator() { | ||
| 548 | - return creator; | ||
| 549 | - } | ||
| 550 | - | ||
| 551 | - public void setCreator(String creator) { | ||
| 552 | - this.creator = creator; | ||
| 553 | - } | ||
| 554 | - | ||
| 555 | - public Date getUpdateTime() { | ||
| 556 | - return updateTime; | ||
| 557 | - } | ||
| 558 | - | ||
| 559 | - public void setUpdateTime(Date updateTime) { | ||
| 560 | - this.updateTime = updateTime; | ||
| 561 | - } | ||
| 562 | - | ||
| 563 | - public SysUser getUpdateUser() { | ||
| 564 | - return updateUser; | ||
| 565 | - } | ||
| 566 | - | ||
| 567 | - public void setUpdateUser(SysUser updateUser) { | ||
| 568 | - this.updateUser = updateUser; | ||
| 569 | - } | ||
| 570 | - | ||
| 571 | - public String getUpdateUserName() { | ||
| 572 | - return updateUserName; | ||
| 573 | - } | ||
| 574 | - | ||
| 575 | - public void setUpdateUserName(String updateUserName) { | ||
| 576 | - this.updateUserName = updateUserName; | ||
| 577 | - } | ||
| 578 | - | ||
| 579 | - public Boolean getValidate() { | ||
| 580 | - return validate; | ||
| 581 | - } | ||
| 582 | - | ||
| 583 | - public void setValidate(Boolean validate) { | ||
| 584 | - this.validate = validate; | ||
| 585 | - } | ||
| 586 | - | ||
| 587 | - public String getUnitLegalFirst() { | ||
| 588 | - return unitLegalFirst; | ||
| 589 | - } | ||
| 590 | - | ||
| 591 | - public void setUnitLegalFirst(String unitLegalFirst) { | ||
| 592 | - this.unitLegalFirst = unitLegalFirst; | ||
| 593 | - } | ||
| 594 | - | ||
| 595 | - public String getUnitLegalSecond() { | ||
| 596 | - return unitLegalSecond; | ||
| 597 | - } | ||
| 598 | - | ||
| 599 | - public void setUnitLegalSecond(String unitLegalSecond) { | ||
| 600 | - this.unitLegalSecond = unitLegalSecond; | ||
| 601 | - } | ||
| 602 | - | ||
| 603 | - public Boolean getCcc() { | ||
| 604 | - return isCcc; | ||
| 605 | - } | ||
| 606 | - | ||
| 607 | - public void setCcc(Boolean ccc) { | ||
| 608 | - isCcc = ccc; | ||
| 609 | - } | ||
| 610 | - | ||
| 611 | - public Boolean getExporttax() { | ||
| 612 | - return exporttax; | ||
| 613 | - } | ||
| 614 | - | ||
| 615 | - public void setExporttax(Boolean exporttax) { | ||
| 616 | - this.exporttax = exporttax; | ||
| 617 | - } | ||
| 618 | - | ||
| 619 | - public String getElement1() { | ||
| 620 | - return element1; | ||
| 621 | - } | ||
| 622 | - | ||
| 623 | - public void setElement1(String element1) { | ||
| 624 | - this.element1 = element1; | ||
| 625 | - } | ||
| 626 | - | ||
| 627 | - public BigDecimal getFlag1() { | ||
| 628 | - return flag1; | ||
| 629 | - } | ||
| 630 | - | ||
| 631 | - public void setFlag1(BigDecimal flag1) { | ||
| 632 | - this.flag1 = flag1; | ||
| 633 | - } | ||
| 634 | - | ||
| 635 | - public String getSelect1() { | ||
| 636 | - return select1; | ||
| 637 | - } | ||
| 638 | - | ||
| 639 | - public void setSelect1(String select1) { | ||
| 640 | - this.select1 = select1; | ||
| 641 | - } | ||
| 642 | - | ||
| 643 | - public BigDecimal getSelectFlag1() { | ||
| 644 | - return selectFlag1; | ||
| 645 | - } | ||
| 646 | - | ||
| 647 | - public void setSelectFlag1(BigDecimal selectFlag1) { | ||
| 648 | - this.selectFlag1 = selectFlag1; | ||
| 649 | - } | ||
| 650 | - | ||
| 651 | - public String getElement2() { | ||
| 652 | - return element2; | ||
| 653 | - } | ||
| 654 | - | ||
| 655 | - public void setElement2(String element2) { | ||
| 656 | - this.element2 = element2; | ||
| 657 | - } | ||
| 658 | - | ||
| 659 | - public BigDecimal getFlag2() { | ||
| 660 | - return flag2; | ||
| 661 | - } | ||
| 662 | - | ||
| 663 | - public void setFlag2(BigDecimal flag2) { | ||
| 664 | - this.flag2 = flag2; | ||
| 665 | - } | ||
| 666 | - | ||
| 667 | - public String getSelect2() { | ||
| 668 | - return select2; | ||
| 669 | - } | ||
| 670 | - | ||
| 671 | - public void setSelect2(String select2) { | ||
| 672 | - this.select2 = select2; | ||
| 673 | - } | ||
| 674 | - | ||
| 675 | - public BigDecimal getSelectFlag2() { | ||
| 676 | - return selectFlag2; | ||
| 677 | - } | ||
| 678 | - | ||
| 679 | - public void setSelectFlag2(BigDecimal selectFlag2) { | ||
| 680 | - this.selectFlag2 = selectFlag2; | ||
| 681 | - } | ||
| 682 | - | ||
| 683 | - public String getElement3() { | ||
| 684 | - return element3; | ||
| 685 | - } | ||
| 686 | - | ||
| 687 | - public void setElement3(String element3) { | ||
| 688 | - this.element3 = element3; | ||
| 689 | - } | ||
| 690 | - | ||
| 691 | - public BigDecimal getFlag3() { | ||
| 692 | - return flag3; | ||
| 693 | - } | ||
| 694 | - | ||
| 695 | - public void setFlag3(BigDecimal flag3) { | ||
| 696 | - this.flag3 = flag3; | ||
| 697 | - } | ||
| 698 | - | ||
| 699 | - public String getSelect3() { | ||
| 700 | - return select3; | ||
| 701 | - } | ||
| 702 | - | ||
| 703 | - public void setSelect3(String select3) { | ||
| 704 | - this.select3 = select3; | ||
| 705 | - } | ||
| 706 | - | ||
| 707 | - public BigDecimal getSelectFlag3() { | ||
| 708 | - return selectFlag3; | ||
| 709 | - } | ||
| 710 | - | ||
| 711 | - public void setSelectFlag3(BigDecimal selectFlag3) { | ||
| 712 | - this.selectFlag3 = selectFlag3; | ||
| 713 | - } | ||
| 714 | - | ||
| 715 | - public String getElement4() { | ||
| 716 | - return element4; | ||
| 717 | - } | ||
| 718 | - | ||
| 719 | - public void setElement4(String element4) { | ||
| 720 | - this.element4 = element4; | ||
| 721 | - } | ||
| 722 | - | ||
| 723 | - public BigDecimal getFlag4() { | ||
| 724 | - return flag4; | ||
| 725 | - } | ||
| 726 | - | ||
| 727 | - public void setFlag4(BigDecimal flag4) { | ||
| 728 | - this.flag4 = flag4; | ||
| 729 | - } | ||
| 730 | - | ||
| 731 | - public String getSelect4() { | ||
| 732 | - return select4; | ||
| 733 | - } | ||
| 734 | - | ||
| 735 | - public void setSelect4(String select4) { | ||
| 736 | - this.select4 = select4; | ||
| 737 | - } | ||
| 738 | - | ||
| 739 | - public BigDecimal getSelectFlag4() { | ||
| 740 | - return selectFlag4; | ||
| 741 | - } | ||
| 742 | - | ||
| 743 | - public void setSelectFlag4(BigDecimal selectFlag4) { | ||
| 744 | - this.selectFlag4 = selectFlag4; | ||
| 745 | - } | ||
| 746 | - | ||
| 747 | - public String getElement5() { | ||
| 748 | - return element5; | ||
| 749 | - } | ||
| 750 | - | ||
| 751 | - public void setElement5(String element5) { | ||
| 752 | - this.element5 = element5; | ||
| 753 | - } | ||
| 754 | - | ||
| 755 | - public BigDecimal getFlag5() { | ||
| 756 | - return flag5; | ||
| 757 | - } | ||
| 758 | - | ||
| 759 | - public void setFlag5(BigDecimal flag5) { | ||
| 760 | - this.flag5 = flag5; | ||
| 761 | - } | ||
| 762 | - | ||
| 763 | - public String getSelect5() { | ||
| 764 | - return select5; | ||
| 765 | - } | ||
| 766 | - | ||
| 767 | - public void setSelect5(String select5) { | ||
| 768 | - this.select5 = select5; | ||
| 769 | - } | ||
| 770 | - | ||
| 771 | - public BigDecimal getSelectFlag5() { | ||
| 772 | - return selectFlag5; | ||
| 773 | - } | ||
| 774 | - | ||
| 775 | - public void setSelectFlag5(BigDecimal selectFlag5) { | ||
| 776 | - this.selectFlag5 = selectFlag5; | ||
| 777 | - } | ||
| 778 | - | ||
| 779 | - public String getElement6() { | ||
| 780 | - return element6; | ||
| 781 | - } | ||
| 782 | - | ||
| 783 | - public void setElement6(String element6) { | ||
| 784 | - this.element6 = element6; | ||
| 785 | - } | ||
| 786 | - | ||
| 787 | - public BigDecimal getFlag6() { | ||
| 788 | - return flag6; | ||
| 789 | - } | ||
| 790 | - | ||
| 791 | - public void setFlag6(BigDecimal flag6) { | ||
| 792 | - this.flag6 = flag6; | ||
| 793 | - } | ||
| 794 | - | ||
| 795 | - public String getSelect6() { | ||
| 796 | - return select6; | ||
| 797 | - } | ||
| 798 | - | ||
| 799 | - public void setSelect6(String select6) { | ||
| 800 | - this.select6 = select6; | ||
| 801 | - } | ||
| 802 | - | ||
| 803 | - public BigDecimal getSelectFlag6() { | ||
| 804 | - return selectFlag6; | ||
| 805 | - } | ||
| 806 | - | ||
| 807 | - public void setSelectFlag6(BigDecimal selectFlag6) { | ||
| 808 | - this.selectFlag6 = selectFlag6; | ||
| 809 | - } | ||
| 810 | - | ||
| 811 | - public String getElement7() { | ||
| 812 | - return element7; | ||
| 813 | - } | ||
| 814 | - | ||
| 815 | - public void setElement7(String element7) { | ||
| 816 | - this.element7 = element7; | ||
| 817 | - } | ||
| 818 | - | ||
| 819 | - public BigDecimal getFlag7() { | ||
| 820 | - return flag7; | ||
| 821 | - } | ||
| 822 | - | ||
| 823 | - public void setFlag7(BigDecimal flag7) { | ||
| 824 | - this.flag7 = flag7; | ||
| 825 | - } | ||
| 826 | - | ||
| 827 | - public String getSelect7() { | ||
| 828 | - return select7; | ||
| 829 | - } | ||
| 830 | - | ||
| 831 | - public void setSelect7(String select7) { | ||
| 832 | - this.select7 = select7; | ||
| 833 | - } | ||
| 834 | - | ||
| 835 | - public BigDecimal getSelectFlag7() { | ||
| 836 | - return selectFlag7; | ||
| 837 | - } | ||
| 838 | - | ||
| 839 | - public void setSelectFlag7(BigDecimal selectFlag7) { | ||
| 840 | - this.selectFlag7 = selectFlag7; | ||
| 841 | - } | ||
| 842 | - | ||
| 843 | - public String getElement8() { | ||
| 844 | - return element8; | ||
| 845 | - } | ||
| 846 | - | ||
| 847 | - public void setElement8(String element8) { | ||
| 848 | - this.element8 = element8; | ||
| 849 | - } | ||
| 850 | - | ||
| 851 | - public BigDecimal getFlag8() { | ||
| 852 | - return flag8; | ||
| 853 | - } | ||
| 854 | - | ||
| 855 | - public void setFlag8(BigDecimal flag8) { | ||
| 856 | - this.flag8 = flag8; | ||
| 857 | - } | ||
| 858 | - | ||
| 859 | - public String getSelect8() { | ||
| 860 | - return select8; | ||
| 861 | - } | ||
| 862 | - | ||
| 863 | - public void setSelect8(String select8) { | ||
| 864 | - this.select8 = select8; | ||
| 865 | - } | ||
| 866 | - | ||
| 867 | - public BigDecimal getSelectFlag8() { | ||
| 868 | - return selectFlag8; | ||
| 869 | - } | ||
| 870 | - | ||
| 871 | - public void setSelectFlag8(BigDecimal selectFlag8) { | ||
| 872 | - this.selectFlag8 = selectFlag8; | ||
| 873 | - } | ||
| 874 | - | ||
| 875 | - public String getElement9() { | ||
| 876 | - return element9; | ||
| 877 | - } | ||
| 878 | - | ||
| 879 | - public void setElement9(String element9) { | ||
| 880 | - this.element9 = element9; | ||
| 881 | - } | ||
| 882 | - | ||
| 883 | - public BigDecimal getFlag9() { | ||
| 884 | - return flag9; | ||
| 885 | - } | ||
| 886 | - | ||
| 887 | - public void setFlag9(BigDecimal flag9) { | ||
| 888 | - this.flag9 = flag9; | ||
| 889 | - } | ||
| 890 | - | ||
| 891 | - public String getSelect9() { | ||
| 892 | - return select9; | ||
| 893 | - } | ||
| 894 | - | ||
| 895 | - public void setSelect9(String select9) { | ||
| 896 | - this.select9 = select9; | ||
| 897 | - } | ||
| 898 | - | ||
| 899 | - public BigDecimal getSelectFlag9() { | ||
| 900 | - return selectFlag9; | ||
| 901 | - } | ||
| 902 | - | ||
| 903 | - public void setSelectFlag9(BigDecimal selectFlag9) { | ||
| 904 | - this.selectFlag9 = selectFlag9; | ||
| 905 | - } | ||
| 906 | - | ||
| 907 | - public String getElement10() { | ||
| 908 | - return element10; | ||
| 909 | - } | ||
| 910 | - | ||
| 911 | - public void setElement10(String element10) { | ||
| 912 | - this.element10 = element10; | ||
| 913 | - } | ||
| 914 | - | ||
| 915 | - public BigDecimal getFlag10() { | ||
| 916 | - return flag10; | ||
| 917 | - } | ||
| 918 | - | ||
| 919 | - public void setFlag10(BigDecimal flag10) { | ||
| 920 | - this.flag10 = flag10; | ||
| 921 | - } | ||
| 922 | - | ||
| 923 | - public String getSelect10() { | ||
| 924 | - return select10; | ||
| 925 | - } | ||
| 926 | - | ||
| 927 | - public void setSelect10(String select10) { | ||
| 928 | - this.select10 = select10; | ||
| 929 | - } | ||
| 930 | - | ||
| 931 | - public BigDecimal getSelectFlag10() { | ||
| 932 | - return selectFlag10; | ||
| 933 | - } | ||
| 934 | - | ||
| 935 | - public void setSelectFlag10(BigDecimal selectFlag10) { | ||
| 936 | - this.selectFlag10 = selectFlag10; | ||
| 937 | - } | ||
| 938 | - | ||
| 939 | - public String getElement11() { | ||
| 940 | - return element11; | ||
| 941 | - } | ||
| 942 | - | ||
| 943 | - public void setElement11(String element11) { | ||
| 944 | - this.element11 = element11; | ||
| 945 | - } | ||
| 946 | - | ||
| 947 | - public BigDecimal getFlag11() { | ||
| 948 | - return flag11; | ||
| 949 | - } | ||
| 950 | - | ||
| 951 | - public void setFlag11(BigDecimal flag11) { | ||
| 952 | - this.flag11 = flag11; | ||
| 953 | - } | ||
| 954 | - | ||
| 955 | - public String getSelect11() { | ||
| 956 | - return select11; | ||
| 957 | - } | ||
| 958 | - | ||
| 959 | - public void setSelect11(String select11) { | ||
| 960 | - this.select11 = select11; | ||
| 961 | - } | ||
| 962 | - | ||
| 963 | - public BigDecimal getSelectFlag11() { | ||
| 964 | - return selectFlag11; | ||
| 965 | - } | ||
| 966 | - | ||
| 967 | - public void setSelectFlag11(BigDecimal selectFlag11) { | ||
| 968 | - this.selectFlag11 = selectFlag11; | ||
| 969 | - } | ||
| 970 | - | ||
| 971 | - public String getElement12() { | ||
| 972 | - return element12; | ||
| 973 | - } | ||
| 974 | - | ||
| 975 | - public void setElement12(String element12) { | ||
| 976 | - this.element12 = element12; | ||
| 977 | - } | ||
| 978 | - | ||
| 979 | - public BigDecimal getFlag12() { | ||
| 980 | - return flag12; | ||
| 981 | - } | ||
| 982 | - | ||
| 983 | - public void setFlag12(BigDecimal flag12) { | ||
| 984 | - this.flag12 = flag12; | ||
| 985 | - } | ||
| 986 | - | ||
| 987 | - public String getSelect12() { | ||
| 988 | - return select12; | ||
| 989 | - } | ||
| 990 | - | ||
| 991 | - public void setSelect12(String select12) { | ||
| 992 | - this.select12 = select12; | ||
| 993 | - } | ||
| 994 | - | ||
| 995 | - public BigDecimal getSelectFlag12() { | ||
| 996 | - return selectFlag12; | ||
| 997 | - } | ||
| 998 | - | ||
| 999 | - public void setSelectFlag12(BigDecimal selectFlag12) { | ||
| 1000 | - this.selectFlag12 = selectFlag12; | ||
| 1001 | - } | ||
| 1002 | - | ||
| 1003 | - public String getElement13() { | ||
| 1004 | - return element13; | ||
| 1005 | - } | ||
| 1006 | - | ||
| 1007 | - public void setElement13(String element13) { | ||
| 1008 | - this.element13 = element13; | ||
| 1009 | - } | ||
| 1010 | - | ||
| 1011 | - public BigDecimal getFlag13() { | ||
| 1012 | - return flag13; | ||
| 1013 | - } | ||
| 1014 | - | ||
| 1015 | - public void setFlag13(BigDecimal flag13) { | ||
| 1016 | - this.flag13 = flag13; | ||
| 1017 | - } | ||
| 1018 | - | ||
| 1019 | - public String getSelect13() { | ||
| 1020 | - return select13; | ||
| 1021 | - } | ||
| 1022 | - | ||
| 1023 | - public void setSelect13(String select13) { | ||
| 1024 | - this.select13 = select13; | ||
| 1025 | - } | ||
| 1026 | - | ||
| 1027 | - public BigDecimal getSelectFlag13() { | ||
| 1028 | - return selectFlag13; | ||
| 1029 | - } | ||
| 1030 | - | ||
| 1031 | - public void setSelectFlag13(BigDecimal selectFlag13) { | ||
| 1032 | - this.selectFlag13 = selectFlag13; | ||
| 1033 | - } | ||
| 1034 | - | ||
| 1035 | - public String getElement14() { | ||
| 1036 | - return element14; | ||
| 1037 | - } | ||
| 1038 | - | ||
| 1039 | - public void setElement14(String element14) { | ||
| 1040 | - this.element14 = element14; | ||
| 1041 | - } | ||
| 1042 | - | ||
| 1043 | - public BigDecimal getFlag14() { | ||
| 1044 | - return flag14; | ||
| 1045 | - } | ||
| 1046 | - | ||
| 1047 | - public void setFlag14(BigDecimal flag14) { | ||
| 1048 | - this.flag14 = flag14; | ||
| 1049 | - } | ||
| 1050 | - | ||
| 1051 | - public String getSelect14() { | ||
| 1052 | - return select14; | ||
| 1053 | - } | ||
| 1054 | - | ||
| 1055 | - public void setSelect14(String select14) { | ||
| 1056 | - this.select14 = select14; | ||
| 1057 | - } | ||
| 1058 | - | ||
| 1059 | - public BigDecimal getSelectFlag14() { | ||
| 1060 | - return selectFlag14; | ||
| 1061 | - } | ||
| 1062 | - | ||
| 1063 | - public void setSelectFlag14(BigDecimal selectFlag14) { | ||
| 1064 | - this.selectFlag14 = selectFlag14; | ||
| 1065 | - } | ||
| 1066 | - | ||
| 1067 | - public String getElement15() { | ||
| 1068 | - return element15; | ||
| 1069 | - } | ||
| 1070 | - | ||
| 1071 | - public void setElement15(String element15) { | ||
| 1072 | - this.element15 = element15; | ||
| 1073 | - } | ||
| 1074 | - | ||
| 1075 | - public BigDecimal getFlag15() { | ||
| 1076 | - return flag15; | ||
| 1077 | - } | ||
| 1078 | - | ||
| 1079 | - public void setFlag15(BigDecimal flag15) { | ||
| 1080 | - this.flag15 = flag15; | ||
| 1081 | - } | ||
| 1082 | - | ||
| 1083 | - public String getSelect15() { | ||
| 1084 | - return select15; | ||
| 1085 | - } | ||
| 1086 | - | ||
| 1087 | - public void setSelect15(String select15) { | ||
| 1088 | - this.select15 = select15; | ||
| 1089 | - } | ||
| 1090 | - | ||
| 1091 | - public BigDecimal getSelectFlag15() { | ||
| 1092 | - return selectFlag15; | ||
| 1093 | - } | ||
| 1094 | - | ||
| 1095 | - public void setSelectFlag15(BigDecimal selectFlag15) { | ||
| 1096 | - this.selectFlag15 = selectFlag15; | ||
| 1097 | - } | ||
| 1098 | - | ||
| 1099 | - public String getElement16() { | ||
| 1100 | - return element16; | ||
| 1101 | - } | ||
| 1102 | - | ||
| 1103 | - public void setElement16(String element16) { | ||
| 1104 | - this.element16 = element16; | ||
| 1105 | - } | ||
| 1106 | - | ||
| 1107 | - public BigDecimal getFlag16() { | ||
| 1108 | - return flag16; | ||
| 1109 | - } | ||
| 1110 | - | ||
| 1111 | - public void setFlag16(BigDecimal flag16) { | ||
| 1112 | - this.flag16 = flag16; | ||
| 1113 | - } | ||
| 1114 | - | ||
| 1115 | - public String getSelect16() { | ||
| 1116 | - return select16; | ||
| 1117 | - } | ||
| 1118 | - | ||
| 1119 | - public void setSelect16(String select16) { | ||
| 1120 | - this.select16 = select16; | ||
| 1121 | - } | ||
| 1122 | - | ||
| 1123 | - public BigDecimal getSelectFlag16() { | ||
| 1124 | - return selectFlag16; | ||
| 1125 | - } | ||
| 1126 | - | ||
| 1127 | - public void setSelectFlag16(BigDecimal selectFlag16) { | ||
| 1128 | - this.selectFlag16 = selectFlag16; | ||
| 1129 | - } | ||
| 1130 | - | ||
| 1131 | - public String getElement17() { | ||
| 1132 | - return element17; | ||
| 1133 | - } | ||
| 1134 | - | ||
| 1135 | - public void setElement17(String element17) { | ||
| 1136 | - this.element17 = element17; | ||
| 1137 | - } | ||
| 1138 | - | ||
| 1139 | - public BigDecimal getFlag17() { | ||
| 1140 | - return flag17; | ||
| 1141 | - } | ||
| 1142 | - | ||
| 1143 | - public void setFlag17(BigDecimal flag17) { | ||
| 1144 | - this.flag17 = flag17; | ||
| 1145 | - } | ||
| 1146 | - | ||
| 1147 | - public String getSelect17() { | ||
| 1148 | - return select17; | ||
| 1149 | - } | ||
| 1150 | - | ||
| 1151 | - public void setSelect17(String select17) { | ||
| 1152 | - this.select17 = select17; | ||
| 1153 | - } | ||
| 1154 | - | ||
| 1155 | - public BigDecimal getSelectFlag17() { | ||
| 1156 | - return selectFlag17; | ||
| 1157 | - } | ||
| 1158 | - | ||
| 1159 | - public void setSelectFlag17(BigDecimal selectFlag17) { | ||
| 1160 | - this.selectFlag17 = selectFlag17; | ||
| 1161 | - } | ||
| 1162 | - | ||
| 1163 | - public String getElement18() { | ||
| 1164 | - return element18; | ||
| 1165 | - } | ||
| 1166 | - | ||
| 1167 | - public void setElement18(String element18) { | ||
| 1168 | - this.element18 = element18; | ||
| 1169 | - } | ||
| 1170 | - | ||
| 1171 | - public BigDecimal getFlag18() { | ||
| 1172 | - return flag18; | ||
| 1173 | - } | ||
| 1174 | - | ||
| 1175 | - public void setFlag18(BigDecimal flag18) { | ||
| 1176 | - this.flag18 = flag18; | ||
| 1177 | - } | ||
| 1178 | - | ||
| 1179 | - public String getSelect18() { | ||
| 1180 | - return select18; | ||
| 1181 | - } | ||
| 1182 | - | ||
| 1183 | - public void setSelect18(String select18) { | ||
| 1184 | - this.select18 = select18; | ||
| 1185 | - } | ||
| 1186 | - | ||
| 1187 | - public BigDecimal getSelectFlag18() { | ||
| 1188 | - return selectFlag18; | ||
| 1189 | - } | ||
| 1190 | - | ||
| 1191 | - public void setSelectFlag18(BigDecimal selectFlag18) { | ||
| 1192 | - this.selectFlag18 = selectFlag18; | ||
| 1193 | - } | ||
| 1194 | - | ||
| 1195 | - public String getElement19() { | ||
| 1196 | - return element19; | ||
| 1197 | - } | ||
| 1198 | - | ||
| 1199 | - public void setElement19(String element19) { | ||
| 1200 | - this.element19 = element19; | ||
| 1201 | - } | ||
| 1202 | - | ||
| 1203 | - public BigDecimal getFlag19() { | ||
| 1204 | - return flag19; | ||
| 1205 | - } | ||
| 1206 | - | ||
| 1207 | - public void setFlag19(BigDecimal flag19) { | ||
| 1208 | - this.flag19 = flag19; | ||
| 1209 | - } | ||
| 1210 | - | ||
| 1211 | - public String getSelect19() { | ||
| 1212 | - return select19; | ||
| 1213 | - } | ||
| 1214 | - | ||
| 1215 | - public void setSelect19(String select19) { | ||
| 1216 | - this.select19 = select19; | ||
| 1217 | - } | ||
| 1218 | - | ||
| 1219 | - public BigDecimal getSelectFlag19() { | ||
| 1220 | - return selectFlag19; | ||
| 1221 | - } | ||
| 1222 | - | ||
| 1223 | - public void setSelectFlag19(BigDecimal selectFlag19) { | ||
| 1224 | - this.selectFlag19 = selectFlag19; | ||
| 1225 | - } | ||
| 1226 | - | ||
| 1227 | - public String getElement20() { | ||
| 1228 | - return element20; | ||
| 1229 | - } | ||
| 1230 | - | ||
| 1231 | - public void setElement20(String element20) { | ||
| 1232 | - this.element20 = element20; | ||
| 1233 | - } | ||
| 1234 | - | ||
| 1235 | - public BigDecimal getFlag20() { | ||
| 1236 | - return flag20; | ||
| 1237 | - } | ||
| 1238 | - | ||
| 1239 | - public void setFlag20(BigDecimal flag20) { | ||
| 1240 | - this.flag20 = flag20; | ||
| 1241 | - } | ||
| 1242 | - | ||
| 1243 | - public String getSelect20() { | ||
| 1244 | - return select20; | ||
| 1245 | - } | ||
| 1246 | - | ||
| 1247 | - public void setSelect20(String select20) { | ||
| 1248 | - this.select20 = select20; | ||
| 1249 | - } | ||
| 1250 | - | ||
| 1251 | - public BigDecimal getSelectFlag20() { | ||
| 1252 | - return selectFlag20; | ||
| 1253 | - } | ||
| 1254 | - | ||
| 1255 | - public void setSelectFlag20(BigDecimal selectFlag20) { | ||
| 1256 | - this.selectFlag20 = selectFlag20; | ||
| 1257 | - } | ||
| 1258 | - | ||
| 1259 | - public BigDecimal getOutRate() { | ||
| 1260 | - return outRate; | ||
| 1261 | - } | ||
| 1262 | 462 | ||
| 1263 | - public void setOutRate(BigDecimal outRate) { | ||
| 1264 | - this.outRate = outRate; | ||
| 1265 | - } | ||
| 1266 | 463 | ||
| 1267 | @Override | 464 | @Override |
| 1268 | public String toString() { | 465 | public String toString() { | ... | ... |
| 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 | ... | ... |
| ... | @@ -41,4 +41,13 @@ public interface DictionaryEntriesRepository extends JpaRepository<DictionaryEn | ... | @@ -41,4 +41,13 @@ public interface DictionaryEntriesRepository extends JpaRepository<DictionaryEn |
| 41 | @Query(nativeQuery = true, value = "SELECT * FROM T_BI_DICTIONARY_ENTRIES WHERE DICT_CODE = ?1 AND EXT6 = ?2") | 41 | @Query(nativeQuery = true, value = "SELECT * FROM T_BI_DICTIONARY_ENTRIES WHERE DICT_CODE = ?1 AND EXT6 = ?2") |
| 42 | public DictionaryEntries findDictionaryEntriesByDicCode(String code,String numBer); | 42 | public DictionaryEntries findDictionaryEntriesByDicCode(String code,String numBer); |
| 43 | 43 | ||
| 44 | + /** | ||
| 45 | + *监管条件 | ||
| 46 | + * @param dictCode | ||
| 47 | + * @param status | ||
| 48 | + * @return | ||
| 49 | + */ | ||
| 50 | + @Query(nativeQuery = true, value = "select CHINESE_NAME from T_BI_DICTIONARY_ENTRIES where DICT_CODE = ?1 AND STATUS=?2 order by ORDINAL") | ||
| 51 | + public List<String> findDicEntByCodeList(String dictCode, Integer status); | ||
| 52 | + | ||
| 44 | } | 53 | } | ... | ... |
| ... | @@ -16,27 +16,35 @@ import java.util.List; | ... | @@ -16,27 +16,35 @@ import java.util.List; |
| 16 | */ | 16 | */ |
| 17 | @Repository | 17 | @Repository |
| 18 | public interface HsCodeRepository extends JpaSpecificationExecutor<HsCode>, JpaRepository<HsCode, Long> { | 18 | public interface HsCodeRepository extends JpaSpecificationExecutor<HsCode>, JpaRepository<HsCode, Long> { |
| 19 | - /** | ||
| 20 | - * | ||
| 21 | - * 根据hscode编码查询最新一条hscode信息 | ||
| 22 | - * @param code | ||
| 23 | - * @return | ||
| 24 | - */ | ||
| 25 | - @Query(nativeQuery = true,value = "select top 1 * from T_CC_HS_CODE where VALIDATE=1 and SKU_CODE =?1 order by id desc ") | ||
| 26 | - public HsCode findHsCodeByCode(String code); | ||
| 27 | 19 | ||
| 28 | /** | 20 | /** |
| 29 | * 根据hscode编码查询对应的hscode | 21 | * 根据hscode编码查询对应的hscode |
| 30 | * @param skuCodeList | 22 | * @param skuCodeList |
| 31 | * @return | 23 | * @return |
| 32 | */ | 24 | */ |
| 33 | - @Query(nativeQuery = true, value = "select * from [dbo].[T_CC_HS_CODE] where VALIDATE=1 and SKU_CODE in ?1") | 25 | + @Query(nativeQuery = true, value = "select * from T_CC_HS_CODE where VALIDATE=1 and SKU_CODE in ?1") |
| 34 | List<HsCode> findHsCodeListByCode(List<String> skuCodeList); | 26 | List<HsCode> findHsCodeListByCode(List<String> skuCodeList); |
| 35 | 27 | ||
| 36 | /** | 28 | /** |
| 29 | + * 根据hscode编码或者商品名称进行模糊查询 | ||
| 30 | + * @param skuCode | ||
| 31 | + * @param skuName | ||
| 32 | + * @return | ||
| 33 | + */ | ||
| 34 | + @Query(nativeQuery = true, value = "SELECT TOP 50 * FROM T_CC_HS_CODE WHERE VALIDATE=1 and SKU_CODE LIKE ?1 AND SKUNAME LIKE ?2") | ||
| 35 | + List<HsCode> fuzzyQueryHsCode(String skuCode,String skuName); | ||
| 36 | + | ||
| 37 | + /** | ||
| 37 | * 查询所有有效hscode | 38 | * 查询所有有效hscode |
| 38 | * @return | 39 | * @return |
| 39 | */ | 40 | */ |
| 40 | @Query(nativeQuery = true,value = "select * from T_CC_HS_CODE where VALIDATE=1") | 41 | @Query(nativeQuery = true,value = "select * from T_CC_HS_CODE where VALIDATE=1") |
| 41 | - public List<HsCode> findAllHsCodeList(); | 42 | + List<HsCode> findAllHsCodeList(); |
| 43 | + | ||
| 44 | + /** | ||
| 45 | + * 获取监管条件数据 | ||
| 46 | + * @return | ||
| 47 | + */ | ||
| 48 | + @Query(nativeQuery = true,value = "select * from T_CC_HS_CODE where OUT_RATE <> 0 or MONITOR_CONDITION collate Chinese_PRC_CS_AI_WS LIKE ?1") | ||
| 49 | + List<HsCode> findMonitorCondition(String chinsesName); | ||
| 42 | } | 50 | } |
| ... | \ 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; |
| 6 | +import com.erry.iclear.dateInterface.common.Constant; | ||
| 4 | import com.erry.iclear.dateInterface.entity.HsCode; | 7 | import com.erry.iclear.dateInterface.entity.HsCode; |
| 8 | +import com.erry.iclear.dateInterface.repository.DictionaryEntriesRepository; | ||
| 5 | import com.erry.iclear.dateInterface.repository.HsCodeRepository; | 9 | import com.erry.iclear.dateInterface.repository.HsCodeRepository; |
| 10 | +import com.erry.iclear.dateInterface.util.StringUtil; | ||
| 6 | import lombok.extern.slf4j.Slf4j; | 11 | import lombok.extern.slf4j.Slf4j; |
| 7 | import org.springframework.beans.factory.annotation.Autowired; | 12 | import org.springframework.beans.factory.annotation.Autowired; |
| 8 | import org.springframework.stereotype.Service; | 13 | import org.springframework.stereotype.Service; |
| 9 | -import java.util.Arrays; | 14 | + |
| 10 | -import java.util.List; | 15 | +import java.sql.*; |
| 16 | +import java.util.*; | ||
| 11 | 17 | ||
| 12 | /** | 18 | /** |
| 13 | * hscode service | 19 | * hscode service |
| ... | @@ -17,8 +23,12 @@ import java.util.List; | ... | @@ -17,8 +23,12 @@ import java.util.List; |
| 17 | @Service | 23 | @Service |
| 18 | @Slf4j | 24 | @Slf4j |
| 19 | public class HsCodeService { | 25 | public class HsCodeService { |
| 26 | + | ||
| 20 | @Autowired | 27 | @Autowired |
| 21 | HsCodeRepository hsCodeRepository; | 28 | HsCodeRepository hsCodeRepository; |
| 29 | + @Autowired | ||
| 30 | + DictionaryEntriesRepository dicEntriesRepository; | ||
| 31 | + | ||
| 22 | /** | 32 | /** |
| 23 | * 根据hscode编码查询对应的hscode | 33 | * 根据hscode编码查询对应的hscode |
| 24 | * @param hscode | 34 | * @param hscode |
| ... | @@ -28,14 +38,14 @@ public class HsCodeService { | ... | @@ -28,14 +38,14 @@ public class HsCodeService { |
| 28 | ResultHsCode resultHsCode = new ResultHsCode(Boolean.FALSE,"","",null); | 38 | ResultHsCode resultHsCode = new ResultHsCode(Boolean.FALSE,"","",null); |
| 29 | try{ | 39 | try{ |
| 30 | if(hscode.length() > 2000){ | 40 | if(hscode.length() > 2000){ |
| 31 | - resultHsCode.setCode("30102"); | 41 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30102.getCode()); |
| 32 | - resultHsCode.setMsg("参数:hscode编码字段长度超过2000"); | 42 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30102.getName()); |
| 33 | return resultHsCode; | 43 | return resultHsCode; |
| 34 | } | 44 | } |
| 35 | String[] hscodeArrays = hscode.split(","); | 45 | String[] hscodeArrays = hscode.split(","); |
| 36 | if(hscodeArrays.length > 100){ | 46 | if(hscodeArrays.length > 100){ |
| 37 | - resultHsCode.setCode("30100"); | 47 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30100.getCode()); |
| 38 | - resultHsCode.setMsg("hscode编码个数超过100个"); | 48 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30100.getName()); |
| 39 | return resultHsCode; | 49 | return resultHsCode; |
| 40 | } | 50 | } |
| 41 | List<String> skuCodeList = Arrays.asList(hscodeArrays); | 51 | List<String> skuCodeList = Arrays.asList(hscodeArrays); |
| ... | @@ -56,15 +66,75 @@ public class HsCodeService { | ... | @@ -56,15 +66,75 @@ public class HsCodeService { |
| 56 | hsCodeList.add(hsCode); | 66 | hsCodeList.add(hsCode); |
| 57 | } | 67 | } |
| 58 | }); | 68 | }); |
| 69 | + //只能申报D类hscode监管条件hscode | ||
| 70 | + this.setHscodeSupervise(hsCodeList); | ||
| 71 | + resultHsCode.setSuccess(Boolean.TRUE); | ||
| 72 | + resultHsCode.setCode(ErrorCodeEnum.SUCCESS.getCode()); | ||
| 73 | + resultHsCode.setMsg(ErrorCodeEnum.SUCCESS.getName()); | ||
| 74 | + resultHsCode.setHsCodeResultList(hsCodeList); | ||
| 75 | + }catch(Exception ex){ | ||
| 76 | + log.error(ex.getMessage(),ex); | ||
| 77 | + resultHsCode.setSuccess(Boolean.FALSE); | ||
| 78 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30101.getCode()); | ||
| 79 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30101.getName()); | ||
| 80 | + } | ||
| 81 | + return resultHsCode; | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + /** | ||
| 85 | + * 根据hscode编码或者商品名称进行模糊查询 | ||
| 86 | + * @param hscode | ||
| 87 | + * @return | ||
| 88 | + */ | ||
| 89 | + public ResultHsCode fuzzyQueryHsCode(HsCodeParam hscode){ | ||
| 90 | + ResultHsCode resultHsCode = new ResultHsCode(Boolean.FALSE,"","",null); | ||
| 91 | + try{ | ||
| 92 | + //编码与品名都为空校验失败 | ||
| 93 | + if(StringUtil.isEmpty(hscode.getSkuCode()) && StringUtil.isEmpty(hscode.getSkuName())){ | ||
| 94 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30103.getCode()); | ||
| 95 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30103.getName()); | ||
| 96 | + return resultHsCode; | ||
| 97 | + } | ||
| 98 | + //编码长度大于50校验失败 | ||
| 99 | + if(!StringUtil.isEmpty(hscode.getSkuCode()) && hscode.getSkuCode().length() > 50){ | ||
| 100 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30104.getCode()); | ||
| 101 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30104.getName()); | ||
| 102 | + return resultHsCode; | ||
| 103 | + } | ||
| 104 | + //品名长度大于1000校验失败 | ||
| 105 | + if(!StringUtil.isEmpty(hscode.getSkuName()) && hscode.getSkuName().length() > 1000){ | ||
| 106 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30104.getCode()); | ||
| 107 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30104.getName()); | ||
| 108 | + return resultHsCode; | ||
| 109 | + } | ||
| 110 | + //编码长度小于4位字符校验失败 | ||
| 111 | + if(!StringUtil.isEmpty(hscode.getSkuCode()) && hscode.getSkuCode().length() < 4){ | ||
| 112 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30105.getCode()); | ||
| 113 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30105.getName()); | ||
| 114 | + return resultHsCode; | ||
| 115 | + } | ||
| 116 | + //品名长度小于2位字符校验失败 | ||
| 117 | + if(!StringUtil.isEmpty(hscode.getSkuName()) && hscode.getSkuName().length() < 2){ | ||
| 118 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30105.getCode()); | ||
| 119 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30105.getName()); | ||
| 120 | + return resultHsCode; | ||
| 121 | + } | ||
| 122 | + String skuCode = "%"+hscode.getSkuCode()+"%"; | ||
| 123 | + String skuName = "%"+hscode.getSkuName()+"%"; | ||
| 124 | + //模糊查询hscode信息 | ||
| 125 | + List<HsCode> hsCodeList = this.hsCodeRepository.fuzzyQueryHsCode(skuCode,skuName); | ||
| 126 | + //对查询数据进行处理,标志数据是否C类限制品名 | ||
| 127 | + //只能申报D类hscode监管条件hscode | ||
| 128 | + this.setHscodeSupervise(hsCodeList); | ||
| 59 | resultHsCode.setSuccess(Boolean.TRUE); | 129 | resultHsCode.setSuccess(Boolean.TRUE); |
| 60 | - resultHsCode.setCode("0"); | 130 | + resultHsCode.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 61 | - resultHsCode.setMsg("操作成功"); | 131 | + resultHsCode.setMsg(ErrorCodeEnum.SUCCESS.getName()); |
| 62 | resultHsCode.setHsCodeResultList(hsCodeList); | 132 | resultHsCode.setHsCodeResultList(hsCodeList); |
| 63 | }catch(Exception ex){ | 133 | }catch(Exception ex){ |
| 64 | log.error(ex.getMessage(),ex); | 134 | log.error(ex.getMessage(),ex); |
| 65 | resultHsCode.setSuccess(Boolean.FALSE); | 135 | resultHsCode.setSuccess(Boolean.FALSE); |
| 66 | - resultHsCode.setCode("30101"); | 136 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30101.getCode()); |
| 67 | - resultHsCode.setMsg("数据查询异常"); | 137 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30101.getName()); |
| 68 | } | 138 | } |
| 69 | return resultHsCode; | 139 | return resultHsCode; |
| 70 | } | 140 | } |
| ... | @@ -78,17 +148,105 @@ public class HsCodeService { | ... | @@ -78,17 +148,105 @@ public class HsCodeService { |
| 78 | try{ | 148 | try{ |
| 79 | List<HsCode> hsCodeList = this.hsCodeRepository.findAllHsCodeList(); | 149 | List<HsCode> hsCodeList = this.hsCodeRepository.findAllHsCodeList(); |
| 80 | resultHsCode.setSuccess(Boolean.TRUE); | 150 | resultHsCode.setSuccess(Boolean.TRUE); |
| 81 | - resultHsCode.setCode("0"); | 151 | + resultHsCode.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 82 | - resultHsCode.setMsg("操作成功"); | 152 | + resultHsCode.setMsg(ErrorCodeEnum.SUCCESS.getName()); |
| 83 | resultHsCode.setHsCodeResultList(hsCodeList); | 153 | resultHsCode.setHsCodeResultList(hsCodeList); |
| 84 | }catch(Exception ex){ | 154 | }catch(Exception ex){ |
| 85 | - log.error(ex.getMessage()); | 155 | + log.error(ex.getMessage(),ex); |
| 86 | - | ||
| 87 | - log.error(ex.getMessage(),ex); | ||
| 88 | resultHsCode.setSuccess(Boolean.FALSE); | 156 | resultHsCode.setSuccess(Boolean.FALSE); |
| 89 | - resultHsCode.setCode("30101"); | 157 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30101.getCode()); |
| 90 | - resultHsCode.setMsg("数据查询异常"); | 158 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30101.getName()); |
| 91 | } | 159 | } |
| 92 | return resultHsCode; | 160 | return resultHsCode; |
| 93 | } | 161 | } |
| 94 | -} | 162 | + |
| 163 | + /** | ||
| 164 | + * 只能申报D类hscode监管条件hscode | ||
| 165 | + * 设置hscode | ||
| 166 | + * mt | ||
| 167 | + * 2023年2月24日17:29:49 | ||
| 168 | + */ | ||
| 169 | + public void setHscodeSupervise(List<HsCode> hsCodeList){ | ||
| 170 | + List<Long> hsCodeIds = new ArrayList<>(); | ||
| 171 | + Map<String,Object> hscodeMap = this.getHscodeSupervise(); | ||
| 172 | + StringBuffer shsql = new StringBuffer("'"); | ||
| 173 | + if (hscodeMap !=null && hscodeMap.size()>0){ | ||
| 174 | + for (Map.Entry hscodeEntry :hscodeMap.entrySet()){ | ||
| 175 | + HsCode hsCode = (HsCode) hscodeEntry.getValue(); | ||
| 176 | + hsCodeIds.add(hsCode.getId()); | ||
| 177 | + } | ||
| 178 | + } | ||
| 179 | + hsCodeList.forEach(hsCode->{ | ||
| 180 | + //判断该hscode是否只能申报D类 | ||
| 181 | + if(hsCodeIds.contains(hsCode.getId())){ | ||
| 182 | + //d类 | ||
| 183 | + hsCode.setRestrictedC(1); | ||
| 184 | + }else{ | ||
| 185 | + //C类 | ||
| 186 | + hsCode.setRestrictedC(0); | ||
| 187 | + } | ||
| 188 | + //如果ID为空,则设置为空 | ||
| 189 | + if(hsCode.getId() == null){ | ||
| 190 | + hsCode.setRestrictedC(null); | ||
| 191 | + } | ||
| 192 | + }); | ||
| 193 | + } | ||
| 194 | + | ||
| 195 | + /** | ||
| 196 | + * 根据监管条件获取数据,只能申报D类hscode信息 | ||
| 197 | + * mt | ||
| 198 | + * 2023年2月24日16:43:46 | ||
| 199 | + * @return | ||
| 200 | + */ | ||
| 201 | + private Map<String,Object> getHscodeSupervise(){ | ||
| 202 | + try { | ||
| 203 | + Map<String,Object> returnMap = new HashMap<>(); | ||
| 204 | + List<String> dictionaryEntriesList = dicEntriesRepository.findDicEntByCodeList(Constant.supervise_condition,1); | ||
| 205 | + if (dictionaryEntriesList !=null && dictionaryEntriesList.size()>0){ | ||
| 206 | + String chinsesName = "%["; | ||
| 207 | + for (int i= 0;i<dictionaryEntriesList.size();i++){ | ||
| 208 | + if (dictionaryEntriesList.size() -1 == i){ | ||
| 209 | + chinsesName += dictionaryEntriesList.get(i)+"]%"; | ||
| 210 | + }else{ | ||
| 211 | + chinsesName += dictionaryEntriesList.get(i)+"|"; | ||
| 212 | + } | ||
| 213 | + } | ||
| 214 | + //查询监管条件数据 | ||
| 215 | + List<HsCode> hsCodeList = this.hsCodeRepository.findMonitorCondition(chinsesName); | ||
| 216 | + hsCodeList.forEach(hsCode->{ | ||
| 217 | + String newCode = getSubHscode(hsCode.getSkuCode()); | ||
| 218 | + returnMap.put(newCode,hsCode); | ||
| 219 | + }); | ||
| 220 | + } | ||
| 221 | + return returnMap; | ||
| 222 | + }catch (Exception e){ | ||
| 223 | + log.error(e.getMessage(),e); | ||
| 224 | + } | ||
| 225 | + return null; | ||
| 226 | + } | ||
| 227 | + | ||
| 228 | + /** | ||
| 229 | + * 对商品编码进行处理 | ||
| 230 | + * @param code | ||
| 231 | + * @return | ||
| 232 | + */ | ||
| 233 | + private String getSubHscode(String code){ | ||
| 234 | + try { | ||
| 235 | + if (!StringUtil.isEmptyWithTrim(code) && code.length()>6) { | ||
| 236 | + if (code.length() == 7) { | ||
| 237 | + code = "0" + code + "00"; | ||
| 238 | + } else if (code.length() == 8) { | ||
| 239 | + code = code + "00"; | ||
| 240 | + } else if (code.length() == 9) { | ||
| 241 | + code = "0" + code; | ||
| 242 | + } else if (code.length() > 10) { | ||
| 243 | + code = code.substring(0, 10); | ||
| 244 | + } | ||
| 245 | + return code; | ||
| 246 | + } | ||
| 247 | + }catch (Exception e){ | ||
| 248 | + log.error(e.getMessage(),e); | ||
| 249 | + } | ||
| 250 | + return null; | ||
| 251 | + } | ||
| 252 | +} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -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 | - | 36 | +} |
| 45 | - | ||
| 46 | -} | ||
| ... | \ 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 | - | 51 | +} |
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | - | ||
| 58 | - | ||
| 59 | - | ||
| 60 | - | ||
| 61 | - | ||
| 62 | -} | ||
| ... | \ 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){ | ... | ... |
| ... | @@ -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 = "1649839249891"; | 27 | + public static String timeStamp = "1624263798669"; |
| 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("DEMO3" + "iClearExportDemo3" + "29497b9d80c51f8b" + ApiTest.timeStamp); | 36 | + String token = SHA256Util.getSHA256String("DEMO1" + "iClearExportDemo1" + "8c7f1108316abfb1" + 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