Merge branches 'API-2023-03-12' and 'master' of http://118.178.128.178//Fedex/iClear-api
Conflicts: doc/FedEx在线申报系统API - HSCode.docx src/main/java/com/erry/iclear/dateInterface/api/FedexDataInterface.java src/main/java/com/erry/iclear/dateInterface/interceptor/HsCodeInterceptor.java src/main/java/com/erry/iclear/dateInterface/interceptor/SignInterceptor.java src/main/java/com/erry/iclear/dateInterface/service/MawbDetailService.java
Showing
42 changed files
with
472 additions
and
1115 deletions
No preview for this file type
doc/TariffCCC.xlsx
0 → 100644
No preview for this file type
sql/C类运单号校验/C类运单号校验.sql
0 → 100644
| 1 | +ALTER TABLE T_ICLEAR_API_APPINFO | ||
| 2 | +ADD C_CODE_CHECK VARCHAR(1) | ||
| 3 | + | ||
| 4 | +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'C类校验是否校验运单号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'T_ICLEAR_API_APPINFO', @level2type=N'COLUMN',@level2name=N'C_CODE_CHECK' | ||
| 5 | +GO | ||
| 6 | + | ||
| 7 | +/****** 创建hscode表索引 ******/ | ||
| 8 | +CREATE NONCLUSTERED INDEX [nci_wi_T_CC_HS_CODE_SKU_CODE_SKUNAME] ON T_CC_HS_CODE | ||
| 9 | +( | ||
| 10 | + SKU_CODE ASC, | ||
| 11 | + SKUNAME ASC | ||
| 12 | +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] | ||
| 13 | +GO | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| ... | @@ -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.enums.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.enums.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 | } | ... | ... |
| 1 | package com.erry.iclear.dateInterface.api; | 1 | package com.erry.iclear.dateInterface.api; |
| 2 | 2 | ||
| 3 | 3 | ||
| 4 | -import com.arronlong.httpclientutil.HttpClientUtil; | ||
| 5 | -import com.arronlong.httpclientutil.common.HttpConfig; | ||
| 6 | -import com.arronlong.httpclientutil.common.HttpHeader; | ||
| 7 | import com.arronlong.httpclientutil.exception.HttpProcessException; | 4 | import com.arronlong.httpclientutil.exception.HttpProcessException; |
| 5 | +import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; | ||
| 8 | import com.erry.iclear.dateInterface.api.request.*; | 6 | import com.erry.iclear.dateInterface.api.request.*; |
| 9 | import com.erry.iclear.dateInterface.api.response.FedexResultChmRS; | 7 | import com.erry.iclear.dateInterface.api.response.FedexResultChmRS; |
| 10 | import com.erry.iclear.dateInterface.api.response.FedexResultRS; | 8 | import com.erry.iclear.dateInterface.api.response.FedexResultRS; |
| 11 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 9 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 12 | -import com.erry.iclear.dateInterface.entity.ChmConsignment; | 10 | +import com.erry.iclear.dateInterface.common.Constant; |
| 13 | -import com.erry.iclear.dateInterface.entity.DeclaredInfo; | 11 | +import com.erry.iclear.dateInterface.entity.*; |
| 14 | -import com.erry.iclear.dateInterface.entity.IClearApiLog; | ||
| 15 | -import com.erry.iclear.dateInterface.entity.TIClearApiCheckLog; | ||
| 16 | import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; | 12 | import com.erry.iclear.dateInterface.repository.ChmConsignmentRepository; |
| 17 | import com.erry.iclear.dateInterface.repository.IClearApiCheckLogRepository; | 13 | import com.erry.iclear.dateInterface.repository.IClearApiCheckLogRepository; |
| 18 | import com.erry.iclear.dateInterface.service.*; | 14 | import com.erry.iclear.dateInterface.service.*; |
| ... | @@ -22,11 +18,9 @@ import com.erry.iclear.dateInterface.util.StringUtil; | ... | @@ -22,11 +18,9 @@ import com.erry.iclear.dateInterface.util.StringUtil; |
| 22 | import com.google.gson.Gson; | 18 | import com.google.gson.Gson; |
| 23 | import io.swagger.annotations.ApiOperation; | 19 | import io.swagger.annotations.ApiOperation; |
| 24 | import lombok.extern.slf4j.Slf4j; | 20 | import lombok.extern.slf4j.Slf4j; |
| 25 | -import org.apache.http.Header; | ||
| 26 | import org.springframework.beans.factory.annotation.Autowired; | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| 27 | import org.springframework.beans.factory.annotation.Value; | 22 | import org.springframework.beans.factory.annotation.Value; |
| 28 | import org.springframework.util.StopWatch; | 23 | import org.springframework.util.StopWatch; |
| 29 | -import org.springframework.validation.annotation.Validated; | ||
| 30 | import org.springframework.web.bind.annotation.*; | 24 | import org.springframework.web.bind.annotation.*; |
| 31 | 25 | ||
| 32 | import javax.servlet.http.HttpServletRequest; | 26 | import javax.servlet.http.HttpServletRequest; |
| ... | @@ -65,7 +59,6 @@ public class FedexDataInterface { | ... | @@ -65,7 +59,6 @@ public class FedexDataInterface { |
| 65 | @Value("${api.address.iclear-submit-url}") | 59 | @Value("${api.address.iclear-submit-url}") |
| 66 | String iclearCSubmitUrl; | 60 | String iclearCSubmitUrl; |
| 67 | 61 | ||
| 68 | - | ||
| 69 | @ApiOperation(value = "C类运单数据校验接口", httpMethod = "POST", notes = "ex: http://192.168.1.75:8080/fedex/checkBASFMawbFedex") | 62 | @ApiOperation(value = "C类运单数据校验接口", httpMethod = "POST", notes = "ex: http://192.168.1.75:8080/fedex/checkBASFMawbFedex") |
| 70 | @PostMapping("/checkMawbFedexC") | 63 | @PostMapping("/checkMawbFedexC") |
| 71 | @ResponseBody | 64 | @ResponseBody |
| ... | @@ -77,6 +70,8 @@ public class FedexDataInterface { | ... | @@ -77,6 +70,8 @@ public class FedexDataInterface { |
| 77 | String token=(String) request.getHeader("Token"); | 70 | String token=(String) request.getHeader("Token"); |
| 78 | String addr = request.getRemoteAddr(); | 71 | String addr = request.getRemoteAddr(); |
| 79 | 72 | ||
| 73 | + //获取APPINFO信息 | ||
| 74 | + AppInfo appInfo = Constant.appInfoCache.get(appId + appKey); | ||
| 80 | 75 | ||
| 81 | TIClearApiCheckLog tIclearApiCheckLog = new TIClearApiCheckLog(); | 76 | TIClearApiCheckLog tIclearApiCheckLog = new TIClearApiCheckLog(); |
| 82 | tIclearApiCheckLog.setRequestAppid(appId); | 77 | tIclearApiCheckLog.setRequestAppid(appId); |
| ... | @@ -96,7 +91,7 @@ public class FedexDataInterface { | ... | @@ -96,7 +91,7 @@ public class FedexDataInterface { |
| 96 | log.info("checkBASFMawbFedex:"+fedexc.toString()); | 91 | log.info("checkBASFMawbFedex:"+fedexc.toString()); |
| 97 | log.info("appId:{},appKey:{},timeStamp:{},token:{}",appId,appKey,timeStamp,token); | 92 | log.info("appId:{},appKey:{},timeStamp:{},token:{}",appId,appKey,timeStamp,token); |
| 98 | 93 | ||
| 99 | - ResultRS result = fedexService.checkBasfInterfaceData(fedexc); | 94 | + ResultRS result = fedexService.checkBasfInterfaceData(fedexc,appInfo); |
| 100 | 95 | ||
| 101 | StopWatch sw = new StopWatch("checkBASFMawbFedex"); | 96 | StopWatch sw = new StopWatch("checkBASFMawbFedex"); |
| 102 | sw.start("generate FedexMawb"); | 97 | sw.start("generate FedexMawb"); |
| ... | @@ -106,18 +101,24 @@ public class FedexDataInterface { | ... | @@ -106,18 +101,24 @@ public class FedexDataInterface { |
| 106 | 101 | ||
| 107 | sw.start("checkFedexMawb"); | 102 | sw.start("checkFedexMawb"); |
| 108 | String msg = result.getMsg(); | 103 | String msg = result.getMsg(); |
| 109 | - String iclearCheckMsg = fedexService.checkFedexMawb(saveMawbFedexResult).getMsg(); | 104 | + String iclearCheckMsg = fedexService.checkFedexMawb(saveMawbFedexResult,appInfo).getMsg(); |
| 110 | - if(StringUtil.isEmpty(msg) && StringUtil.isEmpty(iclearCheckMsg)){ | 105 | + if(result.getSuccess() && StringUtil.isEmpty(iclearCheckMsg)){ |
| 111 | result.setSuccess(Boolean.TRUE); | 106 | result.setSuccess(Boolean.TRUE); |
| 112 | }else{ | 107 | }else{ |
| 108 | + if(result.getSuccess()){ | ||
| 109 | + //基本非空信息验证通过,并且iclear验证失败 | ||
| 110 | + result.setMsg(iclearCheckMsg); | ||
| 111 | + }else{ | ||
| 112 | + //基本非空信息验证失败,并且iclear验证失败 | ||
| 113 | result.setMsg(msg+";"+iclearCheckMsg); | 113 | result.setMsg(msg+";"+iclearCheckMsg); |
| 114 | } | 114 | } |
| 115 | + } | ||
| 115 | sw.stop(); | 116 | sw.stop(); |
| 116 | 117 | ||
| 117 | log.info(sw.prettyPrint()); | 118 | log.info(sw.prettyPrint()); |
| 118 | if(result.getSuccess()){ | 119 | if(result.getSuccess()){ |
| 119 | result.setSuccess(Boolean.TRUE); | 120 | result.setSuccess(Boolean.TRUE); |
| 120 | - result.setCode("0"); | 121 | + result.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 121 | } | 122 | } |
| 122 | tiClearApiCheckLogSave.setResponseText(result.getMsg()); | 123 | tiClearApiCheckLogSave.setResponseText(result.getMsg()); |
| 123 | tiClearApiCheckLogSave.setCode(result.getCode()); | 124 | tiClearApiCheckLogSave.setCode(result.getCode()); |
| ... | @@ -128,9 +129,7 @@ public class FedexDataInterface { | ... | @@ -128,9 +129,7 @@ public class FedexDataInterface { |
| 128 | return result; | 129 | return result; |
| 129 | } | 130 | } |
| 130 | 131 | ||
| 131 | - | 132 | + @ApiOperation(value = "Fedex推送运单数据", httpMethod = "POST", notes = "ex: http://192.168.1.75:8080/fedex/sendMawbFedex") |
| 132 | - | ||
| 133 | - @ApiOperation(value = "C类Fedex推送运单数据", httpMethod = "POST", notes = "ex: http://192.168.1.75:8080/fedex/sendMawbFedex") | ||
| 134 | @PostMapping("/sendMawbFedex") | 133 | @PostMapping("/sendMawbFedex") |
| 135 | @ResponseBody | 134 | @ResponseBody |
| 136 | public ResultRS sendMawbFedex(HttpServletRequest request | 135 | public ResultRS sendMawbFedex(HttpServletRequest request |
| ... | @@ -139,12 +138,11 @@ public class FedexDataInterface { | ... | @@ -139,12 +138,11 @@ public class FedexDataInterface { |
| 139 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); | 138 | ResultRS result = new ResultRS(Boolean.FALSE,"",""); |
| 140 | 139 | ||
| 141 | if(Objects.equals(fedexc,null)){ | 140 | if(Objects.equals(fedexc,null)){ |
| 142 | - result.setCode("-7"); | 141 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 143 | - result.setMsg("请求信息不能为空"); | 142 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 144 | return result; | 143 | return result; |
| 145 | } | 144 | } |
| 146 | //1、保存请求信息,保存到iClear的 SQLServer | 145 | //1、保存请求信息,保存到iClear的 SQLServer |
| 147 | - | ||
| 148 | StopWatch sw = new StopWatch("receice mawbFedex"); | 146 | StopWatch sw = new StopWatch("receice mawbFedex"); |
| 149 | sw.start("save log"); | 147 | sw.start("save log"); |
| 150 | 148 | ||
| ... | @@ -175,7 +173,7 @@ public class FedexDataInterface { | ... | @@ -175,7 +173,7 @@ public class FedexDataInterface { |
| 175 | 173 | ||
| 176 | //2、TODO 校验主单 | 174 | //2、TODO 校验主单 |
| 177 | sw.start("checkFedexMawb"); | 175 | sw.start("checkFedexMawb"); |
| 178 | - result=fedexService.checkFedexMawb(saveMawbFedexResult); | 176 | + result=fedexService.checkFedexMawb(saveMawbFedexResult,null); |
| 179 | if(!result.getSuccess()){ | 177 | if(!result.getSuccess()){ |
| 180 | return result; | 178 | return result; |
| 181 | } | 179 | } |
| ... | @@ -189,7 +187,6 @@ public class FedexDataInterface { | ... | @@ -189,7 +187,6 @@ public class FedexDataInterface { |
| 189 | // } | 187 | // } |
| 190 | // sw.stop(); | 188 | // sw.stop(); |
| 191 | 189 | ||
| 192 | - | ||
| 193 | //4、保存运单到iclear中 | 190 | //4、保存运单到iclear中 |
| 194 | sw.start("processChmConsignment"); | 191 | sw.start("processChmConsignment"); |
| 195 | result = chmConsignmentService.processChmConsignmentFedex(saveMawbFedexResult, timeStamp,appId); | 192 | result = chmConsignmentService.processChmConsignmentFedex(saveMawbFedexResult, timeStamp,appId); |
| ... | @@ -216,10 +213,8 @@ public class FedexDataInterface { | ... | @@ -216,10 +213,8 @@ public class FedexDataInterface { |
| 216 | headerMap.put("Content-Type", "application/json"); | 213 | headerMap.put("Content-Type", "application/json"); |
| 217 | String json = HttpUtils.doPost(this.iclearCSubmitUrl,objJson,headerMap); | 214 | String json = HttpUtils.doPost(this.iclearCSubmitUrl,objJson,headerMap); |
| 218 | 215 | ||
| 219 | - | ||
| 220 | log.info("<<<<<<<< checkfedexMawb start >>>>>>>>>> result :" +result.getSuccess() +" iclear check response : " + json + " status : " + result.getSuccess()); | 216 | log.info("<<<<<<<< checkfedexMawb start >>>>>>>>>> result :" +result.getSuccess() +" iclear check response : " + json + " status : " + result.getSuccess()); |
| 221 | 217 | ||
| 222 | - | ||
| 223 | //5、更新日志 | 218 | //5、更新日志 |
| 224 | sw.start("updateIClearApiLog"); | 219 | sw.start("updateIClearApiLog"); |
| 225 | if(!Objects.equals(saveIClearApiLogResult,null)){ | 220 | if(!Objects.equals(saveIClearApiLogResult,null)){ |
| ... | @@ -236,7 +231,7 @@ public class FedexDataInterface { | ... | @@ -236,7 +231,7 @@ public class FedexDataInterface { |
| 236 | 231 | ||
| 237 | //6、return result | 232 | //6、return result |
| 238 | result.setSuccess(Boolean.TRUE); | 233 | result.setSuccess(Boolean.TRUE); |
| 239 | - result.setCode("0"); | 234 | + result.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 240 | return result; | 235 | return result; |
| 241 | } | 236 | } |
| 242 | 237 | ||
| ... | @@ -250,13 +245,13 @@ public class FedexDataInterface { | ... | @@ -250,13 +245,13 @@ public class FedexDataInterface { |
| 250 | //获取请求的运单号 | 245 | //获取请求的运单号 |
| 251 | String[] splitConsignment = StringUtil.split(consignmentCode.getConsignmentCode(),","); | 246 | String[] splitConsignment = StringUtil.split(consignmentCode.getConsignmentCode(),","); |
| 252 | if(splitConsignment.length > 20){ | 247 | if(splitConsignment.length > 20){ |
| 253 | - result.setCode("30001"); | 248 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 254 | result.setMsg("请求信息不能大于20条运单"); | 249 | result.setMsg("请求信息不能大于20条运单"); |
| 255 | return result; | 250 | return result; |
| 256 | } | 251 | } |
| 257 | if(splitConsignment.length<1){ | 252 | if(splitConsignment.length<1){ |
| 258 | - result.setCode("-7"); | 253 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 259 | - result.setMsg("请求信息不能为空"); | 254 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 260 | return result; | 255 | return result; |
| 261 | } | 256 | } |
| 262 | StopWatch sw = new StopWatch("receice mawbFedex"); | 257 | StopWatch sw = new StopWatch("receice mawbFedex"); |
| ... | @@ -295,7 +290,7 @@ public class FedexDataInterface { | ... | @@ -295,7 +290,7 @@ public class FedexDataInterface { |
| 295 | log.info("Fedex申报数据请求成功!"); | 290 | log.info("Fedex申报数据请求成功!"); |
| 296 | //6、return result | 291 | //6、return result |
| 297 | result.setSuccess(Boolean.TRUE); | 292 | result.setSuccess(Boolean.TRUE); |
| 298 | - result.setCode("0"); | 293 | + result.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 299 | return result; | 294 | return result; |
| 300 | } | 295 | } |
| 301 | 296 | ||
| ... | @@ -309,13 +304,13 @@ public class FedexDataInterface { | ... | @@ -309,13 +304,13 @@ public class FedexDataInterface { |
| 309 | //获取请求的运单号 | 304 | //获取请求的运单号 |
| 310 | String[] splitConsignment = StringUtil.split(consignmentCode.getConsignmentCode(),","); | 305 | String[] splitConsignment = StringUtil.split(consignmentCode.getConsignmentCode(),","); |
| 311 | if(splitConsignment.length > 20){ | 306 | if(splitConsignment.length > 20){ |
| 312 | - result.setCode("30001"); | 307 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 313 | result.setMsg("请求信息不能大于20条运单"); | 308 | result.setMsg("请求信息不能大于20条运单"); |
| 314 | return result; | 309 | return result; |
| 315 | } | 310 | } |
| 316 | if(splitConsignment.length<1){ | 311 | if(splitConsignment.length<1){ |
| 317 | - result.setCode("-7"); | 312 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 318 | - result.setMsg("请求信息不能为空"); | 313 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 319 | return result; | 314 | return result; |
| 320 | } | 315 | } |
| 321 | StopWatch sw = new StopWatch("receice mawbFedex"); | 316 | StopWatch sw = new StopWatch("receice mawbFedex"); |
| ... | @@ -354,8 +349,7 @@ public class FedexDataInterface { | ... | @@ -354,8 +349,7 @@ public class FedexDataInterface { |
| 354 | log.info("Fedex回执数据请求成功!"); | 349 | log.info("Fedex回执数据请求成功!"); |
| 355 | //6、return result | 350 | //6、return result |
| 356 | result.setSuccess(Boolean.TRUE); | 351 | result.setSuccess(Boolean.TRUE); |
| 357 | - result.setCode("0"); | 352 | + result.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 358 | return result; | 353 | return result; |
| 359 | } | 354 | } |
| 360 | - | ||
| 361 | } | 355 | } |
| ... | \ 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.enums.ErrorCodeEnum; | ||
| 3 | import com.erry.iclear.dateInterface.api.request.HsCodeParam; | 4 | import com.erry.iclear.dateInterface.api.request.HsCodeParam; |
| 4 | import com.erry.iclear.dateInterface.api.response.ResultHsCode; | 5 | import com.erry.iclear.dateInterface.api.response.ResultHsCode; |
| 5 | import com.erry.iclear.dateInterface.entity.IClearApiHsCodeLog; | 6 | import com.erry.iclear.dateInterface.entity.IClearApiHsCodeLog; |
| ... | @@ -28,7 +29,7 @@ public class HsCodeInterface { | ... | @@ -28,7 +29,7 @@ public class HsCodeInterface { |
| 28 | @Autowired | 29 | @Autowired |
| 29 | IClearApiHsCodeLogService iClearApiHsCodeLogService; | 30 | IClearApiHsCodeLogService iClearApiHsCodeLogService; |
| 30 | 31 | ||
| 31 | - @ApiOperation(value = "获取hscode数据", httpMethod = "POST", notes = "ex: http://192.168.1.71:8080/hscode/hscodeRequest") | 32 | + @ApiOperation(value = "获取最新HS Code信息接口", httpMethod = "POST", notes = "ex: http://192.168.1.71:8080/hscode/hscodeRequest") |
| 32 | @PostMapping("/hscodeRequest") | 33 | @PostMapping("/hscodeRequest") |
| 33 | @ResponseBody | 34 | @ResponseBody |
| 34 | public ResultHsCode hscodeRequest(HttpServletRequest request | 35 | public ResultHsCode hscodeRequest(HttpServletRequest request |
| ... | @@ -48,11 +49,10 @@ public class HsCodeInterface { | ... | @@ -48,11 +49,10 @@ public class HsCodeInterface { |
| 48 | resultHsCode = hsCodeService.findHsCodeListByCode(hscode.getHscode()); | 49 | resultHsCode = hsCodeService.findHsCodeListByCode(hscode.getHscode()); |
| 49 | return resultHsCode; | 50 | return resultHsCode; |
| 50 | } else { | 51 | } else { |
| 51 | - | ||
| 52 | //如果没有传hscode需要限制10分钟只能查询一次 | 52 | //如果没有传hscode需要限制10分钟只能查询一次 |
| 53 | - boolean rs = iClearApiHsCodeLogService.findIClearApiHsCodeLog(); | 53 | + boolean rs = iClearApiHsCodeLogService.findIClearApiHsCodeLog(appId); |
| 54 | if(rs == true){ | 54 | if(rs == true){ |
| 55 | - resultHsCode = new ResultHsCode(Boolean.FALSE,"10019","未指定hscode编码,10分钟之内只允许查询一次",null); | 55 | + resultHsCode = new ResultHsCode(Boolean.FALSE, ErrorCodeEnum.ERROR_10019.getCode(),ErrorCodeEnum.ERROR_10019.getName(),null); |
| 56 | }else{ | 56 | }else{ |
| 57 | resultHsCode = hsCodeService.findAllHsCodeList(); | 57 | resultHsCode = hsCodeService.findAllHsCodeList(); |
| 58 | } | 58 | } |
| ... | @@ -60,7 +60,7 @@ public class HsCodeInterface { | ... | @@ -60,7 +60,7 @@ public class HsCodeInterface { |
| 60 | } | 60 | } |
| 61 | }catch(Exception ex){ | 61 | }catch(Exception ex){ |
| 62 | log.error(ex.getMessage(),ex); | 62 | log.error(ex.getMessage(),ex); |
| 63 | - resultHsCode = new ResultHsCode(Boolean.FALSE,"30101","数据查询异常",null); | 63 | + resultHsCode = new ResultHsCode(Boolean.FALSE,ErrorCodeEnum.ERROR_30101.getCode(),ErrorCodeEnum.ERROR_30101.getName(),null); |
| 64 | return resultHsCode; | 64 | return resultHsCode; |
| 65 | }finally { | 65 | }finally { |
| 66 | iclearApiHsCodeLog.setReceiveResult(resultHsCode.getMsg()); | 66 | iclearApiHsCodeLog.setReceiveResult(resultHsCode.getMsg()); |
| ... | @@ -69,10 +69,51 @@ public class HsCodeInterface { | ... | @@ -69,10 +69,51 @@ public class HsCodeInterface { |
| 69 | long end = System.currentTimeMillis(); | 69 | long end = System.currentTimeMillis(); |
| 70 | iclearApiHsCodeLog.setSpendTime(end-begin); | 70 | iclearApiHsCodeLog.setSpendTime(end-begin); |
| 71 | //如果异常为hscode长度超过2000,将截取0到2000字符 | 71 | //如果异常为hscode长度超过2000,将截取0到2000字符 |
| 72 | - if(resultHsCode.getCode().equals("30102")){ | 72 | + if(resultHsCode.getCode().equals(ErrorCodeEnum.ERROR_30102.getCode())){ |
| 73 | - iclearApiHsCodeLog.setCode(iclearApiHsCodeLog.getCode().substring(0,2000)); | 73 | + iclearApiHsCodeLog.setCode(hscode.getHscode().substring(0,2000)); |
| 74 | + } | ||
| 75 | + iClearApiHsCodeLogService.saveIClearApiHsCodeLog(iclearApiHsCodeLog); | ||
| 76 | + } | ||
| 77 | + } | ||
| 78 | + | ||
| 79 | + @ApiOperation(value = "HSCODE通用模糊查询接口", httpMethod = "POST", notes = "ex: http://192.168.1.71:8080/hscode/fuzzyQuery") | ||
| 80 | + @PostMapping("/fuzzyQuery") | ||
| 81 | + @ResponseBody | ||
| 82 | + public ResultHsCode fuzzyQueryHsCode(HttpServletRequest request | ||
| 83 | + , @RequestBody HsCodeParam hscode) { | ||
| 84 | + log.info("接收到请求数据skuCode:【"+hscode.getSkuCode()+"】,skuName:【"+hscode.getSkuName()+"】"); | ||
| 85 | + String appId = (String) request.getHeader("Appid"); | ||
| 86 | + String appkey = (String) request.getHeader("Appkey"); | ||
| 87 | + IClearApiHsCodeLog iclearApiHsCodeLog = new IClearApiHsCodeLog(); | ||
| 88 | + ResultHsCode resultHsCode = null; | ||
| 89 | + long begin = System.currentTimeMillis(); | ||
| 90 | + try { | ||
| 91 | + iclearApiHsCodeLog.setAppId(appId); | ||
| 92 | + iclearApiHsCodeLog.setAppKey(appkey); | ||
| 93 | + iclearApiHsCodeLog.setCreateTime(new Date()); | ||
| 94 | + resultHsCode = hsCodeService.fuzzyQueryHsCode(hscode); | ||
| 95 | + iclearApiHsCodeLog.setReceiveResult(resultHsCode.getMsg()); | ||
| 96 | + iclearApiHsCodeLog.setErrorCode(resultHsCode.getCode()); | ||
| 97 | + iclearApiHsCodeLog.setResponseTime(new Date()); | ||
| 98 | + long end = System.currentTimeMillis(); | ||
| 99 | + iclearApiHsCodeLog.setSpendTime(end-begin); | ||
| 100 | + String skuCode = hscode.getSkuCode(); | ||
| 101 | + if(!StringUtil.isEmpty(skuCode) && 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); | ||
| 74 | } | 107 | } |
| 108 | + iclearApiHsCodeLog.setCode("[skuCode="+skuCode+"],[skuName="+skuName+"]"); | ||
| 75 | iClearApiHsCodeLogService.saveIClearApiHsCodeLog(iclearApiHsCodeLog); | 109 | iClearApiHsCodeLogService.saveIClearApiHsCodeLog(iclearApiHsCodeLog); |
| 110 | + return resultHsCode; | ||
| 111 | + }catch(Exception ex){ | ||
| 112 | + log.error(ex.getMessage(),ex); | ||
| 113 | + resultHsCode = new ResultHsCode(Boolean.FALSE,ErrorCodeEnum.ERROR_30101.getCode(),ErrorCodeEnum.ERROR_30101.getName(),null); | ||
| 114 | + return resultHsCode; | ||
| 115 | + }finally{ | ||
| 116 | + return resultHsCode; | ||
| 76 | } | 117 | } |
| 77 | } | 118 | } |
| 78 | } | 119 | } | ... | ... |
| ... | @@ -23,7 +23,7 @@ import java.util.Date; | ... | @@ -23,7 +23,7 @@ import java.util.Date; |
| 23 | @Slf4j | 23 | @Slf4j |
| 24 | public class VersionInterface { | 24 | public class VersionInterface { |
| 25 | //当前版本号 | 25 | //当前版本号 |
| 26 | - final String VERSION = "1.5"; | 26 | + final String VERSION = "1.7"; |
| 27 | 27 | ||
| 28 | @ApiOperation(value = "获取当前API版本", httpMethod = "GET", notes = "ex: http://192.168.1.71:8080/version/version") | 28 | @ApiOperation(value = "获取当前API版本", httpMethod = "GET", notes = "ex: http://192.168.1.71:8080/version/version") |
| 29 | @GetMapping("/version") | 29 | @GetMapping("/version") | ... | ... |
| ... | @@ -15,4 +15,8 @@ import java.io.Serializable; | ... | @@ -15,4 +15,8 @@ import java.io.Serializable; |
| 15 | public class HsCodeParam implements Serializable { | 15 | public class HsCodeParam implements Serializable { |
| 16 | private static final long serialVersionUID = 786697399667065141L; | 16 | private static final long serialVersionUID = 786697399667065141L; |
| 17 | String hscode; | 17 | String hscode; |
| 18 | + //hscode编码 | ||
| 19 | + String skuCode; | ||
| 20 | + //商品名称 | ||
| 21 | + String skuName; | ||
| 18 | } | 22 | } | ... | ... |
| ... | @@ -21,6 +21,4 @@ public class BaseModel implements Serializable { | ... | @@ -21,6 +21,4 @@ public class BaseModel implements Serializable { |
| 21 | public void setId(Long id) { | 21 | public void setId(Long id) { |
| 22 | this.id = id; | 22 | this.id = id; |
| 23 | } | 23 | } |
| 24 | - | ||
| 25 | - | ||
| 26 | } | 24 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | package com.erry.iclear.dateInterface.common; | 1 | package com.erry.iclear.dateInterface.common; |
| 2 | 2 | ||
| 3 | -import com.erry.iclear.dateInterface.entity.ChmCarryPort; | 3 | +import com.erry.iclear.dateInterface.entity.*; |
| 4 | -import com.erry.iclear.dateInterface.entity.DictionaryEntries; | ||
| 5 | -import com.erry.iclear.dateInterface.entity.DomesticDestinationMapping; | ||
| 6 | -import com.erry.iclear.dateInterface.entity.OrigplacecodeMapping; | ||
| 7 | import org.springframework.stereotype.Component; | 4 | import org.springframework.stereotype.Component; |
| 8 | 5 | ||
| 9 | import java.util.HashMap; | 6 | import java.util.HashMap; |
| ... | @@ -21,6 +18,11 @@ public class Constant { | ... | @@ -21,6 +18,11 @@ public class Constant { |
| 21 | public static Map<String,HashMap<String,String>> appIdSecurityCache = new HashMap<>(); | 18 | public static Map<String,HashMap<String,String>> appIdSecurityCache = new HashMap<>(); |
| 22 | 19 | ||
| 23 | /** | 20 | /** |
| 21 | + * APP INFO信息 | ||
| 22 | + */ | ||
| 23 | + public static Map<String,AppInfo> appInfoCache = new HashMap<>(); | ||
| 24 | + | ||
| 25 | + /** | ||
| 24 | * 字典表 code:entity | 26 | * 字典表 code:entity |
| 25 | */ | 27 | */ |
| 26 | public static Map<String , DictionaryEntries> dictionaryEntriesCache = new HashMap<>(); | 28 | public static Map<String , DictionaryEntries> dictionaryEntriesCache = new HashMap<>(); |
| ... | @@ -94,5 +96,8 @@ public class Constant { | ... | @@ -94,5 +96,8 @@ public class Constant { |
| 94 | 96 | ||
| 95 | public static String DECLARED_DOC_TYPE_ZERO="declaredDocType_00"; | 97 | public static String DECLARED_DOC_TYPE_ZERO="declaredDocType_00"; |
| 96 | 98 | ||
| 97 | - | 99 | + /** |
| 100 | + * 监管条件 | ||
| 101 | + */ | ||
| 102 | + public static final String supervise_condition = "superviseRestrict"; | ||
| 98 | } | 103 | } | ... | ... |
| 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()); | ... | ... |
| ... | @@ -34,5 +34,9 @@ public class AppInfo implements Serializable { | ... | @@ -34,5 +34,9 @@ public class AppInfo implements Serializable { |
| 34 | @Column(name = "IS_ENABLE") | 34 | @Column(name = "IS_ENABLE") |
| 35 | private String isEnable; | 35 | private String isEnable; |
| 36 | 36 | ||
| 37 | - | 37 | + /** |
| 38 | + * C类校验是否校验运单号,非空则不校验 | ||
| 39 | + */ | ||
| 40 | + @Column(name = "C_CODE_CHECK") | ||
| 41 | + private String codeCheck; | ||
| 38 | } | 42 | } | ... | ... |
| ... | @@ -416,6 +416,11 @@ public class ChmConsignment implements Serializable { | ... | @@ -416,6 +416,11 @@ public class ChmConsignment implements Serializable { |
| 416 | @OneToMany(mappedBy = "chmConsignment", cascade = CascadeType.ALL) | 416 | @OneToMany(mappedBy = "chmConsignment", cascade = CascadeType.ALL) |
| 417 | private List<ChmConsignmentDetail> chmConsignmentDetailList; | 417 | private List<ChmConsignmentDetail> chmConsignmentDetailList; |
| 418 | 418 | ||
| 419 | + /** | ||
| 420 | + * C类校验是否校验运单号,非空则不校验 | ||
| 421 | + */ | ||
| 422 | + @Transient | ||
| 423 | + private String codeCheck; | ||
| 419 | 424 | ||
| 420 | @Override | 425 | @Override |
| 421 | public String toString() { | 426 | public String toString() { | ... | ... |
| ... | @@ -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.enums; | ||
| 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 | +} |
| 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.enums.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.common.Constant; | 6 | import com.erry.iclear.dateInterface.common.Constant; |
| 7 | import com.erry.iclear.dateInterface.util.SHA256Util; | 7 | import com.erry.iclear.dateInterface.util.SHA256Util; |
| 8 | import lombok.extern.slf4j.Slf4j; | 8 | import lombok.extern.slf4j.Slf4j; |
| ... | @@ -15,7 +15,6 @@ import javax.servlet.http.HttpServletRequest; | ... | @@ -15,7 +15,6 @@ import javax.servlet.http.HttpServletRequest; |
| 15 | import javax.servlet.http.HttpServletResponse; | 15 | import javax.servlet.http.HttpServletResponse; |
| 16 | import java.io.IOException; | 16 | import java.io.IOException; |
| 17 | import java.io.PrintWriter; | 17 | import java.io.PrintWriter; |
| 18 | -import java.util.Enumeration; | ||
| 19 | import java.util.HashMap; | 18 | import java.util.HashMap; |
| 20 | 19 | ||
| 21 | /** | 20 | /** |
| ... | @@ -36,40 +35,40 @@ public class HsCodeInterceptor extends HandlerInterceptorAdapter { | ... | @@ -36,40 +35,40 @@ public class HsCodeInterceptor extends HandlerInterceptorAdapter { |
| 36 | //String uri = request.getRequestURI(); | 35 | //String uri = request.getRequestURI(); |
| 37 | 36 | ||
| 38 | if(StringUtils.isBlank(appId)){ | 37 | if(StringUtils.isBlank(appId)){ |
| 39 | - this.returnJson(response,false,"10016","Appid不能为空"); | 38 | + this.returnJson(response,false, ErrorCodeEnum.ERROR_10016.getCode(),ErrorCodeEnum.ERROR_10016.getName()); |
| 40 | return false; | 39 | return false; |
| 41 | } | 40 | } |
| 42 | 41 | ||
| 43 | if(StringUtils.isBlank(appkey)){ | 42 | if(StringUtils.isBlank(appkey)){ |
| 44 | - this.returnJson(response,false,"10017","Appkey不能为空"); | 43 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10017.getCode(),ErrorCodeEnum.ERROR_10017.getName()); |
| 45 | return false; | 44 | return false; |
| 46 | } | 45 | } |
| 47 | 46 | ||
| 48 | if(StringUtils.isBlank(timeStamp)){ | 47 | if(StringUtils.isBlank(timeStamp)){ |
| 49 | - this.returnJson(response,false,"10018","TimeStamp不能为空"); | 48 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10018.getCode(),ErrorCodeEnum.ERROR_10018.getName()); |
| 50 | return false; | 49 | return false; |
| 51 | } | 50 | } |
| 52 | 51 | ||
| 53 | if(StringUtils.isBlank(token)){ | 52 | if(StringUtils.isBlank(token)){ |
| 54 | - this.returnJson(response,false,"10013","token不能为空"); | 53 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10013.getCode(),ErrorCodeEnum.ERROR_10013.getName()); |
| 55 | return false; | 54 | return false; |
| 56 | } | 55 | } |
| 57 | 56 | ||
| 58 | HashMap<String,String> secretMap = Constant.appIdSecurityCache.get(appId); | 57 | HashMap<String,String> secretMap = Constant.appIdSecurityCache.get(appId); |
| 59 | if(secretMap==null){ | 58 | if(secretMap==null){ |
| 60 | - this.returnJson(response,false,"10001","系统异常,该appId没有注册"); | 59 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10001.getCode(),ErrorCodeEnum.ERROR_10001.getName()); |
| 61 | return false; | 60 | return false; |
| 62 | } | 61 | } |
| 63 | 62 | ||
| 64 | String secretInSys = secretMap.get(appkey); | 63 | String secretInSys = secretMap.get(appkey); |
| 65 | if (StringUtils.isBlank(secretInSys)) { | 64 | if (StringUtils.isBlank(secretInSys)) { |
| 66 | - this.returnJson(response,false,"10002","系统异常,该appId没有当前Appkey的权限"); | 65 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10002.getCode(),ErrorCodeEnum.ERROR_10002.getName()); |
| 67 | return false; | 66 | return false; |
| 68 | } | 67 | } |
| 69 | 68 | ||
| 70 | String sha256Str = SHA256Util.getSHA256String(appId+appkey+secretInSys+timeStamp); | 69 | String sha256Str = SHA256Util.getSHA256String(appId+appkey+secretInSys+timeStamp); |
| 71 | if(!token.equals(sha256Str)){ | 70 | if(!token.equals(sha256Str)){ |
| 72 | - this.returnJson(response,false,"10014","Token验证失败"); | 71 | + this.returnJson(response,false,ErrorCodeEnum.ERROR_10014.getCode(),ErrorCodeEnum.ERROR_10014.getName()); |
| 73 | return false; | 72 | return false; |
| 74 | } | 73 | } |
| 75 | return true; | 74 | return true; |
| ... | @@ -99,5 +98,4 @@ public class HsCodeInterceptor extends HandlerInterceptorAdapter { | ... | @@ -99,5 +98,4 @@ public class HsCodeInterceptor extends HandlerInterceptorAdapter { |
| 99 | } | 98 | } |
| 100 | } | 99 | } |
| 101 | } | 100 | } |
| 102 | - | ||
| 103 | } | 101 | } |
| ... | \ 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.enums.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.enums.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{ | ... | ... |
| ... | @@ -43,6 +43,7 @@ public class AppInfoService { | ... | @@ -43,6 +43,7 @@ public class AppInfoService { |
| 43 | HashMap<String, String> appkeyMap = new HashMap<String, String>(); | 43 | HashMap<String, String> appkeyMap = new HashMap<String, String>(); |
| 44 | appkeyMap.put(appInfo.getAppKey(), appInfo.getSecurity()); | 44 | appkeyMap.put(appInfo.getAppKey(), appInfo.getSecurity()); |
| 45 | Constant.appIdSecurityCache.put(appInfo.getAppId(), appkeyMap); | 45 | Constant.appIdSecurityCache.put(appInfo.getAppId(), appkeyMap); |
| 46 | + Constant.appInfoCache.put(appInfo.getAppId()+appInfo.getAppKey(),appInfo); | ||
| 46 | } | 47 | } |
| 47 | } catch (Exception e) { | 48 | } catch (Exception e) { |
| 48 | log.error("initAppInfo() error" + e.getMessage()); | 49 | log.error("initAppInfo() error" + e.getMessage()); | ... | ... |
| ... | @@ -166,13 +166,13 @@ public class ChmConsignmentDetailService { | ... | @@ -166,13 +166,13 @@ public class ChmConsignmentDetailService { |
| 166 | result.setSkuName(mawbDetail.getGname()); | 166 | result.setSkuName(mawbDetail.getGname()); |
| 167 | //成交数量 | 167 | //成交数量 |
| 168 | result.setKnockdownNumber(bigDecimalFormat(BigDecimal.valueOf(mawbDetail.getGqty().doubleValue()))); | 168 | result.setKnockdownNumber(bigDecimalFormat(BigDecimal.valueOf(mawbDetail.getGqty().doubleValue()))); |
| 169 | + //第二法定数量 | ||
| 170 | + result.setQtyLegalSecond(bigDecimalFormat(mawbDetail.getSecondQty())); | ||
| 169 | //第二计量单位 | 171 | //第二计量单位 |
| 170 | DictionaryEntries secondUnitDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getSecondUnit()); | 172 | DictionaryEntries secondUnitDictionaryEntries = Constant.dictionaryEntriesCache.get(Constant.TRANSACTION_UNIT+ mawbDetail.getSecondUnit()); |
| 171 | if(!Objects.equals(secondUnitDictionaryEntries,null)){ | 173 | if(!Objects.equals(secondUnitDictionaryEntries,null)){ |
| 172 | result.setUnitLegalSecondId(secondUnitDictionaryEntries); | 174 | result.setUnitLegalSecondId(secondUnitDictionaryEntries); |
| 173 | result.setUnitLegalSecond(secondUnitDictionaryEntries.getChineseName()); | 175 | result.setUnitLegalSecond(secondUnitDictionaryEntries.getChineseName()); |
| 174 | - //第二法定数量 | ||
| 175 | - result.setQtyLegalSecond(bigDecimalFormat(mawbDetail.getSecondQty())); | ||
| 176 | } | 176 | } |
| 177 | 177 | ||
| 178 | //成交币制 | 178 | //成交币制 | ... | ... |
| 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.enums.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; |
| ... | @@ -239,7 +240,7 @@ public class ChmConsignmentService { | ... | @@ -239,7 +240,7 @@ public class ChmConsignmentService { |
| 239 | return result; | 240 | return result; |
| 240 | } | 241 | } |
| 241 | 242 | ||
| 242 | - public ChmConsignment convertToChmConsignmentFedex(FedexMawb mawb, Date pushTime, String creator){ | 243 | + public ChmConsignment convertToChmConsignmentFedex(FedexMawb mawb, Date pushTime, String creator,AppInfo appInfo){ |
| 243 | ChmConsignment result = new ChmConsignment(); | 244 | ChmConsignment result = new ChmConsignment(); |
| 244 | try{ | 245 | try{ |
| 245 | //运单号 | 246 | //运单号 |
| ... | @@ -256,6 +257,11 @@ public class ChmConsignmentService { | ... | @@ -256,6 +257,11 @@ public class ChmConsignmentService { |
| 256 | result.setTradeModeDic(tradeModeDictionaryEntries); | 257 | result.setTradeModeDic(tradeModeDictionaryEntries); |
| 257 | result.setTradeMode(tradeModeDictionaryEntries.getChineseName()); | 258 | result.setTradeMode(tradeModeDictionaryEntries.getChineseName()); |
| 258 | }*/ | 259 | }*/ |
| 260 | + if(appInfo != null){ | ||
| 261 | + //C类校验是否校验运单号,非空则不校验 | ||
| 262 | + result.setCodeCheck(appInfo.getCodeCheck()); | ||
| 263 | + } | ||
| 264 | + | ||
| 259 | //境内收发货人社会信用证代码 | 265 | //境内收发货人社会信用证代码 |
| 260 | result.setTradeCoSCC(mawb.getTradeCodeScc()); | 266 | result.setTradeCoSCC(mawb.getTradeCodeScc()); |
| 261 | //境内发货人(经营单位编码) | 267 | //境内发货人(经营单位编码) |
| ... | @@ -487,8 +493,8 @@ public class ChmConsignmentService { | ... | @@ -487,8 +493,8 @@ public class ChmConsignmentService { |
| 487 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); | 493 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); |
| 488 | ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator); | 494 | ChmConsignment chmConsignment=this.convertToChmConsignment(mawb,pushTime,creator); |
| 489 | if(Objects.equals(chmConsignment,null)){ | 495 | if(Objects.equals(chmConsignment,null)){ |
| 490 | - result.setCode("30001"); | 496 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 491 | - result.setMsg("数据格式不正确"); | 497 | + result.setMsg(ErrorCodeEnum.ERROR_30001.getName()); |
| 492 | return result; | 498 | return result; |
| 493 | } | 499 | } |
| 494 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 500 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| ... | @@ -516,7 +522,7 @@ public class ChmConsignmentService { | ... | @@ -516,7 +522,7 @@ public class ChmConsignmentService { |
| 516 | log.info("主单"+ mawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); | 522 | log.info("主单"+ mawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); |
| 517 | }else{ | 523 | }else{ |
| 518 | log.info("主单"+ mawb.getBillNo()+" 保存失败"); | 524 | log.info("主单"+ mawb.getBillNo()+" 保存失败"); |
| 519 | - result.setCode("30002"); | 525 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 520 | result.setMsg("主单"+ mawb.getBillNo()+" 保存失败"); | 526 | result.setMsg("主单"+ mawb.getBillNo()+" 保存失败"); |
| 521 | return result; | 527 | return result; |
| 522 | } | 528 | } |
| ... | @@ -571,10 +577,10 @@ public class ChmConsignmentService { | ... | @@ -571,10 +577,10 @@ public class ChmConsignmentService { |
| 571 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); | 577 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); |
| 572 | try { | 578 | try { |
| 573 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); | 579 | Date pushTime = DateUtils.timeStampToDate(Long.valueOf(timeStamp)); |
| 574 | - ChmConsignment chmConsignment = this.convertToChmConsignmentFedex(fedexMawb,pushTime,creator); | 580 | + ChmConsignment chmConsignment = this.convertToChmConsignmentFedex(fedexMawb,pushTime,creator,null); |
| 575 | if(Objects.equals(chmConsignment,null)){ | 581 | if(Objects.equals(chmConsignment,null)){ |
| 576 | - result.setCode("30001"); | 582 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 577 | - result.setMsg("数据格式不正确"); | 583 | + result.setMsg(ErrorCodeEnum.ERROR_30001.getName()); |
| 578 | return result; | 584 | return result; |
| 579 | } | 585 | } |
| 580 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 586 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| ... | @@ -596,7 +602,7 @@ public class ChmConsignmentService { | ... | @@ -596,7 +602,7 @@ public class ChmConsignmentService { |
| 596 | log.info("主单"+ fedexMawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); | 602 | log.info("主单"+ fedexMawb.getBillNo()+" 保存成功,chmConsignmentId:"+chmConsignmentSaveResult.getId()); |
| 597 | }else{ | 603 | }else{ |
| 598 | log.info("主单"+ fedexMawb.getBillNo()+" 保存失败"); | 604 | log.info("主单"+ fedexMawb.getBillNo()+" 保存失败"); |
| 599 | - result.setCode("30002"); | 605 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 600 | result.setMsg("主单"+ fedexMawb.getBillNo()+" 保存失败"); | 606 | result.setMsg("主单"+ fedexMawb.getBillNo()+" 保存失败"); |
| 601 | return result; | 607 | return result; |
| 602 | } | 608 | } |
| ... | @@ -629,7 +635,7 @@ public class ChmConsignmentService { | ... | @@ -629,7 +635,7 @@ public class ChmConsignmentService { |
| 629 | log.info("主单"+ fedexMawb.getBillNo()+" 更新成功,chmConsignmentId:"+updateResult.getId()); | 635 | log.info("主单"+ fedexMawb.getBillNo()+" 更新成功,chmConsignmentId:"+updateResult.getId()); |
| 630 | }else{ | 636 | }else{ |
| 631 | log.info("主单"+ fedexMawb.getBillNo()+" 更新失败"); | 637 | log.info("主单"+ fedexMawb.getBillNo()+" 更新失败"); |
| 632 | - result.setCode("30003"); | 638 | + result.setCode(ErrorCodeEnum.ERROR_30003.getCode()); |
| 633 | result.setMsg("主单"+ fedexMawb.getBillNo()+" 更新失败"); | 639 | result.setMsg("主单"+ fedexMawb.getBillNo()+" 更新失败"); |
| 634 | return result; | 640 | return result; |
| 635 | } | 641 | } | ... | ... |
| 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.enums.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; |
| 7 | +import com.erry.iclear.dateInterface.entity.AppInfo; | ||
| 10 | import com.erry.iclear.dateInterface.entity.ChmConsignment; | 8 | import com.erry.iclear.dateInterface.entity.ChmConsignment; |
| 11 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; | 9 | import com.erry.iclear.dateInterface.entity.ChmConsignmentDetail; |
| 12 | import com.erry.iclear.dateInterface.repository.FedexMawbRepository; | 10 | import com.erry.iclear.dateInterface.repository.FedexMawbRepository; |
| 13 | import com.erry.iclear.dateInterface.util.HttpUtils; | 11 | import com.erry.iclear.dateInterface.util.HttpUtils; |
| 14 | import com.erry.iclear.dateInterface.util.JsonToJava; | 12 | import com.erry.iclear.dateInterface.util.JsonToJava; |
| 15 | import com.google.gson.Gson; | 13 | import com.google.gson.Gson; |
| 16 | -import io.swagger.annotations.ApiModelProperty; | ||
| 17 | import lombok.extern.slf4j.Slf4j; | 14 | import lombok.extern.slf4j.Slf4j; |
| 18 | import org.apache.commons.lang3.StringUtils; | 15 | import org.apache.commons.lang3.StringUtils; |
| 19 | -import org.apache.http.Header; | ||
| 20 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 21 | import org.springframework.beans.factory.annotation.Value; | 17 | 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; | 18 | 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.*; | 19 | import java.util.*; |
| 33 | import java.util.stream.Collectors; | 20 | import java.util.stream.Collectors; |
| 34 | 21 | ||
| ... | @@ -126,16 +113,16 @@ public class FedexService { | ... | @@ -126,16 +113,16 @@ public class FedexService { |
| 126 | * @param fedexMawb | 113 | * @param fedexMawb |
| 127 | * @return | 114 | * @return |
| 128 | */ | 115 | */ |
| 129 | - public ResultRS checkFedexMawb(FedexMawb fedexMawb){ | 116 | + public ResultRS checkFedexMawb(FedexMawb fedexMawb,AppInfo appInfo){ |
| 130 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); | 117 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); |
| 131 | try{ | 118 | try{ |
| 132 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(fedexMawb)); | 119 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(fedexMawb)); |
| 133 | 120 | ||
| 134 | //1、将请求转换为运单 | 121 | //1、将请求转换为运单 |
| 135 | - ChmConsignment chmConsignment=consignmentService.convertToChmConsignmentFedex(fedexMawb,null,"IDE-ICLEAR-API"); | 122 | + ChmConsignment chmConsignment=consignmentService.convertToChmConsignmentFedex(fedexMawb,null,"IDE-ICLEAR-API",appInfo); |
| 136 | if(Objects.equals(chmConsignment,null)){ | 123 | if(Objects.equals(chmConsignment,null)){ |
| 137 | - result.setCode("30001"); | 124 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 138 | - result.setMsg("数据格式不正确"); | 125 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 139 | return result; | 126 | return result; |
| 140 | } | 127 | } |
| 141 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 128 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| ... | @@ -180,18 +167,20 @@ public class FedexService { | ... | @@ -180,18 +167,20 @@ public class FedexService { |
| 180 | * @param fedexc | 167 | * @param fedexc |
| 181 | * @return | 168 | * @return |
| 182 | */ | 169 | */ |
| 183 | - public ResultRS checkBasfInterfaceData(Fedexc fedexc){ | 170 | + public ResultRS checkBasfInterfaceData(Fedexc fedexc, AppInfo appInfo){ |
| 184 | 171 | ||
| 185 | - ResultRS result = new ResultRS(Boolean.FALSE,"",""); | 172 | + ResultRS result = new ResultRS(Boolean.TRUE,null,null); |
| 186 | 173 | ||
| 187 | if(Objects.equals(fedexc,null)){ | 174 | if(Objects.equals(fedexc,null)){ |
| 188 | - result.setCode("-7"); | 175 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 189 | - result.setMsg("请求信息不能为空"); | 176 | + result.setMsg(ErrorCodeEnum.ERROR_7.getName()); |
| 177 | + result.setSuccess(Boolean.FALSE); | ||
| 190 | }else{ | 178 | }else{ |
| 191 | List<String> msgList = new ArrayList<>(); | 179 | List<String> msgList = new ArrayList<>(); |
| 192 | // 参数consignmentCode不能为空 | 180 | // 参数consignmentCode不能为空 |
| 193 | String consignmentCode = fedexc.getConsignmentCode(); | 181 | String consignmentCode = fedexc.getConsignmentCode(); |
| 194 | - if(StringUtils.isEmpty(consignmentCode)){ | 182 | + //C类校验是否校验运单号,非空则不校验 |
| 183 | + if(appInfo.getCodeCheck() == null && StringUtils.isEmpty(consignmentCode)){ | ||
| 195 | msgList.add("参数consignmentCode不能为空"); | 184 | msgList.add("参数consignmentCode不能为空"); |
| 196 | } | 185 | } |
| 197 | // 参数consignmentId不能为空 | 186 | // 参数consignmentId不能为空 |
| ... | @@ -216,8 +205,9 @@ public class FedexService { | ... | @@ -216,8 +205,9 @@ public class FedexService { |
| 216 | } | 205 | } |
| 217 | if(msgList.size() > 0){ | 206 | if(msgList.size() > 0){ |
| 218 | String join = msgList.stream().collect(Collectors.joining(";")); | 207 | String join = msgList.stream().collect(Collectors.joining(";")); |
| 219 | - result.setCode("-7"); | 208 | + result.setCode(ErrorCodeEnum.ERROR_7.getCode()); |
| 220 | result.setMsg(join); | 209 | result.setMsg(join); |
| 210 | + result.setSuccess(Boolean.FALSE); | ||
| 221 | } | 211 | } |
| 222 | } | 212 | } |
| 223 | return result; | 213 | return result; | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | +import com.erry.iclear.dateInterface.enums.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.util.*; |
| 11 | 16 | ||
| 12 | /** | 17 | /** |
| 13 | * hscode service | 18 | * hscode service |
| ... | @@ -17,8 +22,12 @@ import java.util.List; | ... | @@ -17,8 +22,12 @@ import java.util.List; |
| 17 | @Service | 22 | @Service |
| 18 | @Slf4j | 23 | @Slf4j |
| 19 | public class HsCodeService { | 24 | public class HsCodeService { |
| 25 | + | ||
| 20 | @Autowired | 26 | @Autowired |
| 21 | HsCodeRepository hsCodeRepository; | 27 | HsCodeRepository hsCodeRepository; |
| 28 | + @Autowired | ||
| 29 | + DictionaryEntriesRepository dicEntriesRepository; | ||
| 30 | + | ||
| 22 | /** | 31 | /** |
| 23 | * 根据hscode编码查询对应的hscode | 32 | * 根据hscode编码查询对应的hscode |
| 24 | * @param hscode | 33 | * @param hscode |
| ... | @@ -28,14 +37,14 @@ public class HsCodeService { | ... | @@ -28,14 +37,14 @@ public class HsCodeService { |
| 28 | ResultHsCode resultHsCode = new ResultHsCode(Boolean.FALSE,"","",null); | 37 | ResultHsCode resultHsCode = new ResultHsCode(Boolean.FALSE,"","",null); |
| 29 | try{ | 38 | try{ |
| 30 | if(hscode.length() > 2000){ | 39 | if(hscode.length() > 2000){ |
| 31 | - resultHsCode.setCode("30102"); | 40 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30102.getCode()); |
| 32 | - resultHsCode.setMsg("参数:hscode编码字段长度超过2000"); | 41 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30102.getName()); |
| 33 | return resultHsCode; | 42 | return resultHsCode; |
| 34 | } | 43 | } |
| 35 | String[] hscodeArrays = hscode.split(","); | 44 | String[] hscodeArrays = hscode.split(","); |
| 36 | if(hscodeArrays.length > 100){ | 45 | if(hscodeArrays.length > 100){ |
| 37 | - resultHsCode.setCode("30100"); | 46 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30100.getCode()); |
| 38 | - resultHsCode.setMsg("hscode编码个数超过100个"); | 47 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30100.getName()); |
| 39 | return resultHsCode; | 48 | return resultHsCode; |
| 40 | } | 49 | } |
| 41 | List<String> skuCodeList = Arrays.asList(hscodeArrays); | 50 | List<String> skuCodeList = Arrays.asList(hscodeArrays); |
| ... | @@ -56,15 +65,75 @@ public class HsCodeService { | ... | @@ -56,15 +65,75 @@ public class HsCodeService { |
| 56 | hsCodeList.add(hsCode); | 65 | hsCodeList.add(hsCode); |
| 57 | } | 66 | } |
| 58 | }); | 67 | }); |
| 68 | + //只能申报D类hscode监管条件hscode | ||
| 69 | + this.setHscodeSupervise(hsCodeList); | ||
| 70 | + resultHsCode.setSuccess(Boolean.TRUE); | ||
| 71 | + resultHsCode.setCode(ErrorCodeEnum.SUCCESS.getCode()); | ||
| 72 | + resultHsCode.setMsg(ErrorCodeEnum.SUCCESS.getName()); | ||
| 73 | + resultHsCode.setHsCodeResultList(hsCodeList); | ||
| 74 | + }catch(Exception ex){ | ||
| 75 | + log.error(ex.getMessage(),ex); | ||
| 76 | + resultHsCode.setSuccess(Boolean.FALSE); | ||
| 77 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30101.getCode()); | ||
| 78 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30101.getName()); | ||
| 79 | + } | ||
| 80 | + return resultHsCode; | ||
| 81 | + } | ||
| 82 | + | ||
| 83 | + /** | ||
| 84 | + * 根据hscode编码或者商品名称进行模糊查询 | ||
| 85 | + * @param hscode | ||
| 86 | + * @return | ||
| 87 | + */ | ||
| 88 | + public ResultHsCode fuzzyQueryHsCode(HsCodeParam hscode){ | ||
| 89 | + ResultHsCode resultHsCode = new ResultHsCode(Boolean.FALSE,"","",null); | ||
| 90 | + try{ | ||
| 91 | + //编码与品名都为空校验失败 | ||
| 92 | + if(StringUtil.isEmpty(hscode.getSkuCode()) && StringUtil.isEmpty(hscode.getSkuName())){ | ||
| 93 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30103.getCode()); | ||
| 94 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30103.getName()); | ||
| 95 | + return resultHsCode; | ||
| 96 | + } | ||
| 97 | + //编码长度大于50校验失败 | ||
| 98 | + if(!StringUtil.isEmpty(hscode.getSkuCode()) && hscode.getSkuCode().length() > 50){ | ||
| 99 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30104.getCode()); | ||
| 100 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30104.getName()); | ||
| 101 | + return resultHsCode; | ||
| 102 | + } | ||
| 103 | + //品名长度大于1000校验失败 | ||
| 104 | + if(!StringUtil.isEmpty(hscode.getSkuName()) && hscode.getSkuName().length() > 1000){ | ||
| 105 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30104.getCode()); | ||
| 106 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30104.getName()); | ||
| 107 | + return resultHsCode; | ||
| 108 | + } | ||
| 109 | + //编码长度小于4位字符校验失败 | ||
| 110 | + if(!StringUtil.isEmpty(hscode.getSkuCode()) && hscode.getSkuCode().length() < 4){ | ||
| 111 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30105.getCode()); | ||
| 112 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30105.getName()); | ||
| 113 | + return resultHsCode; | ||
| 114 | + } | ||
| 115 | + //品名长度小于2位字符校验失败 | ||
| 116 | + if(!StringUtil.isEmpty(hscode.getSkuName()) && hscode.getSkuName().length() < 2){ | ||
| 117 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30105.getCode()); | ||
| 118 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30105.getName()); | ||
| 119 | + return resultHsCode; | ||
| 120 | + } | ||
| 121 | + String skuCode = "%"+hscode.getSkuCode()+"%"; | ||
| 122 | + String skuName = "%"+hscode.getSkuName()+"%"; | ||
| 123 | + //模糊查询hscode信息 | ||
| 124 | + List<HsCode> hsCodeList = this.hsCodeRepository.fuzzyQueryHsCode(skuCode,skuName); | ||
| 125 | + //对查询数据进行处理,标志数据是否C类限制品名 | ||
| 126 | + //只能申报D类hscode监管条件hscode | ||
| 127 | + this.setHscodeSupervise(hsCodeList); | ||
| 59 | resultHsCode.setSuccess(Boolean.TRUE); | 128 | resultHsCode.setSuccess(Boolean.TRUE); |
| 60 | - resultHsCode.setCode("0"); | 129 | + resultHsCode.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 61 | - resultHsCode.setMsg("操作成功"); | 130 | + resultHsCode.setMsg(ErrorCodeEnum.SUCCESS.getName()); |
| 62 | resultHsCode.setHsCodeResultList(hsCodeList); | 131 | resultHsCode.setHsCodeResultList(hsCodeList); |
| 63 | }catch(Exception ex){ | 132 | }catch(Exception ex){ |
| 64 | log.error(ex.getMessage(),ex); | 133 | log.error(ex.getMessage(),ex); |
| 65 | resultHsCode.setSuccess(Boolean.FALSE); | 134 | resultHsCode.setSuccess(Boolean.FALSE); |
| 66 | - resultHsCode.setCode("30101"); | 135 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30101.getCode()); |
| 67 | - resultHsCode.setMsg("数据查询异常"); | 136 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30101.getName()); |
| 68 | } | 137 | } |
| 69 | return resultHsCode; | 138 | return resultHsCode; |
| 70 | } | 139 | } |
| ... | @@ -78,15 +147,105 @@ public class HsCodeService { | ... | @@ -78,15 +147,105 @@ public class HsCodeService { |
| 78 | try{ | 147 | try{ |
| 79 | List<HsCode> hsCodeList = this.hsCodeRepository.findAllHsCodeList(); | 148 | List<HsCode> hsCodeList = this.hsCodeRepository.findAllHsCodeList(); |
| 80 | resultHsCode.setSuccess(Boolean.TRUE); | 149 | resultHsCode.setSuccess(Boolean.TRUE); |
| 81 | - resultHsCode.setCode("0"); | 150 | + resultHsCode.setCode(ErrorCodeEnum.SUCCESS.getCode()); |
| 82 | - resultHsCode.setMsg("操作成功"); | 151 | + resultHsCode.setMsg(ErrorCodeEnum.SUCCESS.getName()); |
| 83 | resultHsCode.setHsCodeResultList(hsCodeList); | 152 | resultHsCode.setHsCodeResultList(hsCodeList); |
| 84 | }catch(Exception ex){ | 153 | }catch(Exception ex){ |
| 85 | log.error(ex.getMessage(),ex); | 154 | log.error(ex.getMessage(),ex); |
| 86 | resultHsCode.setSuccess(Boolean.FALSE); | 155 | resultHsCode.setSuccess(Boolean.FALSE); |
| 87 | - resultHsCode.setCode("30101"); | 156 | + resultHsCode.setCode(ErrorCodeEnum.ERROR_30101.getCode()); |
| 88 | - resultHsCode.setMsg("数据查询异常"); | 157 | + resultHsCode.setMsg(ErrorCodeEnum.ERROR_30101.getName()); |
| 89 | } | 158 | } |
| 90 | return resultHsCode; | 159 | return resultHsCode; |
| 91 | } | 160 | } |
| 161 | + | ||
| 162 | + /** | ||
| 163 | + * 只能申报D类hscode监管条件hscode | ||
| 164 | + * 设置hscode | ||
| 165 | + * mt | ||
| 166 | + * 2023年2月24日17:29:49 | ||
| 167 | + */ | ||
| 168 | + public void setHscodeSupervise(List<HsCode> hsCodeList){ | ||
| 169 | + List<Long> hsCodeIds = new ArrayList<>(); | ||
| 170 | + Map<String,Object> hscodeMap = this.getHscodeSupervise(); | ||
| 171 | + StringBuffer shsql = new StringBuffer("'"); | ||
| 172 | + if (hscodeMap !=null && hscodeMap.size()>0){ | ||
| 173 | + for (Map.Entry hscodeEntry :hscodeMap.entrySet()){ | ||
| 174 | + HsCode hsCode = (HsCode) hscodeEntry.getValue(); | ||
| 175 | + hsCodeIds.add(hsCode.getId()); | ||
| 176 | + } | ||
| 177 | + } | ||
| 178 | + hsCodeList.forEach(hsCode->{ | ||
| 179 | + //判断该hscode是否只能申报D类 | ||
| 180 | + if(hsCodeIds.contains(hsCode.getId())){ | ||
| 181 | + //d类 | ||
| 182 | + hsCode.setRestrictedC(1); | ||
| 183 | + }else{ | ||
| 184 | + //C类 | ||
| 185 | + hsCode.setRestrictedC(0); | ||
| 186 | + } | ||
| 187 | + //如果ID为空,则设置为空 | ||
| 188 | + if(hsCode.getId() == null){ | ||
| 189 | + hsCode.setRestrictedC(null); | ||
| 190 | + } | ||
| 191 | + }); | ||
| 192 | + } | ||
| 193 | + | ||
| 194 | + /** | ||
| 195 | + * 根据监管条件获取数据,只能申报D类hscode信息 | ||
| 196 | + * mt | ||
| 197 | + * 2023年2月24日16:43:46 | ||
| 198 | + * @return | ||
| 199 | + */ | ||
| 200 | + private Map<String,Object> getHscodeSupervise(){ | ||
| 201 | + try { | ||
| 202 | + Map<String,Object> returnMap = new HashMap<>(); | ||
| 203 | + List<String> dictionaryEntriesList = dicEntriesRepository.findDicEntByCodeList(Constant.supervise_condition,1); | ||
| 204 | + if (dictionaryEntriesList !=null && dictionaryEntriesList.size()>0){ | ||
| 205 | + String chinsesName = "%["; | ||
| 206 | + for (int i= 0;i<dictionaryEntriesList.size();i++){ | ||
| 207 | + if (dictionaryEntriesList.size() -1 == i){ | ||
| 208 | + chinsesName += dictionaryEntriesList.get(i)+"]%"; | ||
| 209 | + }else{ | ||
| 210 | + chinsesName += dictionaryEntriesList.get(i)+"|"; | ||
| 211 | + } | ||
| 212 | + } | ||
| 213 | + //查询监管条件数据 | ||
| 214 | + List<HsCode> hsCodeList = this.hsCodeRepository.findMonitorCondition(chinsesName); | ||
| 215 | + hsCodeList.forEach(hsCode->{ | ||
| 216 | + String newCode = getSubHscode(hsCode.getSkuCode()); | ||
| 217 | + returnMap.put(newCode,hsCode); | ||
| 218 | + }); | ||
| 219 | + } | ||
| 220 | + return returnMap; | ||
| 221 | + }catch (Exception e){ | ||
| 222 | + log.error(e.getMessage(),e); | ||
| 223 | + } | ||
| 224 | + return null; | ||
| 225 | + } | ||
| 226 | + | ||
| 227 | + /** | ||
| 228 | + * 对商品编码进行处理 | ||
| 229 | + * @param code | ||
| 230 | + * @return | ||
| 231 | + */ | ||
| 232 | + private String getSubHscode(String code){ | ||
| 233 | + try { | ||
| 234 | + if (!StringUtil.isEmptyWithTrim(code) && code.length()>6) { | ||
| 235 | + if (code.length() == 7) { | ||
| 236 | + code = "0" + code + "00"; | ||
| 237 | + } else if (code.length() == 8) { | ||
| 238 | + code = code + "00"; | ||
| 239 | + } else if (code.length() == 9) { | ||
| 240 | + code = "0" + code; | ||
| 241 | + } else if (code.length() > 10) { | ||
| 242 | + code = code.substring(0, 10); | ||
| 243 | + } | ||
| 244 | + return code; | ||
| 245 | + } | ||
| 246 | + }catch (Exception e){ | ||
| 247 | + log.error(e.getMessage(),e); | ||
| 248 | + } | ||
| 249 | + return null; | ||
| 250 | + } | ||
| 92 | } | 251 | } |
| ... | \ 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 | } | ... | ... |
| ... | @@ -5,12 +5,10 @@ import com.erry.iclear.dateInterface.api.request.MawbDetail; | ... | @@ -5,12 +5,10 @@ import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 5 | import com.erry.iclear.dateInterface.api.response.ResultRS; | 5 | import com.erry.iclear.dateInterface.api.response.ResultRS; |
| 6 | import com.erry.iclear.dateInterface.repository.MawbDetailRepository; | 6 | import com.erry.iclear.dateInterface.repository.MawbDetailRepository; |
| 7 | import lombok.extern.slf4j.Slf4j; | 7 | import lombok.extern.slf4j.Slf4j; |
| 8 | -import org.apache.commons.lang3.StringUtils; | ||
| 9 | import org.springframework.beans.factory.annotation.Autowired; | 8 | import org.springframework.beans.factory.annotation.Autowired; |
| 10 | import org.springframework.stereotype.Service; | 9 | import org.springframework.stereotype.Service; |
| 11 | 10 | ||
| 12 | import java.util.List; | 11 | import java.util.List; |
| 13 | -import java.util.Objects; | ||
| 14 | 12 | ||
| 15 | /** | 13 | /** |
| 16 | * @author Administrator | 14 | * @author Administrator |
| ... | @@ -18,39 +16,21 @@ import java.util.Objects; | ... | @@ -18,39 +16,21 @@ import java.util.Objects; |
| 18 | @Service | 16 | @Service |
| 19 | @Slf4j | 17 | @Slf4j |
| 20 | public class MawbDetailService { | 18 | public class MawbDetailService { |
| 21 | - | ||
| 22 | @Autowired | 19 | @Autowired |
| 23 | private MawbDetailRepository mawbDetailRepository; | 20 | private MawbDetailRepository mawbDetailRepository; |
| 24 | 21 | ||
| 25 | public void saveMawbDetail(List<MawbDetail> mawbDetailList){ | 22 | public void saveMawbDetail(List<MawbDetail> mawbDetailList){ |
| 26 | log.info(""); | 23 | log.info(""); |
| 27 | - | ||
| 28 | log.info(""); | 24 | log.info(""); |
| 29 | - | ||
| 30 | } | 25 | } |
| 31 | 26 | ||
| 32 | - | ||
| 33 | public ResultRS checkMawbDetail(Mawb mawb){ | 27 | public ResultRS checkMawbDetail(Mawb mawb){ |
| 34 | - ResultRS result = new ResultRS(Boolean.FALSE,"30002",null); | 28 | + ResultRS result = new ResultRS(Boolean.FALSE,null,null); |
| 35 | try{ | 29 | try{ |
| 36 | - for (MawbDetail detail : mawb.getMawbDetailList()) { | ||
| 37 | - String secondUnit = detail.getSecondUnit(); | ||
| 38 | - if (StringUtils.isNotEmpty(secondUnit)) { | ||
| 39 | - | ||
| 40 | - Integer secondQty = detail.getSecondQty(); | ||
| 41 | - if (Objects.isNull(secondQty)) { | ||
| 42 | - result.setMsg("参数secondQty不能为空"); | ||
| 43 | - return result; | ||
| 44 | - } | ||
| 45 | - } | ||
| 46 | - } | ||
| 47 | result.setSuccess(Boolean.TRUE); | 30 | result.setSuccess(Boolean.TRUE); |
| 48 | }catch (Exception e){ | 31 | }catch (Exception e){ |
| 49 | log.error("checkMawbDetail() error:"+e.getMessage()); | 32 | log.error("checkMawbDetail() error:"+e.getMessage()); |
| 50 | } | 33 | } |
| 51 | - | ||
| 52 | return result; | 34 | return result; |
| 53 | } | 35 | } |
| 54 | - | ||
| 55 | - | ||
| 56 | } | 36 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | package com.erry.iclear.dateInterface.service; | 1 | package com.erry.iclear.dateInterface.service; |
| 2 | 2 | ||
| 3 | -import com.arronlong.httpclientutil.HttpClientUtil; | 3 | +import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; |
| 4 | -import com.arronlong.httpclientutil.common.HttpConfig; | ||
| 5 | -import com.arronlong.httpclientutil.common.HttpHeader; | ||
| 6 | import com.erry.iclear.dateInterface.api.request.Mawb; | 4 | import com.erry.iclear.dateInterface.api.request.Mawb; |
| 7 | import com.erry.iclear.dateInterface.api.request.MawbDetail; | 5 | import com.erry.iclear.dateInterface.api.request.MawbDetail; |
| 8 | import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; | 6 | import com.erry.iclear.dateInterface.api.response.IClearCheckResponseResult; |
| ... | @@ -15,7 +13,6 @@ import com.erry.iclear.dateInterface.util.JsonToJava; | ... | @@ -15,7 +13,6 @@ import com.erry.iclear.dateInterface.util.JsonToJava; |
| 15 | import com.erry.iclear.dateInterface.util.StringUtil; | 13 | import com.erry.iclear.dateInterface.util.StringUtil; |
| 16 | import com.google.gson.Gson; | 14 | import com.google.gson.Gson; |
| 17 | import lombok.extern.slf4j.Slf4j; | 15 | import lombok.extern.slf4j.Slf4j; |
| 18 | -import org.apache.http.Header; | ||
| 19 | import org.springframework.beans.factory.annotation.Autowired; | 16 | import org.springframework.beans.factory.annotation.Autowired; |
| 20 | import org.springframework.beans.factory.annotation.Value; | 17 | import org.springframework.beans.factory.annotation.Value; |
| 21 | import org.springframework.stereotype.Service; | 18 | import org.springframework.stereotype.Service; |
| ... | @@ -166,11 +163,9 @@ public class MawbService { | ... | @@ -166,11 +163,9 @@ public class MawbService { |
| 166 | } | 163 | } |
| 167 | } | 164 | } |
| 168 | } | 165 | } |
| 169 | - | ||
| 170 | return ""; | 166 | return ""; |
| 171 | } | 167 | } |
| 172 | 168 | ||
| 173 | - | ||
| 174 | /** | 169 | /** |
| 175 | * 校验主单 | 170 | * 校验主单 |
| 176 | * @param mawb | 171 | * @param mawb |
| ... | @@ -180,12 +175,11 @@ public class MawbService { | ... | @@ -180,12 +175,11 @@ public class MawbService { |
| 180 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); | 175 | ResultRS result = new ResultRS(Boolean.FALSE,null,null); |
| 181 | try{ | 176 | try{ |
| 182 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(mawb)); | 177 | log.info("checkMawb start>>>>>>>>>> mawb:"+gson.toJson(mawb)); |
| 183 | - | ||
| 184 | //1、将请求转换为运单 | 178 | //1、将请求转换为运单 |
| 185 | ChmConsignment chmConsignment=consignmentService.convertToChmConsignment(mawb,null,"IDE-ICLEAR-API"); | 179 | ChmConsignment chmConsignment=consignmentService.convertToChmConsignment(mawb,null,"IDE-ICLEAR-API"); |
| 186 | if(Objects.equals(chmConsignment,null)){ | 180 | if(Objects.equals(chmConsignment,null)){ |
| 187 | - result.setCode("30001"); | 181 | + result.setCode(ErrorCodeEnum.ERROR_30001.getCode()); |
| 188 | - result.setMsg("数据格式不正确"); | 182 | + result.setMsg(ErrorCodeEnum.ERROR_30001.getName()); |
| 189 | return result; | 183 | return result; |
| 190 | } | 184 | } |
| 191 | //校验成交方式 成交方式为CIF时 '参数feeCurr不能为空','参数feeMark不能为空'',参数feeRate不能为空','参数insurCurr不能为空', '参数insurRate不能为空' | 185 | //校验成交方式 成交方式为CIF时 '参数feeCurr不能为空','参数feeMark不能为空'',参数feeRate不能为空','参数insurCurr不能为空', '参数insurRate不能为空' |
| ... | @@ -193,13 +187,11 @@ public class MawbService { | ... | @@ -193,13 +187,11 @@ public class MawbService { |
| 193 | if(!result.getSuccess()){ | 187 | if(!result.getSuccess()){ |
| 194 | return result; | 188 | return result; |
| 195 | } | 189 | } |
| 196 | - | ||
| 197 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); | 190 | List<ChmConsignmentDetail> chmConsignmentDetailList = new ArrayList<>(); |
| 198 | mawb.getMawbDetailList().forEach(detail ->{ | 191 | mawb.getMawbDetailList().forEach(detail ->{ |
| 199 | chmConsignmentDetailList.add(consignmentDetailService.convertToChmConsignmentDetail(detail,chmConsignment)); | 192 | chmConsignmentDetailList.add(consignmentDetailService.convertToChmConsignmentDetail(detail,chmConsignment)); |
| 200 | }); | 193 | }); |
| 201 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); | 194 | chmConsignment.setChmConsignmentDetailList(chmConsignmentDetailList); |
| 202 | - | ||
| 203 | //调用IClear接口进行运单数据校验 | 195 | //调用IClear接口进行运单数据校验 |
| 204 | String objJson = JsonToJava.toJson(chmConsignment); | 196 | String objJson = JsonToJava.toJson(chmConsignment); |
| 205 | // Header[] headers = HttpHeader.custom() | 197 | // Header[] headers = HttpHeader.custom() |
| ... | @@ -213,13 +205,9 @@ public class MawbService { | ... | @@ -213,13 +205,9 @@ public class MawbService { |
| 213 | // .encoding("utf-8") | 205 | // .encoding("utf-8") |
| 214 | // .json(objJson); | 206 | // .json(objJson); |
| 215 | // String json = HttpClientUtil.post(config); | 207 | // String json = HttpClientUtil.post(config); |
| 216 | - | ||
| 217 | Map<String,String> headerMap = new HashMap<>(); | 208 | Map<String,String> headerMap = new HashMap<>(); |
| 218 | headerMap.put("Content-Type", "application/json"); | 209 | headerMap.put("Content-Type", "application/json"); |
| 219 | String json = HttpUtils.doPost(this.iclearCheckUrl,objJson,headerMap); | 210 | String json = HttpUtils.doPost(this.iclearCheckUrl,objJson,headerMap); |
| 220 | - | ||
| 221 | - | ||
| 222 | - | ||
| 223 | IClearCheckResponseResult iclearCheckResponseResult = JsonToJava.parseJson(json, IClearCheckResponseResult.class); | 211 | IClearCheckResponseResult iclearCheckResponseResult = JsonToJava.parseJson(json, IClearCheckResponseResult.class); |
| 224 | result.setSuccess(iclearCheckResponseResult.getSuccess()); | 212 | result.setSuccess(iclearCheckResponseResult.getSuccess()); |
| 225 | result.setCode(iclearCheckResponseResult.getCode()); | 213 | result.setCode(iclearCheckResponseResult.getCode()); |
| ... | @@ -243,23 +231,23 @@ public class MawbService { | ... | @@ -243,23 +231,23 @@ public class MawbService { |
| 243 | if(dealMode.equals("CIF、CIP、DDP、DDU、DAP")){ | 231 | if(dealMode.equals("CIF、CIP、DDP、DDU、DAP")){ |
| 244 | if(StringUtil.isEmpty(mawb.getFeeCurr())){ | 232 | if(StringUtil.isEmpty(mawb.getFeeCurr())){ |
| 245 | result.setSuccess(false); | 233 | result.setSuccess(false); |
| 246 | - result.setCode("30002"); | 234 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 247 | result.setMsg("运费币制不能为空"); | 235 | result.setMsg("运费币制不能为空"); |
| 248 | }else if(StringUtil.isEmpty(mawb.getFeeMark())){ | 236 | }else if(StringUtil.isEmpty(mawb.getFeeMark())){ |
| 249 | result.setSuccess(false); | 237 | result.setSuccess(false); |
| 250 | - result.setCode("30002"); | 238 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 251 | result.setMsg("运费标记不能为空"); | 239 | result.setMsg("运费标记不能为空"); |
| 252 | }else if(mawb.getFeeRate() == null){ | 240 | }else if(mawb.getFeeRate() == null){ |
| 253 | result.setSuccess(false); | 241 | result.setSuccess(false); |
| 254 | - result.setCode("30002"); | 242 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 255 | result.setMsg("运费/率不能为空"); | 243 | result.setMsg("运费/率不能为空"); |
| 256 | }else if(StringUtil.isEmpty(mawb.getInsurCurr())){ | 244 | }else if(StringUtil.isEmpty(mawb.getInsurCurr())){ |
| 257 | result.setSuccess(false); | 245 | result.setSuccess(false); |
| 258 | - result.setCode("30002"); | 246 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 259 | result.setMsg("保险费币制不能为空"); | 247 | result.setMsg("保险费币制不能为空"); |
| 260 | }else if(mawb.getInsurRate() == null){ | 248 | }else if(mawb.getInsurRate() == null){ |
| 261 | result.setSuccess(false); | 249 | result.setSuccess(false); |
| 262 | - result.setCode("30002"); | 250 | + result.setCode(ErrorCodeEnum.ERROR_30002.getCode()); |
| 263 | result.setMsg("保险费/率不能为空"); | 251 | result.setMsg("保险费/率不能为空"); |
| 264 | } | 252 | } |
| 265 | } | 253 | } | ... | ... |
| ... | @@ -34,8 +34,6 @@ public class OrigplacecodeMappingService { | ... | @@ -34,8 +34,6 @@ public class OrigplacecodeMappingService { |
| 34 | return result; | 34 | return result; |
| 35 | } | 35 | } |
| 36 | 36 | ||
| 37 | - | ||
| 38 | - | ||
| 39 | /** | 37 | /** |
| 40 | * 初始化DomesticDestinationMapping | 38 | * 初始化DomesticDestinationMapping |
| 41 | */ | 39 | */ |
| ... | @@ -50,13 +48,4 @@ public class OrigplacecodeMappingService { | ... | @@ -50,13 +48,4 @@ public class OrigplacecodeMappingService { |
| 50 | log.error("initDomesticDestinationMapping() error" + e.getMessage()); | 48 | log.error("initDomesticDestinationMapping() error" + e.getMessage()); |
| 51 | } | 49 | } |
| 52 | } | 50 | } |
| 53 | - | ||
| 54 | - | ||
| 55 | - | ||
| 56 | - | ||
| 57 | - | ||
| 58 | - | ||
| 59 | - | ||
| 60 | - | ||
| 61 | - | ||
| 62 | } | 51 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | package com.erry.iclear.dateInterface.task; | 1 | package com.erry.iclear.dateInterface.task; |
| 2 | 2 | ||
| 3 | -import com.alibaba.fastjson.JSONObject; | 3 | +import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; |
| 4 | import com.erry.iclear.dateInterface.api.response.TokenResult; | 4 | import com.erry.iclear.dateInterface.api.response.TokenResult; |
| 5 | -import com.erry.iclear.dateInterface.common.Constants; | ||
| 6 | -import com.erry.iclear.dateInterface.entity.HsCode; | ||
| 7 | -import com.erry.iclear.dateInterface.repository.HsCodeRepository; | ||
| 8 | import com.erry.iclear.dateInterface.service.ApiService; | 5 | import com.erry.iclear.dateInterface.service.ApiService; |
| 9 | import lombok.extern.slf4j.Slf4j; | 6 | import lombok.extern.slf4j.Slf4j; |
| 10 | import org.springframework.beans.factory.annotation.Autowired; | 7 | import org.springframework.beans.factory.annotation.Autowired; |
| ... | @@ -62,7 +59,7 @@ public class IClearApiTask { | ... | @@ -62,7 +59,7 @@ public class IClearApiTask { |
| 62 | try { | 59 | try { |
| 63 | //获取token | 60 | //获取token |
| 64 | TokenResult tokenResult = apiService.getToken(); | 61 | TokenResult tokenResult = apiService.getToken(); |
| 65 | - if(tokenResult.getErrorcode().equals(Constants.ApiResponseKeys.SUCCESS)){ | 62 | + if(tokenResult.getErrorcode().equals(ErrorCodeEnum.SUCCESS.getCode())){ |
| 66 | this.token = tokenResult.getData().getToken(); | 63 | this.token = tokenResult.getData().getToken(); |
| 67 | } | 64 | } |
| 68 | }catch(Exception ex){ | 65 | }catch(Exception ex){ | ... | ... |
| ... | @@ -8,13 +8,13 @@ spring.datasource.type=com.alibaba.druid.pool.DruidDataSource | ... | @@ -8,13 +8,13 @@ spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
| 8 | #spring.datasource.jndi-name=jdbc/iclearProdTestDS | 8 | #spring.datasource.jndi-name=jdbc/iclearProdTestDS |
| 9 | 9 | ||
| 10 | #推送海关回执 | 10 | #推送海关回执 |
| 11 | -task.pushCustomsTask=0 0/1 * 1 * ? | 11 | +task.pushCustomsTask=0 0/1 * * * ? |
| 12 | #推送完整报文 | 12 | #推送完整报文 |
| 13 | -task.pushMawbTask=0 0/1 * 1 * ? | 13 | +task.pushMawbTask=0 0/1 * * * ? |
| 14 | #推送失败的回执数据 | 14 | #推送失败的回执数据 |
| 15 | -task.pushErrorReturnDate=0 0/3 * 1 * ? | 15 | +task.pushErrorReturnDate=0 0/3 * * * ? |
| 16 | #推送失败的申报数据 | 16 | #推送失败的申报数据 |
| 17 | -task.pushErrorDeclareDate=0 0/3 * 1 * ? | 17 | +task.pushErrorDeclareDate=0 0/3 * * * ? |
| 18 | 18 | ||
| 19 | api.base-address=https://declarationuat.fedex.com.cn/Exp | 19 | api.base-address=https://declarationuat.fedex.com.cn/Exp |
| 20 | #获取token账号 | 20 | #获取token账号 | ... | ... |
| ... | @@ -3,7 +3,7 @@ spring.datasource.jndi-name=jdbc/iclearDS | ... | @@ -3,7 +3,7 @@ spring.datasource.jndi-name=jdbc/iclearDS |
| 3 | #推送海关回执 | 3 | #推送海关回执 |
| 4 | task.pushCustomsTask=0 0/1 * * * ? | 4 | task.pushCustomsTask=0 0/1 * * * ? |
| 5 | #推送完整报文 | 5 | #推送完整报文 |
| 6 | -task.pushMawbTask=0 0/1 * 1 * ? | 6 | +task.pushMawbTask=0 0/1 * * * ? |
| 7 | #推送失败的回执数据 | 7 | #推送失败的回执数据 |
| 8 | task.pushErrorReturnDate=0 0/30 * * * ? | 8 | task.pushErrorReturnDate=0 0/30 * * * ? |
| 9 | #推送失败的申报数据 | 9 | #推送失败的申报数据 | ... | ... |
| ... | @@ -3,7 +3,7 @@ spring.datasource.jndi-name=jdbc/iclearDS | ... | @@ -3,7 +3,7 @@ spring.datasource.jndi-name=jdbc/iclearDS |
| 3 | #推送海关回执 | 3 | #推送海关回执 |
| 4 | task.pushCustomsTask=0 0/1 * * * ? | 4 | task.pushCustomsTask=0 0/1 * * * ? |
| 5 | #推送完整报文 | 5 | #推送完整报文 |
| 6 | -task.pushMawbTask=0 0/1 * 1 * ? | 6 | +task.pushMawbTask=0 0/1 * * * ? |
| 7 | #推送失败的回执数据 | 7 | #推送失败的回执数据 |
| 8 | task.pushErrorReturnDate=0 0/3 * * * ? | 8 | task.pushErrorReturnDate=0 0/3 * * * ? |
| 9 | #推送失败的申报数据 | 9 | #推送失败的申报数据 | ... | ... |
| 1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
| 2 | <configuration> | 2 | <configuration> |
| 3 | <contextName>iClear-api</contextName> | 3 | <contextName>iClear-api</contextName> |
| 4 | - | 4 | + <!--定义日志文件的存储地址 勿在 LogBack 的配置中使用相对路径--> |
| 5 | + <property name="LOG_HOME" value="/var/fedex/dxpweb/weblogic/api/log/"/> | ||
| 5 | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> | 6 | <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> |
| 6 | <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> | 7 | <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder"> |
| 7 | <layout class="ch.qos.logback.classic.PatternLayout"> | 8 | <layout class="ch.qos.logback.classic.PatternLayout"> |
| ... | @@ -15,9 +16,9 @@ | ... | @@ -15,9 +16,9 @@ |
| 15 | <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> | 16 | <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender"> |
| 16 | <prudent>false</prudent> | 17 | <prudent>false</prudent> |
| 17 | <append>true</append> | 18 | <append>true</append> |
| 18 | - <file>E:/api/logs/iClear-api.log</file> | 19 | + <file>${LOG_HOME}/iClear-api.log</file> |
| 19 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | 20 | <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> |
| 20 | - <fileNamePattern>E:/api/logs/iClear-api-%d{yyyy-MM-dd}.%i.log</fileNamePattern> | 21 | + <fileNamePattern>${LOG_HOME}/iClear-api-%d{yyyy-MM-dd}.%i.log</fileNamePattern> |
| 21 | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> | 22 | <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP"> |
| 22 | <maxFileSize>500MB</maxFileSize> | 23 | <maxFileSize>500MB</maxFileSize> |
| 23 | </timeBasedFileNamingAndTriggeringPolicy> | 24 | </timeBasedFileNamingAndTriggeringPolicy> |
| ... | @@ -28,7 +29,6 @@ | ... | @@ -28,7 +29,6 @@ |
| 28 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread{0}] %c{0} - %msg%n</pattern> | 29 | <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread{0}] %c{0} - %msg%n</pattern> |
| 29 | <charset>utf-8</charset> | 30 | <charset>utf-8</charset> |
| 30 | </encoder> | 31 | </encoder> |
| 31 | - | ||
| 32 | </appender> | 32 | </appender> |
| 33 | 33 | ||
| 34 | <logger name="io.lettuce.core" level="ERROR" /> | 34 | <logger name="io.lettuce.core" level="ERROR" /> |
| ... | @@ -51,6 +51,4 @@ | ... | @@ -51,6 +51,4 @@ |
| 51 | <appender-ref ref="FILE"/> | 51 | <appender-ref ref="FILE"/> |
| 52 | </root> | 52 | </root> |
| 53 | </springProfile> | 53 | </springProfile> |
| 54 | - | ||
| 55 | - | ||
| 56 | </configuration> | 54 | </configuration> | ... | ... |
| ... | @@ -24,7 +24,7 @@ public class ApiTest { | ... | @@ -24,7 +24,7 @@ public class ApiTest { |
| 24 | //获取HSCODE接口地址 | 24 | //获取HSCODE接口地址 |
| 25 | public static String hscodeRequest = "hscode/hscodeRequest"; | 25 | public static String hscodeRequest = "hscode/hscodeRequest"; |
| 26 | 26 | ||
| 27 | - public static String timeStamp = "1645153943"; | 27 | + public static String timeStamp = "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("BASF" + "iClearExportC" + "b92131f03f19a348" + 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类申报的数据落地接口 | ... | ... |
| ... | @@ -40,22 +40,22 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { | ... | @@ -40,22 +40,22 @@ public class ChmConsignmentServiceTest extends IClearApiApplicationTests { |
| 40 | 40 | ||
| 41 | @Test | 41 | @Test |
| 42 | public void testProcessChmConsignment1(){ | 42 | public void testProcessChmConsignment1(){ |
| 43 | - try{ | 43 | +// try{ |
| 44 | - ResultRS result = new ResultRS(Boolean.FALSE,"",""); | 44 | +// ResultRS result = new ResultRS(Boolean.FALSE,"",""); |
| 45 | - Fedexc fedexc = this.createNewFedex(); | 45 | +// Fedexc fedexc = this.createNewFedex(); |
| 46 | - FedexMawb mawb = fedexService.saveMawbFedex(fedexc); | 46 | +// FedexMawb mawb = fedexService.saveMawbFedex(fedexc); |
| 47 | - //Basfc fedexc = this.createNewBasf(); | 47 | +// //Basfc fedexc = this.createNewBasf(); |
| 48 | - String timeStamp = String.valueOf(new Date().getTime()); | 48 | +// String timeStamp = String.valueOf(new Date().getTime()); |
| 49 | - ResultRS resultRS = chmConsignmentService.processChmConsignmentFedex(mawb, timeStamp, "BASF"); | 49 | +// ResultRS resultRS = chmConsignmentService.processChmConsignmentFedex(mawb, timeStamp, "BASF"); |
| 50 | - /*result=fedexService.checkBasfMawb(mawb); | 50 | +// /*result=fedexService.checkBasfMawb(mawb); |
| 51 | - if(!result.getSuccess()){ | 51 | +// if(!result.getSuccess()){ |
| 52 | - System.out.println(result.getMsg()); | 52 | +// System.out.println(result.getMsg()); |
| 53 | - }*/ | 53 | +// }*/ |
| 54 | - System.out.println(resultRS.toString()); | 54 | +// System.out.println(resultRS.toString()); |
| 55 | - }catch (Exception e){ | 55 | +// }catch (Exception e){ |
| 56 | - e.printStackTrace(); | 56 | +// e.printStackTrace(); |
| 57 | - } | 57 | +// } |
| 58 | - System.out.println("1"); | 58 | +// System.out.println("1"); |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | private Fedexc createNewFedex(){ | 61 | private Fedexc createNewFedex(){ | ... | ... |
-
Please register or login to post a comment