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> {
|
public interface IsvInfoMapper extends BaseMapper<IsvInfo> {
|
||||||
|
|
||||||
default IsvInfo getByAppId(String appId) {
|
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> {
|
public interface IsvKeysMapper extends BaseMapper<IsvKeys> {
|
||||||
|
|
||||||
default IsvKeys getByIsvInfoId(Long isvId) {
|
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) {
|
public Long addDocApp(String token, User user) {
|
||||||
TornaModuleDTO tornaModuleDTO = tornaClient.execute("module.get", null, token, TornaModuleDTO.class);
|
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) {
|
if (docApp == null) {
|
||||||
docApp = new DocApp();
|
docApp = new DocApp();
|
||||||
docApp.setAppName(tornaModuleDTO.getName());
|
docApp.setAppName(tornaModuleDTO.getName());
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Service;
|
|||||||
public class DocContentService implements ServiceSupport<DocContent, DocContentMapper> {
|
public class DocContentService implements ServiceSupport<DocContent, DocContentMapper> {
|
||||||
|
|
||||||
public void saveContent(Long docInfoId, String content) {
|
public void saveContent(Long docInfoId, String content) {
|
||||||
DocContent docContent = this.get(DocContent::getDocInfoId, docInfoId);
|
DocContent docContent = this.getByField(DocContent::getDocInfoId, docInfoId);
|
||||||
boolean save = false;
|
boolean save = false;
|
||||||
if (docContent == null) {
|
if (docContent == null) {
|
||||||
save = true;
|
save = true;
|
||||||
|
|||||||
@@ -39,11 +39,11 @@ public class DocInfoService implements ServiceSupport<DocInfo, DocInfoMapper> {
|
|||||||
private SysUserService sysUserService;
|
private SysUserService sysUserService;
|
||||||
|
|
||||||
public List<DocInfo> listChildDoc(Long parentId) {
|
public List<DocInfo> listChildDoc(Long parentId) {
|
||||||
return this.list(DocInfo::getParentId, parentId);
|
return this.listByField(DocInfo::getParentId, parentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<DocInfoTreeDTO> listDocTree(Long docAppId) {
|
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)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
return new ArrayList<>(0);
|
return new ArrayList<>(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ public class DocInfoSyncService {
|
|||||||
*/
|
*/
|
||||||
public void syncDocInfo(DocApp docApp, Long docInfoId, User user) {
|
public void syncDocInfo(DocApp docApp, Long docInfoId, User user) {
|
||||||
Long docAppId = docApp.getId();
|
Long docAppId = docApp.getId();
|
||||||
Map<String, DocInfo> nameVersionMap = docInfoService.list(DocInfo::getDocAppId, docAppId)
|
Map<String, DocInfo> nameVersionMap = docInfoService.listByField(DocInfo::getDocAppId, docAppId)
|
||||||
.stream()
|
.stream()
|
||||||
.collect(Collectors.toMap(docInfo -> docInfo.getDocName() + ":" + docInfo.getDocVersion(), Function.identity(), (v1, v2) -> v2));
|
.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) {
|
public IsvKeysDTO getKeys(Long isvId) {
|
||||||
IsvKeys isvKeys = isvKeysService.get(IsvKeys::getIsvId, isvId);
|
IsvKeys isvKeys = isvKeysService.getByField(IsvKeys::getIsvId, isvId);
|
||||||
IsvKeysDTO isvKeysDTO;
|
IsvKeysDTO isvKeysDTO;
|
||||||
if (isvKeys == null) {
|
if (isvKeys == null) {
|
||||||
isvKeysDTO = new IsvKeysDTO();
|
isvKeysDTO = new IsvKeysDTO();
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public class IsvKeysService implements ServiceSupport<IsvKeys, IsvKeysMapper> {
|
|||||||
|
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int saveKeys(IsvInfoUpdateKeysDTO isvInfoUpdateKeysDTO) {
|
public int saveKeys(IsvInfoUpdateKeysDTO isvInfoUpdateKeysDTO) {
|
||||||
IsvKeys isvKeys = this.get(IsvKeys::getIsvId, isvInfoUpdateKeysDTO.getIsvId());
|
IsvKeys isvKeys = this.getByField(IsvKeys::getIsvId, isvInfoUpdateKeysDTO.getIsvId());
|
||||||
if (isvKeys == null) {
|
if (isvKeys == null) {
|
||||||
isvKeys = new IsvKeys();
|
isvKeys = new IsvKeys();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class IsvMerchantService extends BaseLambdaService<IsvMerchant, IsvMercha
|
|||||||
public int setMerchant(String appId, String merchantCode) {
|
public int setMerchant(String appId, String merchantCode) {
|
||||||
checkMerchantCode(merchantCode);
|
checkMerchantCode(merchantCode);
|
||||||
|
|
||||||
IsvMerchant isvMerchant = this.get(IsvMerchant::getAppId, appId);
|
IsvMerchant isvMerchant = this.getByField(IsvMerchant::getAppId, appId);
|
||||||
if (isvMerchant == null) {
|
if (isvMerchant == null) {
|
||||||
isvMerchant = new IsvMerchant();
|
isvMerchant = new IsvMerchant();
|
||||||
isvMerchant.setAppId(appId);
|
isvMerchant.setAppId(appId);
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class PermIsvGroupService implements ServiceSupport<PermIsvGroup, PermIsv
|
|||||||
}
|
}
|
||||||
|
|
||||||
public Map<Long, List<String>> getIsvGroupNameMap(Collection<Long> isvIds) {
|
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()) {
|
if (list.isEmpty()) {
|
||||||
return new HashMap<>();
|
return new HashMap<>();
|
||||||
}
|
}
|
||||||
@@ -74,7 +74,7 @@ public class PermIsvGroupService implements ServiceSupport<PermIsvGroup, PermIsv
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<Long> listIsvGroupId(Long isvId) {
|
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()) {
|
if (list.isEmpty()) {
|
||||||
return new ArrayList<>(0);
|
return new ArrayList<>(0);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public class SysConfigService extends BaseLambdaService<SysConfig, SysConfigMapp
|
|||||||
public void setConfig(SystemConfigDTO systemConfigDTO) {
|
public void setConfig(SystemConfigDTO systemConfigDTO) {
|
||||||
Objects.requireNonNull(systemConfigDTO.getConfigKey(), "need key");
|
Objects.requireNonNull(systemConfigDTO.getConfigKey(), "need key");
|
||||||
Objects.requireNonNull(systemConfigDTO.getConfigValue(), "need value");
|
Objects.requireNonNull(systemConfigDTO.getConfigValue(), "need value");
|
||||||
SysConfig systemConfig = get(SysConfig::getConfigKey, systemConfigDTO.getConfigKey());
|
SysConfig systemConfig = getByField(SysConfig::getConfigKey, systemConfigDTO.getConfigKey());
|
||||||
if (systemConfig == null) {
|
if (systemConfig == null) {
|
||||||
systemConfig = CopyUtil.copyBean(systemConfigDTO, SysConfig::new);
|
systemConfig = CopyUtil.copyBean(systemConfigDTO, SysConfig::new);
|
||||||
this.save(systemConfig);
|
this.save(systemConfig);
|
||||||
@@ -88,7 +88,7 @@ public class SysConfigService extends BaseLambdaService<SysConfig, SysConfigMapp
|
|||||||
*/
|
*/
|
||||||
public String getConfigValue(String key, String defaultValue) {
|
public String getConfigValue(String key, String defaultValue) {
|
||||||
Objects.requireNonNull(key, "need key");
|
Objects.requireNonNull(key, "need key");
|
||||||
SysConfig systemConfig = get(SysConfig::getConfigKey, key);
|
SysConfig systemConfig = getByField(SysConfig::getConfigKey, key);
|
||||||
return Optional.ofNullable(systemConfig)
|
return Optional.ofNullable(systemConfig)
|
||||||
.map(SysConfig::getConfigValue)
|
.map(SysConfig::getConfigValue)
|
||||||
.orElseGet(() -> environment.getProperty(key, defaultValue));
|
.orElseGet(() -> environment.getProperty(key, defaultValue));
|
||||||
|
|||||||
@@ -155,7 +155,7 @@ public class SysUserService implements ServiceSupport<SysUser, SysUserMapper> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public SysUser getByUsername(String username) {
|
public SysUser getByUsername(String username) {
|
||||||
return this.get(SysUser::getUsername, username);
|
return this.getByField(SysUser::getUsername, username);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user