客商委托方数据同步修改
This commit is contained in:
+25
-20
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
|
|||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.linke.thirdParty.domain.departInterfaceInfo.entity.SysDepartInterfaceInfo;
|
import com.linke.thirdParty.domain.departInterfaceInfo.entity.SysDepartInterfaceInfo;
|
||||||
import com.linke.thirdParty.domain.departInterfaceInfo.service.SysDepartInterfaceInfoDomainService;
|
import com.linke.thirdParty.domain.departInterfaceInfo.repository.mapper.SysDepartInterfaceInfoMapper;
|
||||||
import com.mhd.common.core.domain.thirdparty.MdmMerchantQueryDTO;
|
import com.mhd.common.core.domain.thirdparty.MdmMerchantQueryDTO;
|
||||||
import com.mhd.common.core.domain.thirdparty.MdmMerchantQueryResultDTO;
|
import com.mhd.common.core.domain.thirdparty.MdmMerchantQueryResultDTO;
|
||||||
import com.mhd.common.core.domain.thirdparty.MdmMerchantRecordDTO;
|
import com.mhd.common.core.domain.thirdparty.MdmMerchantRecordDTO;
|
||||||
@@ -35,7 +35,7 @@ public class MdmMasterDataApplicationService {
|
|||||||
private static final String DEFAULT_URL = "http://10.30.70.2/esbmule/services/query/mdm_nkks_query";
|
private static final String DEFAULT_URL = "http://10.30.70.2/esbmule/services/query/mdm_nkks_query";
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private SysDepartInterfaceInfoDomainService sysDepartInterfaceInfoDomainService;
|
private SysDepartInterfaceInfoMapper sysDepartInterfaceInfoMapper;
|
||||||
|
|
||||||
public MdmMerchantQueryResultDTO queryMerchant(MdmMerchantQueryDTO queryDTO) {
|
public MdmMerchantQueryResultDTO queryMerchant(MdmMerchantQueryDTO queryDTO) {
|
||||||
MdmConfig config = loadConfig();
|
MdmConfig config = loadConfig();
|
||||||
@@ -49,27 +49,32 @@ public class MdmMasterDataApplicationService {
|
|||||||
private MdmConfig loadConfig() {
|
private MdmConfig loadConfig() {
|
||||||
MdmConfig config = new MdmConfig();
|
MdmConfig config = new MdmConfig();
|
||||||
config.url = DEFAULT_URL;
|
config.url = DEFAULT_URL;
|
||||||
List<SysDepartInterfaceInfo> list = sysDepartInterfaceInfoDomainService.queryListByInterfaceType(INTERFACE_TYPE);
|
List<SysDepartInterfaceInfo> list = sysDepartInterfaceInfoMapper.queryConfigByInterfaceType(INTERFACE_TYPE);
|
||||||
for (SysDepartInterfaceInfo info : list) {
|
log.info("MDM客商配置查询到 {} 条记录", list == null ? 0 : list.size());
|
||||||
if (info == null || StringUtils.isEmpty(info.getInterfaceTypeKey())) {
|
if (list != null) {
|
||||||
continue;
|
for (SysDepartInterfaceInfo info : list) {
|
||||||
}
|
if (info == null || StringUtils.isEmpty(info.getInterfaceTypeKey())) {
|
||||||
switch (info.getInterfaceTypeKey()) {
|
continue;
|
||||||
case "url":
|
}
|
||||||
config.url = info.getInterfaceTypeValue();
|
String key = info.getInterfaceTypeKey().trim().toLowerCase();
|
||||||
break;
|
switch (key) {
|
||||||
case "usercode":
|
case "url":
|
||||||
config.usercode = info.getInterfaceTypeValue();
|
config.url = info.getInterfaceTypeValue();
|
||||||
break;
|
break;
|
||||||
case "password":
|
case "usercode":
|
||||||
config.password = info.getInterfaceTypeValue();
|
config.usercode = info.getInterfaceTypeValue();
|
||||||
break;
|
break;
|
||||||
default:
|
case "password":
|
||||||
break;
|
config.password = info.getInterfaceTypeValue();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (StringUtils.isEmpty(config.usercode) || StringUtils.isEmpty(config.password)) {
|
if (StringUtils.isEmpty(config.usercode) || StringUtils.isEmpty(config.password)) {
|
||||||
throw new ServiceException("MDM客商接口未配置 usercode/password,请在三方接口配置中维护 interfaceType=mdm_merchant");
|
throw new ServiceException("MDM客商接口未配置 usercode/password,请在三方接口配置中维护 interfaceType=mdm_merchant"
|
||||||
|
+ "(当前查到 " + (list == null ? 0 : list.size()) + " 条配置)");
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|||||||
+7
@@ -42,6 +42,13 @@ public interface SysDepartInterfaceInfoMapper extends BaseMapper<SysDepartInterf
|
|||||||
*/
|
*/
|
||||||
@Select("SELECT * FROM sys_depart_interface_info WHERE interface_type = #{interfaceType} and del_flag = 1")
|
@Select("SELECT * FROM sys_depart_interface_info WHERE interface_type = #{interfaceType} and del_flag = 1")
|
||||||
public List<SysDepartInterfaceInfo> queryListByInterfaceType(String interfaceType);
|
public List<SysDepartInterfaceInfo> queryListByInterfaceType(String interfaceType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 达梦库下 SELECT * 字段映射可能失败,显式别名保证 interfaceTypeKey/interfaceTypeValue 可读
|
||||||
|
*/
|
||||||
|
@Select("SELECT interface_type_key AS interfaceTypeKey, interface_type_value AS interfaceTypeValue "
|
||||||
|
+ "FROM sys_depart_interface_info WHERE interface_type = #{interfaceType} AND del_flag = 1")
|
||||||
|
List<SysDepartInterfaceInfo> queryConfigByInterfaceType(@Param("interfaceType") String interfaceType);
|
||||||
@Select("select a.interface_type_key,a.interface_type_value from sys_depart_interface_info a where del_flag = 1")
|
@Select("select a.interface_type_key,a.interface_type_value from sys_depart_interface_info a where del_flag = 1")
|
||||||
List<SysDepartInterfaceInfo> queryAllList();
|
List<SysDepartInterfaceInfo> queryAllList();
|
||||||
@Select("select * from sys_depart_interface_info a where del_flag = 1")
|
@Select("select * from sys_depart_interface_info a where del_flag = 1")
|
||||||
|
|||||||
Reference in New Issue
Block a user