客商委托方数据同步修改
This commit is contained in:
+10
-5
@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
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.MdmMerchantQueryResultDTO;
|
||||
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";
|
||||
|
||||
@Autowired
|
||||
private SysDepartInterfaceInfoDomainService sysDepartInterfaceInfoDomainService;
|
||||
private SysDepartInterfaceInfoMapper sysDepartInterfaceInfoMapper;
|
||||
|
||||
public MdmMerchantQueryResultDTO queryMerchant(MdmMerchantQueryDTO queryDTO) {
|
||||
MdmConfig config = loadConfig();
|
||||
@@ -49,12 +49,15 @@ public class MdmMasterDataApplicationService {
|
||||
private MdmConfig loadConfig() {
|
||||
MdmConfig config = new MdmConfig();
|
||||
config.url = DEFAULT_URL;
|
||||
List<SysDepartInterfaceInfo> list = sysDepartInterfaceInfoDomainService.queryListByInterfaceType(INTERFACE_TYPE);
|
||||
List<SysDepartInterfaceInfo> list = sysDepartInterfaceInfoMapper.queryConfigByInterfaceType(INTERFACE_TYPE);
|
||||
log.info("MDM客商配置查询到 {} 条记录", list == null ? 0 : list.size());
|
||||
if (list != null) {
|
||||
for (SysDepartInterfaceInfo info : list) {
|
||||
if (info == null || StringUtils.isEmpty(info.getInterfaceTypeKey())) {
|
||||
continue;
|
||||
}
|
||||
switch (info.getInterfaceTypeKey()) {
|
||||
String key = info.getInterfaceTypeKey().trim().toLowerCase();
|
||||
switch (key) {
|
||||
case "url":
|
||||
config.url = info.getInterfaceTypeValue();
|
||||
break;
|
||||
@@ -68,8 +71,10 @@ public class MdmMasterDataApplicationService {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
+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")
|
||||
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")
|
||||
List<SysDepartInterfaceInfo> queryAllList();
|
||||
@Select("select * from sys_depart_interface_info a where del_flag = 1")
|
||||
|
||||
Reference in New Issue
Block a user