mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-07-02 21:18:05 +08:00
update
This commit is contained in:
@@ -97,4 +97,13 @@ public class ThirdpartySecretInfoController extends BaseController {
|
|||||||
return AjaxResult.success(thirdpartySecretInfoService.selectStationList(thirdpartySecretInfo.getPlatformType()));
|
return AjaxResult.success(thirdpartySecretInfoService.selectStationList(thirdpartySecretInfo.getPlatformType()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 同步第三方平台名称到字典表
|
||||||
|
*/
|
||||||
|
@GetMapping("/syncThirdpartyPlatformNameToDict")
|
||||||
|
@PreAuthorize("@ss.hasPermi('thirdparty:secret:add')")
|
||||||
|
public AjaxResult syncThirdpartyPlatformNameToDict() {
|
||||||
|
return AjaxResult.success(thirdpartySecretInfoService.syncThirdpartyPlatformNameToDict());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -327,4 +327,7 @@ public class Constants {
|
|||||||
// 通用验证码
|
// 通用验证码
|
||||||
public static final String COMMON_VERIFICATION_CODE = "8888";
|
public static final String COMMON_VERIFICATION_CODE = "8888";
|
||||||
|
|
||||||
|
//第三方平台type
|
||||||
|
public static final String THIRD_PARTY_TYPE = "third_party_type";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,4 +88,6 @@ public interface ThirdpartySecretInfoService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<StationInfoVO> selectStationList(String thirdPlatformType);
|
List<StationInfoVO> selectStationList(String thirdPlatformType);
|
||||||
|
|
||||||
|
String syncThirdpartyPlatformNameToDict();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,18 @@
|
|||||||
package com.jsowell.thirdparty.service.impl;
|
package com.jsowell.thirdparty.service.impl;
|
||||||
|
|
||||||
import com.jsowell.common.constant.CacheConstants;
|
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.core.redis.RedisCache;
|
||||||
|
import com.jsowell.common.enums.thirdparty.ThirdPlatformTypeEnum;
|
||||||
import com.jsowell.common.exception.BusinessException;
|
import com.jsowell.common.exception.BusinessException;
|
||||||
import com.jsowell.common.util.DateUtils;
|
import com.jsowell.common.util.DateUtils;
|
||||||
import com.jsowell.pile.mapper.ThirdPartyStationRelationMapper;
|
import com.jsowell.pile.mapper.ThirdPartyStationRelationMapper;
|
||||||
import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
|
import com.jsowell.pile.vo.ThirdPartySecretInfoVO;
|
||||||
import com.jsowell.pile.vo.base.StationInfoVO;
|
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.domain.ThirdpartySecretInfo;
|
||||||
import com.jsowell.thirdparty.mapper.ThirdpartySecretInfoMapper;
|
import com.jsowell.thirdparty.mapper.ThirdpartySecretInfoMapper;
|
||||||
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
import com.jsowell.thirdparty.service.ThirdpartySecretInfoService;
|
||||||
@@ -33,6 +39,9 @@ public class ThirdpartySecretInfoServiceImpl implements ThirdpartySecretInfoServ
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RedisCache redisCache;
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private SysDictDataMapper sysDictDataMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询对接三方平台配置
|
* 查询对接三方平台配置
|
||||||
*
|
*
|
||||||
@@ -144,4 +153,30 @@ public class ThirdpartySecretInfoServiceImpl implements ThirdpartySecretInfoServ
|
|||||||
public List<StationInfoVO> selectStationList(String thirdPlatformType) {
|
public List<StationInfoVO> selectStationList(String thirdPlatformType) {
|
||||||
return thirdPartyStationRelationMapper.selectStationList(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 "";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user