mirror of
https://gitee.com/durcframework/SOP.git
synced 2025-11-13 09:46:09 +08:00
admin后台可关联商户;fastmybatis升级到3.1.7
This commit is contained in:
@@ -11,7 +11,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
public interface IsvInfoMapper extends BaseMapper<IsvInfo> {
|
||||
|
||||
default IsvInfo getByAppId(String appId) {
|
||||
return this.get(IsvInfo::getAppId, appId);
|
||||
return this.getByField(IsvInfo::getAppId, appId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import com.gitee.sop.admin.dao.entity.IsvKeys;
|
||||
public interface IsvKeysMapper extends BaseMapper<IsvKeys> {
|
||||
|
||||
default IsvKeys getByIsvInfoId(Long isvId) {
|
||||
return this.get(IsvKeys::getIsvId, isvId);
|
||||
return this.getByField(IsvKeys::getIsvId, isvId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class DocAppService implements ServiceSupport<DocApp, DocAppMapper> {
|
||||
|
||||
public Long addDocApp(String token, User user) {
|
||||
TornaModuleDTO tornaModuleDTO = tornaClient.execute("module.get", null, token, TornaModuleDTO.class);
|
||||
DocApp docApp = this.get(DocApp::getToken, token);
|
||||
DocApp docApp = this.getByField(DocApp::getToken, token);
|
||||
if (docApp == null) {
|
||||
docApp = new DocApp();
|
||||
docApp.setAppName(tornaModuleDTO.getName());
|
||||
|
||||
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
|
||||
public class DocContentService implements ServiceSupport<DocContent, DocContentMapper> {
|
||||
|
||||
public void saveContent(Long docInfoId, String content) {
|
||||
DocContent docContent = this.get(DocContent::getDocInfoId, docInfoId);
|
||||
DocContent docContent = this.getByField(DocContent::getDocInfoId, docInfoId);
|
||||
boolean save = false;
|
||||
if (docContent == null) {
|
||||
save = true;
|
||||
|
||||
@@ -39,11 +39,11 @@ public class DocInfoService implements ServiceSupport<DocInfo, DocInfoMapper> {
|
||||
private SysUserService sysUserService;
|
||||
|
||||
public List<DocInfo> listChildDoc(Long parentId) {
|
||||
return this.list(DocInfo::getParentId, parentId);
|
||||
return this.listByField(DocInfo::getParentId, parentId);
|
||||
}
|
||||
|
||||
public List<DocInfoTreeDTO> listDocTree(Long docAppId) {
|
||||
List<DocInfo> list = this.list(DocInfo::getDocAppId, docAppId);
|
||||
List<DocInfo> list = this.listByField(DocInfo::getDocAppId, docAppId);
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ public class DocInfoSyncService {
|
||||
*/
|
||||
public void syncDocInfo(DocApp docApp, Long docInfoId, User user) {
|
||||
Long docAppId = docApp.getId();
|
||||
Map<String, DocInfo> nameVersionMap = docInfoService.list(DocInfo::getDocAppId, docAppId)
|
||||
Map<String, DocInfo> nameVersionMap = docInfoService.listByField(DocInfo::getDocAppId, docAppId)
|
||||
.stream()
|
||||
.collect(Collectors.toMap(docInfo -> docInfo.getDocName() + ":" + docInfo.getDocVersion(), Function.identity(), (v1, v2) -> v2));
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ public class IsvInfoService implements ServiceSupport<IsvInfo, IsvInfoMapper> {
|
||||
}
|
||||
|
||||
public IsvKeysDTO getKeys(Long isvId) {
|
||||
IsvKeys isvKeys = isvKeysService.get(IsvKeys::getIsvId, isvId);
|
||||
IsvKeys isvKeys = isvKeysService.getByField(IsvKeys::getIsvId, isvId);
|
||||
IsvKeysDTO isvKeysDTO;
|
||||
if (isvKeys == null) {
|
||||
isvKeysDTO = new IsvKeysDTO();
|
||||
|
||||
@@ -21,7 +21,7 @@ public class IsvKeysService implements ServiceSupport<IsvKeys, IsvKeysMapper> {
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int saveKeys(IsvInfoUpdateKeysDTO isvInfoUpdateKeysDTO) {
|
||||
IsvKeys isvKeys = this.get(IsvKeys::getIsvId, isvInfoUpdateKeysDTO.getIsvId());
|
||||
IsvKeys isvKeys = this.getByField(IsvKeys::getIsvId, isvInfoUpdateKeysDTO.getIsvId());
|
||||
if (isvKeys == null) {
|
||||
isvKeys = new IsvKeys();
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class IsvMerchantService extends BaseLambdaService<IsvMerchant, IsvMercha
|
||||
public int setMerchant(String appId, String merchantCode) {
|
||||
checkMerchantCode(merchantCode);
|
||||
|
||||
IsvMerchant isvMerchant = this.get(IsvMerchant::getAppId, appId);
|
||||
IsvMerchant isvMerchant = this.getByField(IsvMerchant::getAppId, appId);
|
||||
if (isvMerchant == null) {
|
||||
isvMerchant = new IsvMerchant();
|
||||
isvMerchant.setAppId(appId);
|
||||
|
||||
@@ -41,7 +41,7 @@ public class PermIsvGroupService implements ServiceSupport<PermIsvGroup, PermIsv
|
||||
}
|
||||
|
||||
public Map<Long, List<String>> getIsvGroupNameMap(Collection<Long> isvIds) {
|
||||
List<PermIsvGroup> list = this.list(PermIsvGroup::getIsvId, isvIds);
|
||||
List<PermIsvGroup> list = this.listByField(PermIsvGroup::getIsvId, isvIds);
|
||||
if (list.isEmpty()) {
|
||||
return new HashMap<>();
|
||||
}
|
||||
@@ -74,7 +74,7 @@ public class PermIsvGroupService implements ServiceSupport<PermIsvGroup, PermIsv
|
||||
}
|
||||
|
||||
public List<Long> listIsvGroupId(Long isvId) {
|
||||
List<PermIsvGroup> list = this.list(PermIsvGroup::getIsvId, isvId);
|
||||
List<PermIsvGroup> list = this.listByField(PermIsvGroup::getIsvId, isvId);
|
||||
if (list.isEmpty()) {
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class SysConfigService extends BaseLambdaService<SysConfig, SysConfigMapp
|
||||
public void setConfig(SystemConfigDTO systemConfigDTO) {
|
||||
Objects.requireNonNull(systemConfigDTO.getConfigKey(), "need key");
|
||||
Objects.requireNonNull(systemConfigDTO.getConfigValue(), "need value");
|
||||
SysConfig systemConfig = get(SysConfig::getConfigKey, systemConfigDTO.getConfigKey());
|
||||
SysConfig systemConfig = getByField(SysConfig::getConfigKey, systemConfigDTO.getConfigKey());
|
||||
if (systemConfig == null) {
|
||||
systemConfig = CopyUtil.copyBean(systemConfigDTO, SysConfig::new);
|
||||
this.save(systemConfig);
|
||||
@@ -88,7 +88,7 @@ public class SysConfigService extends BaseLambdaService<SysConfig, SysConfigMapp
|
||||
*/
|
||||
public String getConfigValue(String key, String defaultValue) {
|
||||
Objects.requireNonNull(key, "need key");
|
||||
SysConfig systemConfig = get(SysConfig::getConfigKey, key);
|
||||
SysConfig systemConfig = getByField(SysConfig::getConfigKey, key);
|
||||
return Optional.ofNullable(systemConfig)
|
||||
.map(SysConfig::getConfigValue)
|
||||
.orElseGet(() -> environment.getProperty(key, defaultValue));
|
||||
|
||||
@@ -155,7 +155,7 @@ public class SysUserService implements ServiceSupport<SysUser, SysUserMapper> {
|
||||
}
|
||||
|
||||
public SysUser getByUsername(String username) {
|
||||
return this.get(SysUser::getUsername, username);
|
||||
return this.getByField(SysUser::getUsername, username);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user