This commit is contained in:
YAS\29473
2025-09-13 10:19:17 +08:00
parent 617e9120e1
commit f7b7a5599e
4 changed files with 49 additions and 0 deletions

View File

@@ -97,4 +97,13 @@ public class ThirdpartySecretInfoController extends BaseController {
return AjaxResult.success(thirdpartySecretInfoService.selectStationList(thirdpartySecretInfo.getPlatformType()));
}
/**
* 同步第三方平台名称到字典表
*/
@GetMapping("/syncThirdpartyPlatformNameToDict")
@PreAuthorize("@ss.hasPermi('thirdparty:secret:add')")
public AjaxResult syncThirdpartyPlatformNameToDict() {
return AjaxResult.success(thirdpartySecretInfoService.syncThirdpartyPlatformNameToDict());
}
}

View File

@@ -327,4 +327,7 @@ public class Constants {
// 通用验证码
public static final String COMMON_VERIFICATION_CODE = "8888";
//第三方平台type
public static final String THIRD_PARTY_TYPE = "third_party_type";
}

View File

@@ -88,4 +88,6 @@ public interface ThirdpartySecretInfoService {
* @return
*/
List<StationInfoVO> selectStationList(String thirdPlatformType);
String syncThirdpartyPlatformNameToDict();
}

View File

@@ -1,12 +1,18 @@
package com.jsowell.thirdparty.service.impl;
import com.jsowell.common.constant.CacheConstants;
import com.jsowell.common.constant.Constants;
import com.jsowell.common.core.domain.entity.SysDictData;
import com.jsowell.common.core.domain.entity.SysDictType;
import com.jsowell.common.core.redis.RedisCache;
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
import com.jsowell.common.exception.BusinessException;
import com.jsowell.common.util.DateUtils;
import com.jsowell.pile.mapper.ThirdPartyStationRelationMapper;
import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
import com.jsowell.pile.vo.base.StationInfoVO;
import com.jsowell.system.mapper.SysDictDataMapper;
import com.jsowell.system.mapper.SysDictTypeMapper;
import com.jsowell.thirdparty.domain.ThirdpartySecretInfo;
import com.jsowell.thirdparty.mapper.ThirdpartySecretInfoMapper;
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
@@ -33,6 +39,9 @@ public class ThirdpartySecretInfoServiceImpl implements ThirdpartySecretInfoServ
@Autowired
private RedisCache redisCache;
@Autowired
private SysDictDataMapper sysDictDataMapper;
/**
* 查询对接三方平台配置
*
@@ -144,4 +153,30 @@ public class ThirdpartySecretInfoServiceImpl implements ThirdpartySecretInfoServ
public List<StationInfoVO> selectStationList(String thirdPlatformType) {
return thirdPartyStationRelationMapper.selectStationList(thirdPlatformType);
}
@Override
public String syncThirdpartyPlatformNameToDict() {
List<SysDictData> sysDictData = sysDictDataMapper.selectDictDataByType(Constants.THIRD_PARTY_TYPE);
for (ThirdPlatformTypeEnum platformType : ThirdPlatformTypeEnum.values()) {
String typeCode = platformType.getTypeCode();
for (SysDictData data : sysDictData) {
if (typeCode.equals(data.getDictValue())) {
break;
}else {
SysDictData dictData = new SysDictData();
dictData.setDictSort(0L);
dictData.setDictLabel(platformType.getTypeLabel());
dictData.setDictValue(platformType.getTypeCode());
dictData.setDictType(Constants.THIRD_PARTY_TYPE);
dictData.setListClass("default");
dictData.setIsDefault("N");
dictData.setStatus("0");
dictData.setCreateBy("thinkgem");
dictData.setCreateTime(DateUtils.getNowDate());
sysDictDataMapper.insertDictData(dictData);
}
}
}
return "";
}
}