| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204 |
- package com.uas.eis.longcheer.config;
- import org.springframework.boot.context.properties.ConfigurationProperties;
- import org.springframework.stereotype.Component;
- /**
- * 龙旗接口对接配置属性
- *
- * @author ZXL
- * @date 2026-06-26
- */
- @Component
- @ConfigurationProperties(prefix = "longcheer")
- public class LongcheerConfig {
- /** 库存同步接口配置 */
- private Inventory inventory = new Inventory();
- /** 采购订单推送接口配置 */
- private Po po = new Po();
- /** 请求超时时间(毫秒),默认 30000 */
- private int timeout = 30000;
- /** 失败重试次数,默认 3 */
- private int retryTimes = 3;
- /** 重试间隔(毫秒),默认 30000 */
- private int retryInterval = 30000;
- /** ELS 账号 -> 租户标识 的映射关系,用于龙旗不传 master 参数时自动定位租户 */
- private java.util.Map<String, String> accountMapping = new java.util.HashMap<String, String>();
- /** 租户标识 -> 供应商 ERP 编码 的映射关系,用于库存推送接口动态填 supplierErpCode */
- private java.util.Map<String, String> supplierMapping = new java.util.HashMap<String, String>();
- public static class Inventory {
- /** 应用密钥 Key(默认值,credentials 未匹配时使用) */
- private String appKey;
- /** 应用密钥 Secret(默认值,credentials 未匹配时使用) */
- private String appSecret;
- /** 接口地址 */
- private String url;
- /** 按 master 区分的凭证映射,key=master,value=该 master 对应的 appKey/appSecret */
- private java.util.Map<String, Credential> credentials = new java.util.HashMap<String, Credential>();
- public String getAppKey() {
- return appKey;
- }
- public void setAppKey(String appKey) {
- this.appKey = appKey;
- }
- public String getAppSecret() {
- return appSecret;
- }
- public void setAppSecret(String appSecret) {
- this.appSecret = appSecret;
- }
- public String getUrl() {
- return url;
- }
- public void setUrl(String url) {
- this.url = url;
- }
- public java.util.Map<String, Credential> getCredentials() {
- return credentials;
- }
- public void setCredentials(java.util.Map<String, Credential> credentials) {
- this.credentials = credentials;
- }
- }
- public static class Po {
- /** 应用密钥 Key(默认值,credentials 未匹配时使用) */
- private String appKey;
- /** 应用密钥 Secret(默认值,credentials 未匹配时使用) */
- private String appSecret;
- /** 接口地址 */
- private String url;
- /** 按 elsAccount 区分的凭证映射,key=elsAccount,value=该 elsAccount 对应的 appKey/appSecret */
- private java.util.Map<String, Credential> credentials = new java.util.HashMap<String, Credential>();
- public String getAppKey() {
- return appKey;
- }
- public void setAppKey(String appKey) {
- this.appKey = appKey;
- }
- public String getAppSecret() {
- return appSecret;
- }
- public void setAppSecret(String appSecret) {
- this.appSecret = appSecret;
- }
- public String getUrl() {
- return url;
- }
- public void setUrl(String url) {
- this.url = url;
- }
- public java.util.Map<String, Credential> getCredentials() {
- return credentials;
- }
- public void setCredentials(java.util.Map<String, Credential> credentials) {
- this.credentials = credentials;
- }
- }
- /**
- * 凭证信息(appKey + appSecret)
- */
- public static class Credential {
- /** 应用密钥 Key */
- private String appKey;
- /** 应用密钥 Secret */
- private String appSecret;
- public String getAppKey() {
- return appKey;
- }
- public void setAppKey(String appKey) {
- this.appKey = appKey;
- }
- public String getAppSecret() {
- return appSecret;
- }
- public void setAppSecret(String appSecret) {
- this.appSecret = appSecret;
- }
- }
- public Inventory getInventory() {
- return inventory;
- }
- public void setInventory(Inventory inventory) {
- this.inventory = inventory;
- }
- public Po getPo() {
- return po;
- }
- public void setPo(Po po) {
- this.po = po;
- }
- public int getTimeout() {
- return timeout;
- }
- public void setTimeout(int timeout) {
- this.timeout = timeout;
- }
- public int getRetryTimes() {
- return retryTimes;
- }
- public void setRetryTimes(int retryTimes) {
- this.retryTimes = retryTimes;
- }
- public int getRetryInterval() {
- return retryInterval;
- }
- public void setRetryInterval(int retryInterval) {
- this.retryInterval = retryInterval;
- }
- public java.util.Map<String, String> getAccountMapping() {
- return accountMapping;
- }
- public void setAccountMapping(java.util.Map<String, String> accountMapping) {
- this.accountMapping = accountMapping;
- }
- public java.util.Map<String, String> getSupplierMapping() {
- return supplierMapping;
- }
- public void setSupplierMapping(java.util.Map<String, String> supplierMapping) {
- this.supplierMapping = supplierMapping;
- }
- }
|