Merge branches 'CY23-PI02-iKnowU' and 'master' of http://118.178.128.178//Fedex/iClear-api
Showing
19 changed files
with
294 additions
and
70 deletions
No preview for this file type
doc/FedEx在线申报系统API - iKnowU.docx
0 → 100644
No preview for this file type
| ... | @@ -35,9 +35,19 @@ md5 小写 16位 | ... | @@ -35,9 +35,19 @@ md5 小写 16位 |
| 35 | IMPORTiClearExportCTest | 35 | IMPORTiClearExportCTest |
| 36 | IMPORTiClearExportCProd | 36 | IMPORTiClearExportCProd |
| 37 | 37 | ||
| 38 | +FSML的Secret | ||
| 39 | +md5 小写 16位 | ||
| 40 | +明文: | ||
| 41 | + FSMLiClearExportCDev | ||
| 42 | + FSMLiClearExportCTest | ||
| 43 | + FSMLiClearExportCProd | ||
| 38 | 44 | ||
| 39 | - | 45 | +IKNOWU的Secret |
| 40 | - | 46 | +md5 小写 16位 |
| 47 | +明文: | ||
| 48 | + IKNOWUiClearExportCDev | ||
| 49 | + IKNOWUiClearExportCTest | ||
| 50 | + IKNOWUiClearExportCProd | ||
| 41 | 51 | ||
| 42 | 52 | ||
| 43 | 1、接口数据模型调研 2 | 53 | 1、接口数据模型调研 2 | ... | ... |
sql/202306/2023-06-14.sql
0 → 100644
| ... | @@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletRequest; | ... | @@ -15,7 +15,7 @@ import javax.servlet.http.HttpServletRequest; |
| 15 | import java.util.Date; | 15 | import java.util.Date; |
| 16 | 16 | ||
| 17 | /** | 17 | /** |
| 18 | - * @author Administrator | 18 | + * @author mt |
| 19 | * /hscode/hscodeRequest | 19 | * /hscode/hscodeRequest |
| 20 | */ | 20 | */ |
| 21 | @RestController | 21 | @RestController | ... | ... |
| 1 | +package com.erry.iclear.dateInterface.api; | ||
| 2 | + | ||
| 3 | +import com.erry.iclear.dateInterface.api.request.HsCodeParam; | ||
| 4 | +import com.erry.iclear.dateInterface.api.request.StampParam; | ||
| 5 | +import com.erry.iclear.dateInterface.api.response.ResultHsCode; | ||
| 6 | +import com.erry.iclear.dateInterface.api.response.StampResult; | ||
| 7 | +import com.erry.iclear.dateInterface.entity.IClearApiHsCodeLog; | ||
| 8 | +import com.erry.iclear.dateInterface.enums.ErrorCodeEnum; | ||
| 9 | +import com.erry.iclear.dateInterface.service.HsCodeService; | ||
| 10 | +import com.erry.iclear.dateInterface.service.IClearApiHsCodeLogService; | ||
| 11 | +import com.erry.iclear.dateInterface.util.FileUtils; | ||
| 12 | +import com.erry.iclear.dateInterface.util.StringUtil; | ||
| 13 | +import io.swagger.annotations.ApiOperation; | ||
| 14 | +import lombok.extern.slf4j.Slf4j; | ||
| 15 | +import org.apache.log4j.spi.ErrorCode; | ||
| 16 | +import org.springframework.beans.factory.annotation.Autowired; | ||
| 17 | +import org.springframework.beans.factory.annotation.Value; | ||
| 18 | +import org.springframework.web.bind.annotation.*; | ||
| 19 | + | ||
| 20 | +import javax.servlet.http.HttpServletRequest; | ||
| 21 | +import java.io.File; | ||
| 22 | +import java.util.Date; | ||
| 23 | + | ||
| 24 | +/** | ||
| 25 | + * @author mt | ||
| 26 | + * /iknowU/stampQuery | ||
| 27 | + */ | ||
| 28 | +@RestController | ||
| 29 | +@RequestMapping("/iknowU") | ||
| 30 | +@Slf4j | ||
| 31 | +public class IKnowUInterface { | ||
| 32 | + @Value("${stamp_path}") | ||
| 33 | + String stampPath; | ||
| 34 | + @Value("${stamp_file_name}") | ||
| 35 | + String stampFileName; | ||
| 36 | + | ||
| 37 | + @Autowired | ||
| 38 | + IClearApiHsCodeLogService iClearApiHsCodeLogService; | ||
| 39 | + | ||
| 40 | + @ApiOperation(value = "抠图后的公章查询", httpMethod = "POST", notes = "ex: http://192.168.1.71:8080/iknowU/stampQuery") | ||
| 41 | + @PostMapping("/stampQuery") | ||
| 42 | + @ResponseBody | ||
| 43 | + public StampResult stampQuery(HttpServletRequest request | ||
| 44 | + , @RequestBody StampParam stampParam) { | ||
| 45 | + log.info("接收到请求数据consignmentCode:【"+stampParam.getConsignmentCode()+"】"); | ||
| 46 | + String appId = (String) request.getHeader("Appid"); | ||
| 47 | + String appkey = (String) request.getHeader("Appkey"); | ||
| 48 | + IClearApiHsCodeLog iclearApiHsCodeLog = new IClearApiHsCodeLog(); | ||
| 49 | + StampResult stampResult = null; | ||
| 50 | + long begin = System.currentTimeMillis(); | ||
| 51 | + | ||
| 52 | + String filePath = this.stampPath + stampParam.getConsignmentCode() + File.separator + stampFileName; | ||
| 53 | + try { | ||
| 54 | + iclearApiHsCodeLog.setAppId(appId); | ||
| 55 | + iclearApiHsCodeLog.setAppKey(appkey); | ||
| 56 | + iclearApiHsCodeLog.setCreateTime(new Date()); | ||
| 57 | + iclearApiHsCodeLog.setCode(stampParam.getConsignmentCode()); | ||
| 58 | + File file = new File(filePath); | ||
| 59 | + //判断文件是否存在 | ||
| 60 | + if(file.exists()){ | ||
| 61 | + String base64Image = FileUtils.convertFileToBase64(filePath); | ||
| 62 | + stampResult = new StampResult(Boolean.TRUE,ErrorCodeEnum.SUCCESS.getCode(),ErrorCodeEnum.SUCCESS.getName(),base64Image); | ||
| 63 | + }else{ | ||
| 64 | + stampResult = new StampResult(Boolean.FALSE,ErrorCodeEnum.ERROR_10119.getCode(),ErrorCodeEnum.ERROR_10119.getName(),null); | ||
| 65 | + } | ||
| 66 | + }catch(Exception ex){ | ||
| 67 | + log.error(ex.getMessage(),ex); | ||
| 68 | + stampResult = new StampResult(Boolean.FALSE,ErrorCodeEnum.ERROR_10119.getCode(),ErrorCodeEnum.ERROR_10119.getName(),null); | ||
| 69 | + return stampResult; | ||
| 70 | + }finally { | ||
| 71 | + iclearApiHsCodeLog.setReceiveResult(stampResult.getMsg()); | ||
| 72 | + iclearApiHsCodeLog.setCode(filePath); | ||
| 73 | + iclearApiHsCodeLog.setErrorCode(stampResult.getCode()); | ||
| 74 | + iclearApiHsCodeLog.setResponseTime(new Date()); | ||
| 75 | + long end = System.currentTimeMillis(); | ||
| 76 | + iclearApiHsCodeLog.setSpendTime(end-begin); | ||
| 77 | + iClearApiHsCodeLogService.saveIClearApiHsCodeLog(iclearApiHsCodeLog); | ||
| 78 | + } | ||
| 79 | + return stampResult; | ||
| 80 | + } | ||
| 81 | +} |
| ... | @@ -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.9"; | 26 | + final String VERSION = "2.2"; |
| 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") | ... | ... |
| 1 | +package com.erry.iclear.dateInterface.api.request; | ||
| 2 | + | ||
| 3 | +import io.swagger.annotations.ApiModel; | ||
| 4 | +import lombok.Data; | ||
| 5 | + | ||
| 6 | +import java.io.Serializable; | ||
| 7 | + | ||
| 8 | +/** | ||
| 9 | + * 请求公章图样参数 | ||
| 10 | + * mt | ||
| 11 | + * 2023年6月9日15:57:52 | ||
| 12 | + */ | ||
| 13 | +@ApiModel(value = "stampParam", description = "需要查询的公章图样运单号") | ||
| 14 | +@Data | ||
| 15 | +public class StampParam implements Serializable { | ||
| 16 | + private static final long serialVersionUID = 786697399667065141L; | ||
| 17 | + //运单号 | ||
| 18 | + String consignmentCode; | ||
| 19 | +} |
| 1 | +package com.erry.iclear.dateInterface.api.response; | ||
| 2 | + | ||
| 3 | + | ||
| 4 | +import com.erry.iclear.dateInterface.entity.HsCode; | ||
| 5 | +import lombok.AllArgsConstructor; | ||
| 6 | +import lombok.Data; | ||
| 7 | + | ||
| 8 | +import java.io.Serializable; | ||
| 9 | +import java.util.List; | ||
| 10 | + | ||
| 11 | +@Data | ||
| 12 | +@AllArgsConstructor | ||
| 13 | +public class StampResult implements Serializable { | ||
| 14 | + //成功标识 | ||
| 15 | + private Boolean success = true; | ||
| 16 | + //结果编码 | ||
| 17 | + private String code; | ||
| 18 | + //错误信息 | ||
| 19 | + private String msg; | ||
| 20 | + //公章图样base64位字符 | ||
| 21 | + private String base64Image; | ||
| 22 | +} |
| ... | @@ -129,10 +129,20 @@ public class HsCode extends BaseModel { | ... | @@ -129,10 +129,20 @@ public class HsCode extends BaseModel { |
| 129 | private String unitLegalFirst; | 129 | private String unitLegalFirst; |
| 130 | 130 | ||
| 131 | /** | 131 | /** |
| 132 | + * 第一(法定)计量单位编码 | ||
| 133 | + */ | ||
| 134 | + @Column(name = "UNIT_LEGAL_FIRST_CODE") | ||
| 135 | + private String unitLegalFirstCode; | ||
| 136 | + /** | ||
| 132 | * 第二计量单位 | 137 | * 第二计量单位 |
| 133 | */ | 138 | */ |
| 134 | @Column(name = "UNIT_LEGAL_SECOND") | 139 | @Column(name = "UNIT_LEGAL_SECOND") |
| 135 | private String unitLegalSecond; | 140 | private String unitLegalSecond; |
| 141 | + /** | ||
| 142 | + * 第二计量单位编码 | ||
| 143 | + */ | ||
| 144 | + @Column(name = "UNIT_LEGAL_SECOND_CODE") | ||
| 145 | + private String unitLegalSecondCode; | ||
| 136 | 146 | ||
| 137 | /** | 147 | /** |
| 138 | * CCC标记 | 148 | * CCC标记 |
| ... | @@ -567,4 +577,5 @@ public class HsCode extends BaseModel { | ... | @@ -567,4 +577,5 @@ public class HsCode extends BaseModel { |
| 567 | ", outRate=" + outRate + | 577 | ", outRate=" + outRate + |
| 568 | '}'; | 578 | '}'; |
| 569 | } | 579 | } |
| 580 | + | ||
| 570 | } | 581 | } | ... | ... |
| ... | @@ -18,6 +18,7 @@ public enum ErrorCodeEnum { | ... | @@ -18,6 +18,7 @@ public enum ErrorCodeEnum { |
| 18 | ERROR_10017("10017","无Appkey(缺少参数)"), | 18 | ERROR_10017("10017","无Appkey(缺少参数)"), |
| 19 | ERROR_10018("10018","无TimeStamp(缺少参数)"), | 19 | ERROR_10018("10018","无TimeStamp(缺少参数)"), |
| 20 | ERROR_10019("10019","未指定hscode编码,10分钟之内只允许查询一次。"), | 20 | ERROR_10019("10019","未指定hscode编码,10分钟之内只允许查询一次。"), |
| 21 | + ERROR_10119("10119","根据运单号查询用户上传的公章图样失败"), | ||
| 21 | ERROR_30001("30001","数据格式不正确"), | 22 | ERROR_30001("30001","数据格式不正确"), |
| 22 | ERROR_30002("30002","缺少必填项"), | 23 | ERROR_30002("30002","缺少必填项"), |
| 23 | ERROR_30003("30003","数据校验不通过"), | 24 | ERROR_30003("30003","数据校验不通过"), |
| ... | @@ -28,6 +29,7 @@ public enum ErrorCodeEnum { | ... | @@ -28,6 +29,7 @@ public enum ErrorCodeEnum { |
| 28 | ERROR_30104("30104","skuCode或skuName长度超出限制"), | 29 | ERROR_30104("30104","skuCode或skuName长度超出限制"), |
| 29 | ERROR_30105("30105","skuCode编码最少输入4位字符,skuName最少输入2个字符"); | 30 | ERROR_30105("30105","skuCode编码最少输入4位字符,skuName最少输入2个字符"); |
| 30 | 31 | ||
| 32 | + | ||
| 31 | ErrorCodeEnum(String code,String name){ | 33 | ErrorCodeEnum(String code,String name){ |
| 32 | this.code = code; | 34 | this.code = code; |
| 33 | this.name = name; | 35 | this.name = name; | ... | ... |
| ... | @@ -15,29 +15,26 @@ import java.util.List; | ... | @@ -15,29 +15,26 @@ import java.util.List; |
| 15 | @Repository | 15 | @Repository |
| 16 | public interface SysUserRepository extends JpaSpecificationExecutor<SysUser>, JpaRepository<SysUser, Long> { | 16 | public interface SysUserRepository extends JpaSpecificationExecutor<SysUser>, JpaRepository<SysUser, Long> { |
| 17 | 17 | ||
| 18 | - | ||
| 19 | - | ||
| 20 | - | ||
| 21 | - @Query(nativeQuery = true, value = "select TOP 1 * from t_au_user where login_name = ?1 ") | ||
| 22 | - public SysUser findByLoginName(String loginName); | ||
| 23 | - | ||
| 24 | /** | 18 | /** |
| 25 | - * 根据用户登录名list查询用户列表信息 | 19 | + * 根据登录名本地账号用户信息 |
| 26 | * | 20 | * |
| 27 | - * @param loginNames | 21 | + * @param loginName |
| 28 | * @return | 22 | * @return |
| 29 | */ | 23 | */ |
| 30 | - @Query(nativeQuery = true, value = "select * from t_au_user where login_name IN (?1) ") | 24 | + @Query(nativeQuery = true, value = "select top 1 * from t_au_user a where a.login_name = ?1 " + |
| 31 | - public List<SysUser> findUserListByLoginNames(List loginNames); | 25 | + " and a.user_source_id in( " + |
| 26 | + " select id from dbo.T_BI_DICTIONARY_ENTRIES " + | ||
| 27 | + " where dict_code='userSourceCode' and code='LOCALUSER') ") | ||
| 28 | + public SysUser findUserByLoginName(String loginName); | ||
| 32 | 29 | ||
| 33 | /** | 30 | /** |
| 34 | - * 根据登录名查询单个用户信息 | 31 | + * 根据用户登录名list查询用户列表信息 |
| 35 | * | 32 | * |
| 36 | - * @param loginName | 33 | + * @param loginNames |
| 37 | * @return | 34 | * @return |
| 38 | */ | 35 | */ |
| 39 | - @Query(nativeQuery = true, value = "select * from t_au_user where login_name = ?1") | 36 | + @Query(nativeQuery = true, value = "select * from t_au_user where login_name IN (?1) ") |
| 40 | - public SysUser findUserByLoginName(String loginName); | 37 | + public List<SysUser> findUserListByLoginNames(List loginNames); |
| 41 | 38 | ||
| 42 | @Query(nativeQuery = true, value = "select * from t_au_user where username = ?1") | 39 | @Query(nativeQuery = true, value = "select * from t_au_user where username = ?1") |
| 43 | public List<SysUser> findByUserName(String userName); | 40 | public List<SysUser> findByUserName(String userName); |
| ... | @@ -74,5 +71,4 @@ public interface SysUserRepository extends JpaSpecificationExecutor<SysUser>, Jp | ... | @@ -74,5 +71,4 @@ public interface SysUserRepository extends JpaSpecificationExecutor<SysUser>, Jp |
| 74 | */ | 71 | */ |
| 75 | @Query(nativeQuery = true,value = "select ID from T_AU_USER where IS_VALID = 1 AND ORG_NAME = 'RDE' AND CONS_DISTRIBUTION = '2'") | 72 | @Query(nativeQuery = true,value = "select ID from T_AU_USER where IS_VALID = 1 AND ORG_NAME = 'RDE' AND CONS_DISTRIBUTION = '2'") |
| 76 | public List<BigDecimal> findByDistribution(); | 73 | public List<BigDecimal> findByDistribution(); |
| 77 | - | 74 | +} |
| 78 | -} | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -292,6 +292,7 @@ public class ChmConsignmentService { | ... | @@ -292,6 +292,7 @@ public class ChmConsignmentService { |
| 292 | result.setUpdateTime(pushTime); | 292 | result.setUpdateTime(pushTime); |
| 293 | if (!creator.equals("IDE-ICLEAR-API")){ | 293 | if (!creator.equals("IDE-ICLEAR-API")){ |
| 294 | SysUser sysUser = sysUserRepository.findUserByLoginName(creator); | 294 | SysUser sysUser = sysUserRepository.findUserByLoginName(creator); |
| 295 | + | ||
| 295 | result.setCreatorId(sysUser); | 296 | result.setCreatorId(sysUser); |
| 296 | result.setCreator(sysUser.getLoginName()); | 297 | result.setCreator(sysUser.getLoginName()); |
| 297 | } | 298 | } |
| ... | @@ -507,7 +508,7 @@ public class ChmConsignmentService { | ... | @@ -507,7 +508,7 @@ public class ChmConsignmentService { |
| 507 | ChmConsignment chmConsignmentDB=this.findChmConsignmentByConsignmentCode(chmConsignment.getConsignmentCode(), DateUtils.addDate(DateUtils.getCurrentDate(),-7)); | 508 | ChmConsignment chmConsignmentDB=this.findChmConsignmentByConsignmentCode(chmConsignment.getConsignmentCode(), DateUtils.addDate(DateUtils.getCurrentDate(),-7)); |
| 508 | 509 | ||
| 509 | //获取用户账号信息 | 510 | //获取用户账号信息 |
| 510 | - SysUser sysUser = sysUserRepository.findByLoginName("CUSTOMS"); | 511 | + SysUser sysUser = sysUserRepository.findUserByLoginName("CUSTOMS"); |
| 511 | //设置当前运单创建人ID | 512 | //设置当前运单创建人ID |
| 512 | chmConsignment.setCreatorId(sysUser); | 513 | chmConsignment.setCreatorId(sysUser); |
| 513 | //设置创建人名称 | 514 | //设置创建人名称 | ... | ... |
| ... | @@ -118,7 +118,7 @@ public class HsCodeService { | ... | @@ -118,7 +118,7 @@ public class HsCodeService { |
| 118 | resultHsCode.setMsg(ErrorCodeEnum.ERROR_30105.getName()); | 118 | resultHsCode.setMsg(ErrorCodeEnum.ERROR_30105.getName()); |
| 119 | return resultHsCode; | 119 | return resultHsCode; |
| 120 | } | 120 | } |
| 121 | - String skuCode = "%"+hscode.getSkuCode()+"%"; | 121 | + String skuCode = hscode.getSkuCode()+"%"; |
| 122 | String skuName = "%"+hscode.getSkuName()+"%"; | 122 | String skuName = "%"+hscode.getSkuName()+"%"; |
| 123 | //模糊查询hscode信息 | 123 | //模糊查询hscode信息 |
| 124 | List<HsCode> hsCodeList = this.hsCodeRepository.fuzzyQueryHsCode(skuCode,skuName); | 124 | List<HsCode> hsCodeList = this.hsCodeRepository.fuzzyQueryHsCode(skuCode,skuName); | ... | ... |
This diff is collapsed. Click to expand it.
| ... | @@ -7,39 +7,41 @@ spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver | ... | @@ -7,39 +7,41 @@ spring.datasource.driver-class-name=com.microsoft.sqlserver.jdbc.SQLServerDriver |
| 7 | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource | 7 | 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 | +#\u63A8\u9001\u6D77\u5173\u56DE\u6267 |
| 11 | task.pushCustomsTask=0 0/1 * * * ? | 11 | task.pushCustomsTask=0 0/1 * * * ? |
| 12 | -#推送完整报文 | 12 | +#\u63A8\u9001\u5B8C\u6574\u62A5\u6587 |
| 13 | task.pushMawbTask=0 0/1 * * * ? | 13 | task.pushMawbTask=0 0/1 * * * ? |
| 14 | -#推送失败的回执数据 | 14 | +#\u63A8\u9001\u5931\u8D25\u7684\u56DE\u6267\u6570\u636E |
| 15 | task.pushErrorReturnDate=0 0/3 * * * ? | 15 | task.pushErrorReturnDate=0 0/3 * * * ? |
| 16 | -#推送失败的申报数据 | 16 | +#\u63A8\u9001\u5931\u8D25\u7684\u7533\u62A5\u6570\u636E |
| 17 | task.pushErrorDeclareDate=0 0/3 * * * ? | 17 | task.pushErrorDeclareDate=0 0/3 * * * ? |
| 18 | -#监听iclear节点是否正常定时任务间隔 | 18 | +#\u76D1\u542Ciclear\u8282\u70B9\u662F\u5426\u6B63\u5E38\u5B9A\u65F6\u4EFB\u52A1\u95F4\u9694 |
| 19 | task.monitorIclearNodes=0 0/5 * * * ? | 19 | task.monitorIclearNodes=0 0/5 * * * ? |
| 20 | 20 | ||
| 21 | api.base-address=http://localhost:8080/Exp | 21 | api.base-address=http://localhost:8080/Exp |
| 22 | -#获取token账号 | 22 | +#\u83B7\u53D6token\u8D26\u53F7 |
| 23 | api.token-info.username=iclear_external_ctm | 23 | api.token-info.username=iclear_external_ctm |
| 24 | -#获取token密码 | 24 | +#\u83B7\u53D6token\u5BC6\u7801 |
| 25 | api.token-info.password=toQu3arch6 | 25 | api.token-info.password=toQu3arch6 |
| 26 | -#IClearC类提交运单地址 | 26 | +#IClearC\u7C7B\u63D0\u4EA4\u8FD0\u5355\u5730\u5740 |
| 27 | api.address.iclear-submit-url=${api.base-address}/chmConsignmentController/submitConsignments | 27 | api.address.iclear-submit-url=${api.base-address}/chmConsignmentController/submitConsignments |
| 28 | -#IClear校验运单地址 | 28 | +#IClear\u6821\u9A8C\u8FD0\u5355\u5730\u5740 |
| 29 | api.address.iclear-check-url=${api.base-address}/chmConsignmentController/checkChmAndDetaliD | 29 | api.address.iclear-check-url=${api.base-address}/chmConsignmentController/checkChmAndDetaliD |
| 30 | -#IClear校验C类运单地址 | 30 | +#IClear\u6821\u9A8CC\u7C7B\u8FD0\u5355\u5730\u5740 |
| 31 | api.address.iclear-check-url-c=${api.base-address}/chmConsignmentController/checkChmAndDetaliC | 31 | api.address.iclear-check-url-c=${api.base-address}/chmConsignmentController/checkChmAndDetaliC |
| 32 | -#获取token地址 | 32 | +#\u83B7\u53D6token\u5730\u5740 |
| 33 | api.address.token-url=https://apiuat.iclrccd-fedex.com/login | 33 | api.address.token-url=https://apiuat.iclrccd-fedex.com/login |
| 34 | -#刷新token地址 | 34 | +#\u5237\u65B0token\u5730\u5740 |
| 35 | api.address.refresh-token-url=https://apiuat.iclrccd-fedex.com/user/token/refresh | 35 | api.address.refresh-token-url=https://apiuat.iclrccd-fedex.com/user/token/refresh |
| 36 | -#传输海关回执地址 | 36 | +#\u4F20\u8F93\u6D77\u5173\u56DE\u6267\u5730\u5740 |
| 37 | api.address.customs-url=https://apiuat.iclrccd-fedex.com/export/outbound/customs | 37 | api.address.customs-url=https://apiuat.iclrccd-fedex.com/export/outbound/customs |
| 38 | -#推送完整报文地址 | 38 | +#\u63A8\u9001\u5B8C\u6574\u62A5\u6587\u5730\u5740 |
| 39 | api.address.complete-msg-url=https://apiuat.iclrccd-fedex.com/export/outbound/mawb | 39 | api.address.complete-msg-url=https://apiuat.iclrccd-fedex.com/export/outbound/mawb |
| 40 | -#iclear应用节点是否能够正常访问 | 40 | +#iclear\u5E94\u7528\u8282\u70B9\u662F\u5426\u80FD\u591F\u6B63\u5E38\u8BBF\u95EE |
| 41 | iclear.address.url42=http://localhost:8080/Exp | 41 | iclear.address.url42=http://localhost:8080/Exp |
| 42 | iclear.address.url43=http://localhost:8080/Exp | 42 | iclear.address.url43=http://localhost:8080/Exp |
| 43 | -#代理地址(刷新token、传输海关回执地址、推送完整报文地址) | 43 | +stamp_path=D:/workspace/prjIClear/src/main/webapp/upload/attachment/slipType_chm/ |
| 44 | +stamp_file_name=stamp.png | ||
| 45 | +#\u4EE3\u7406\u5730\u5740\uFF08\u5237\u65B0token\u3001\u4F20\u8F93\u6D77\u5173\u56DE\u6267\u5730\u5740\u3001\u63A8\u9001\u5B8C\u6574\u62A5\u6587\u5730\u5740\uFF09 | ||
| 44 | api.address.proxy-url=cn2-proxy.apac.fedex.com | 46 | api.address.proxy-url=cn2-proxy.apac.fedex.com |
| 45 | api.address.proxy-port=3128 | 47 | api.address.proxy-port=3128 |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | spring.servlet.context-path=/API | 1 | spring.servlet.context-path=/API |
| 2 | spring.datasource.jndi-name=jdbc/iclearDS | 2 | spring.datasource.jndi-name=jdbc/iclearDS |
| 3 | -#推送海关回执 | 3 | +#\u63A8\u9001\u6D77\u5173\u56DE\u6267 |
| 4 | task.pushCustomsTask=0 0/1 * * * ? | 4 | task.pushCustomsTask=0 0/1 * * * ? |
| 5 | -#推送完整报文 | 5 | +#\u63A8\u9001\u5B8C\u6574\u62A5\u6587 |
| 6 | task.pushMawbTask=0 0/1 * * * ? | 6 | task.pushMawbTask=0 0/1 * * * ? |
| 7 | -#推送失败的回执数据 | 7 | +#\u63A8\u9001\u5931\u8D25\u7684\u56DE\u6267\u6570\u636E |
| 8 | task.pushErrorReturnDate=0 0/30 * * * ? | 8 | task.pushErrorReturnDate=0 0/30 * * * ? |
| 9 | -#推送失败的申报数据 | 9 | +#\u63A8\u9001\u5931\u8D25\u7684\u7533\u62A5\u6570\u636E |
| 10 | task.pushErrorDeclareDate=0 0/30 * * * ? | 10 | task.pushErrorDeclareDate=0 0/30 * * * ? |
| 11 | -#监听iclear节点是否正常定时任务间隔 | 11 | +#\u76D1\u542Ciclear\u8282\u70B9\u662F\u5426\u6B63\u5E38\u5B9A\u65F6\u4EFB\u52A1\u95F4\u9694 |
| 12 | task.monitorIclearNodes=0 0/5 * * * ? | 12 | task.monitorIclearNodes=0 0/5 * * * ? |
| 13 | 13 | ||
| 14 | api.base-address=https://declaration.fedex.com.cn/Exp | 14 | api.base-address=https://declaration.fedex.com.cn/Exp |
| 15 | -#获取token账号 | 15 | +#\u83B7\u53D6token\u8D26\u53F7 |
| 16 | api.token-info.username=iclear_export_prod | 16 | api.token-info.username=iclear_export_prod |
| 17 | -#获取token密码 | 17 | +#\u83B7\u53D6token\u5BC6\u7801 |
| 18 | api.token-info.password=1qaz@WSX | 18 | api.token-info.password=1qaz@WSX |
| 19 | -#IClearC类提交运单地址 | 19 | +#IClearC\u7C7B\u63D0\u4EA4\u8FD0\u5355\u5730\u5740 |
| 20 | api.address.iclear-submit-url=${api.base-address}/chmConsignmentController/submitConsignments | 20 | api.address.iclear-submit-url=${api.base-address}/chmConsignmentController/submitConsignments |
| 21 | -#IClear校验运单地址 | 21 | +#IClear\u6821\u9A8C\u8FD0\u5355\u5730\u5740 |
| 22 | api.address.iclear-check-url=${api.base-address}/chmConsignmentController/checkChmAndDetaliD | 22 | api.address.iclear-check-url=${api.base-address}/chmConsignmentController/checkChmAndDetaliD |
| 23 | -#IClear校验C类运单地址 | 23 | +#IClear\u6821\u9A8CC\u7C7B\u8FD0\u5355\u5730\u5740 |
| 24 | api.address.iclear-check-url-c=${api.base-address}/chmConsignmentController/checkChmAndDetaliC | 24 | api.address.iclear-check-url-c=${api.base-address}/chmConsignmentController/checkChmAndDetaliC |
| 25 | -#获取token地址 | 25 | +#\u83B7\u53D6token\u5730\u5740 |
| 26 | api.address.token-url=https://apictm.iclrccd-fedex.com/login | 26 | api.address.token-url=https://apictm.iclrccd-fedex.com/login |
| 27 | -#刷新token地址 | 27 | +#\u5237\u65B0token\u5730\u5740 |
| 28 | api.address.refresh-token-url=https://apictm.iclrccd-fedex.com/admin/user/token/refresh | 28 | api.address.refresh-token-url=https://apictm.iclrccd-fedex.com/admin/user/token/refresh |
| 29 | -#传输海关回执地址 | 29 | +#\u4F20\u8F93\u6D77\u5173\u56DE\u6267\u5730\u5740 |
| 30 | api.address.customs-url=https://apictm.iclrccd-fedex.com/export/outbound/customs | 30 | api.address.customs-url=https://apictm.iclrccd-fedex.com/export/outbound/customs |
| 31 | -#推送完整报文地址 | 31 | +#\u63A8\u9001\u5B8C\u6574\u62A5\u6587\u5730\u5740 |
| 32 | api.address.complete-msg-url=https://apictm.iclrccd-fedex.com/export/outbound/mawb | 32 | api.address.complete-msg-url=https://apictm.iclrccd-fedex.com/export/outbound/mawb |
| 33 | -#iclear应用节点是否能够正常访问 | 33 | +#iclear\u5E94\u7528\u8282\u70B9\u662F\u5426\u80FD\u591F\u6B63\u5E38\u8BBF\u95EE |
| 34 | iclear.address.url42=https://pjec0003.cndczmd.apac.fedex.com:9002/Exp/ | 34 | iclear.address.url42=https://pjec0003.cndczmd.apac.fedex.com:9002/Exp/ |
| 35 | iclear.address.url43=https://pjec0004.cndczmd.apac.fedex.com:9002/Exp/ | 35 | iclear.address.url43=https://pjec0004.cndczmd.apac.fedex.com:9002/Exp/ |
| 36 | -#代理地址(刷新token、传输海关回执地址、推送完整报文地址) | 36 | +stamp_path=/var/share/iclear/resources/upload/attachment/slipType_chm/ |
| 37 | +stamp_file_name=stamp.png | ||
| 38 | +#\u4EE3\u7406\u5730\u5740\uFF08\u5237\u65B0token\u3001\u4F20\u8F93\u6D77\u5173\u56DE\u6267\u5730\u5740\u3001\u63A8\u9001\u5B8C\u6574\u62A5\u6587\u5730\u5740\uFF09 | ||
| 37 | api.address.proxy-url=cn2-proxy.apac.fedex.com | 39 | api.address.proxy-url=cn2-proxy.apac.fedex.com |
| 38 | api.address.proxy-port=3128 | 40 | api.address.proxy-port=3128 | ... | ... |
| 1 | spring.servlet.context-path=/API | 1 | spring.servlet.context-path=/API |
| 2 | spring.datasource.jndi-name=jdbc/iclearDS | 2 | spring.datasource.jndi-name=jdbc/iclearDS |
| 3 | -#推送海关回执 | 3 | +#\u63A8\u9001\u6D77\u5173\u56DE\u6267 |
| 4 | task.pushCustomsTask=0 0/1 * * * ? | 4 | task.pushCustomsTask=0 0/1 * * * ? |
| 5 | -#推送完整报文 | 5 | +#\u63A8\u9001\u5B8C\u6574\u62A5\u6587 |
| 6 | task.pushMawbTask=0 0/1 * * * ? | 6 | task.pushMawbTask=0 0/1 * * * ? |
| 7 | -#推送失败的回执数据 | 7 | +#\u63A8\u9001\u5931\u8D25\u7684\u56DE\u6267\u6570\u636E |
| 8 | task.pushErrorReturnDate=0 0/3 * * * ? | 8 | task.pushErrorReturnDate=0 0/3 * * * ? |
| 9 | -#推送失败的申报数据 | 9 | +#\u63A8\u9001\u5931\u8D25\u7684\u7533\u62A5\u6570\u636E |
| 10 | task.pushErrorDeclareDate=0 0/3 * * * ? | 10 | task.pushErrorDeclareDate=0 0/3 * * * ? |
| 11 | -#监听iclear节点是否正常定时任务间隔 | 11 | +#\u76D1\u542Ciclear\u8282\u70B9\u662F\u5426\u6B63\u5E38\u5B9A\u65F6\u4EFB\u52A1\u95F4\u9694 |
| 12 | task.monitorIclearNodes=0 0/5 * * * ? | 12 | task.monitorIclearNodes=0 0/5 * * * ? |
| 13 | 13 | ||
| 14 | api.base-address=https://declarationuat.fedex.com.cn/Exp | 14 | api.base-address=https://declarationuat.fedex.com.cn/Exp |
| 15 | -#获取token账号 | 15 | +#\u83B7\u53D6token\u8D26\u53F7 |
| 16 | api.token-info.username=iclear_external_ctm | 16 | api.token-info.username=iclear_external_ctm |
| 17 | -#获取token密码 | 17 | +#\u83B7\u53D6token\u5BC6\u7801 |
| 18 | api.token-info.password=toQu3arch6 | 18 | api.token-info.password=toQu3arch6 |
| 19 | -#IClearC类提交运单地址 | 19 | +#IClearC\u7C7B\u63D0\u4EA4\u8FD0\u5355\u5730\u5740 |
| 20 | api.address.iclear-submit-url=${api.base-address}/chmConsignmentController/submitConsignments | 20 | api.address.iclear-submit-url=${api.base-address}/chmConsignmentController/submitConsignments |
| 21 | -#IClear校验运单地址 | 21 | +#IClear\u6821\u9A8C\u8FD0\u5355\u5730\u5740 |
| 22 | api.address.iclear-check-url=${api.base-address}/chmConsignmentController/checkChmAndDetaliD | 22 | api.address.iclear-check-url=${api.base-address}/chmConsignmentController/checkChmAndDetaliD |
| 23 | -#IClear校验C类运单地址 | 23 | +#IClear\u6821\u9A8CC\u7C7B\u8FD0\u5355\u5730\u5740 |
| 24 | api.address.iclear-check-url-c=${api.base-address}/chmConsignmentController/checkChmAndDetaliC | 24 | api.address.iclear-check-url-c=${api.base-address}/chmConsignmentController/checkChmAndDetaliC |
| 25 | -#获取token地址 | 25 | +#\u83B7\u53D6token\u5730\u5740 |
| 26 | api.address.token-url=https://apiuat.iclrccd-fedex.com/login | 26 | api.address.token-url=https://apiuat.iclrccd-fedex.com/login |
| 27 | -#刷新token地址 | 27 | +#\u5237\u65B0token\u5730\u5740 |
| 28 | api.address.refresh-token-url=https://apiuat.iclrccd-fedex.com/user/token/refresh | 28 | api.address.refresh-token-url=https://apiuat.iclrccd-fedex.com/user/token/refresh |
| 29 | -#传输海关回执地址 | 29 | +#\u4F20\u8F93\u6D77\u5173\u56DE\u6267\u5730\u5740 |
| 30 | api.address.customs-url=https://apiuat.iclrccd-fedex.com/export/outbound/customs | 30 | api.address.customs-url=https://apiuat.iclrccd-fedex.com/export/outbound/customs |
| 31 | -#推送完整报文地址 | 31 | +#\u63A8\u9001\u5B8C\u6574\u62A5\u6587\u5730\u5740 |
| 32 | api.address.complete-msg-url=https://apiuat.iclrccd-fedex.com/export/outbound/mawb | 32 | api.address.complete-msg-url=https://apiuat.iclrccd-fedex.com/export/outbound/mawb |
| 33 | -#iclear应用节点是否能够正常访问 | 33 | +#iclear\u5E94\u7528\u8282\u70B9\u662F\u5426\u80FD\u591F\u6B63\u5E38\u8BBF\u95EE |
| 34 | iclear.address.url42=http://ujec0003.cndczmd.apac.fedex.com:9001/Exp/#login | 34 | iclear.address.url42=http://ujec0003.cndczmd.apac.fedex.com:9001/Exp/#login |
| 35 | iclear.address.url43=http://ujec0004.cndczmd.apac.fedex.com:9001/Exp/#login | 35 | iclear.address.url43=http://ujec0004.cndczmd.apac.fedex.com:9001/Exp/#login |
| 36 | -#代理地址(刷新token、传输海关回执地址、推送完整报文地址) | 36 | +stamp_path=/var/share/iclear/resources/upload/attachment/slipType_chm/ |
| 37 | +stamp_file_name=stamp.png | ||
| 38 | +#\u4EE3\u7406\u5730\u5740\uFF08\u5237\u65B0token\u3001\u4F20\u8F93\u6D77\u5173\u56DE\u6267\u5730\u5740\u3001\u63A8\u9001\u5B8C\u6574\u62A5\u6587\u5730\u5740\uFF09 | ||
| 37 | api.address.proxy-url=cn2-proxy.apac.fedex.com | 39 | api.address.proxy-url=cn2-proxy.apac.fedex.com |
| 38 | api.address.proxy-port=3128 | 40 | api.address.proxy-port=3128 |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | +package com.erry.iclear.dateInterface; | ||
| 2 | + | ||
| 3 | +import com.arronlong.httpclientutil.HttpClientUtil; | ||
| 4 | +import com.arronlong.httpclientutil.builder.HCB; | ||
| 5 | +import com.arronlong.httpclientutil.common.HttpConfig; | ||
| 6 | +import com.arronlong.httpclientutil.common.HttpHeader; | ||
| 7 | +import com.arronlong.httpclientutil.common.SSLs; | ||
| 8 | +import com.erry.iclear.dateInterface.api.response.IClearCheckResult; | ||
| 9 | +import com.erry.iclear.dateInterface.api.response.StampResult; | ||
| 10 | +import com.erry.iclear.dateInterface.util.FileUtils; | ||
| 11 | +import com.erry.iclear.dateInterface.util.JsonToJava; | ||
| 12 | +import com.erry.iclear.dateInterface.util.SHA256Util; | ||
| 13 | +import org.apache.http.Header; | ||
| 14 | + | ||
| 15 | +/** | ||
| 16 | + * 获取HSCODE接口地址 | ||
| 17 | + * fedex | ||
| 18 | + * 2022年4月14日17:55:55 | ||
| 19 | + */ | ||
| 20 | +public class StampRequest { | ||
| 21 | + public static String url = "https://localhost:8780"; | ||
| 22 | + //获取HSCODE接口地址 | ||
| 23 | + public static String path = "/iknowU/stampQuery"; | ||
| 24 | + //时间戳 | ||
| 25 | + public static String timeStamp = "1649839249891"; | ||
| 26 | + //APPID | ||
| 27 | + public static String appId = "DEMO1"; | ||
| 28 | + //APPKEY | ||
| 29 | + public static String appKey = "iClearExportDemo1"; | ||
| 30 | + //需要申请 | ||
| 31 | + public static String security = "8c7f1108316abfb1"; | ||
| 32 | + | ||
| 33 | + public static void main(String[] args) throws Exception{ | ||
| 34 | + hscodeRequest(); | ||
| 35 | + } | ||
| 36 | + | ||
| 37 | + /** | ||
| 38 | + * 获取HSCODE接口地址 | ||
| 39 | + */ | ||
| 40 | + public static void hscodeRequest() throws Exception{ | ||
| 41 | + //hscode 编码可修改 | ||
| 42 | + String json ="{\"consignmentCode\":\"aaaaaaaa\"}"; | ||
| 43 | + | ||
| 44 | + String token = SHA256Util.getSHA256String(StampRequest.appId + StampRequest.appKey + StampRequest.security + StampRequest.timeStamp); | ||
| 45 | + System.out.println(token); | ||
| 46 | + //消息头 | ||
| 47 | + Header[] headers = HttpHeader.custom() | ||
| 48 | + .other("Content-Type", "application/json") | ||
| 49 | + .other("Appid", StampRequest.appId) | ||
| 50 | + .other("appKey", StampRequest.appKey) | ||
| 51 | + .other("TimeStamp", StampRequest.timeStamp) | ||
| 52 | + .other("token", token) | ||
| 53 | + .build(); | ||
| 54 | + //客户端配置 | ||
| 55 | + HCB hcb = HCB.custom() | ||
| 56 | + .timeout(20000) | ||
| 57 | + .pool(100, 10) | ||
| 58 | + .sslpv(SSLs.SSLProtocolVersion.TLSv1_2) | ||
| 59 | + .ssl() | ||
| 60 | + .retry(3); | ||
| 61 | + //URL | ||
| 62 | + String url = StampRequest.url + StampRequest.path; | ||
| 63 | + //HTTP请求 | ||
| 64 | + HttpConfig config = HttpConfig.custom() | ||
| 65 | + .headers(headers) | ||
| 66 | + .url(url) | ||
| 67 | + .encoding("utf-8") | ||
| 68 | + .client(hcb.build()) | ||
| 69 | + .json(json); | ||
| 70 | + String result = HttpClientUtil.post(config); | ||
| 71 | + StampResult stampResult = JsonToJava.parseJson(result, StampResult.class); | ||
| 72 | + FileUtils.convertBase64ToFile(stampResult.getBase64Image(),"C:\\Users\\erry-Fedex\\Desktop\\电子章","bbbbbbb.png"); | ||
| 73 | + } | ||
| 74 | +} |
-
Please register or login to post a comment