From ec63fb17c5ba3e5b2a5a4106c25b4e249a2f980f Mon Sep 17 00:00:00 2001
From: liuhaonan <31457034@qq.com>
Date: 星期二, 22 十一月 2022 18:44:51 +0800
Subject: [PATCH] changes
---
ximon-admin/src/main/java/com/sandu/ximon/admin/pay/alipay/UsrAlipayConfigService.java | 55 +++++++++++++++++++++++++++++++++++++++++--------------
1 files changed, 41 insertions(+), 14 deletions(-)
diff --git a/ximon-admin/src/main/java/com/sandu/ximon/admin/pay/alipay/UsrAlipayConfigService.java b/ximon-admin/src/main/java/com/sandu/ximon/admin/pay/alipay/UsrAlipayConfigService.java
index 9158cd1..c3bd4ff 100644
--- a/ximon-admin/src/main/java/com/sandu/ximon/admin/pay/alipay/UsrAlipayConfigService.java
+++ b/ximon-admin/src/main/java/com/sandu/ximon/admin/pay/alipay/UsrAlipayConfigService.java
@@ -12,8 +12,9 @@
import com.sandu.ximon.admin.service.ClientService;
import com.sandu.ximon.admin.service.PoleService;
import com.sandu.ximon.admin.utils.SpringContextUtil;
-import com.sandu.ximon.dao.domain.AlipayConfigEntity;
+import com.sandu.ximon.dao.domain.AliConfigEntity;
import com.sandu.ximon.dao.domain.Pole;
+import com.sandu.ximon.dao.domain.WxConfigEntity;
import com.sandu.ximon.dao.mapper.UsrAlipayConfigMapper;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
@@ -27,22 +28,22 @@
*/
@Service
@AllArgsConstructor
-public class UsrAlipayConfigService extends BaseServiceImpl<UsrAlipayConfigMapper, AlipayConfigEntity> {
+public class UsrAlipayConfigService extends BaseServiceImpl<UsrAlipayConfigMapper, AliConfigEntity> {
private final UsrAlipayConfigMapper usrAlipayConfigMapper;
private final ClientService clientService;
private final PoleService poleService;
- public AlipayConfigEntity getConfigByPoleId(Long poleId) {
+ public AliConfigEntity getConfigByPoleId(Long poleId) {
Pole pole = poleService.getById(poleId);
if (pole == null) {
throw new BusinessException("鐏潌id閿欒鎴栫伅鏉嗕笉瀛樺湪");
}
- AlipayConfigEntity config;
+ AliConfigEntity config;
if (pole.getClientId() == null) {
config = getById(0);
}
- config = getOne(Wrappers.lambdaQuery(AlipayConfigEntity.class).eq(AlipayConfigEntity::getCreateUserId, SecurityUtils.getUserId()));
+ config = getOne(Wrappers.lambdaQuery(AliConfigEntity.class).eq(AliConfigEntity::getCreateUserId, SecurityUtils.getUserId()));
if(config==null){
throw new BusinessException("鐢ㄦ埛鏈厤缃敮浠橀厤缃�,璇烽厤缃悗閲嶈瘯");
}
@@ -56,24 +57,30 @@
public boolean addAliPayConfig(AlipayConfigParam configParam){
- AlipayConfigEntity config =new AlipayConfigEntity();
+ AliConfigEntity config =new AliConfigEntity();
BeanUtil.copyProperties(configParam,config);
+ if(SecurityUtils.getClientId()!=null){
+ config.setCreateUserId(SecurityUtils.getUserId());
+ if(clientService.findClientId()){
+ config.setClientId(clientService.getClientId());
+ }
+ }
return save(config);
}
public boolean updateAliPayConfig(Integer id,AlipayConfigParam configParam){
- AlipayConfigEntity byId = getById(id);
+ AliConfigEntity byId = getById(id);
if(byId==null){
throw new BusinessException("閰嶇疆id閿欒鎴栭厤缃笉瀛樺湪");
}
- AlipayConfigEntity config =new AlipayConfigEntity();
+ AliConfigEntity config =new AliConfigEntity();
BeanUtil.copyProperties(configParam,config);
config.setConfigId(id);
return updateById(config);
}
public boolean deleteAliPayConfig(Integer id){
- AlipayConfigEntity byId = getById(id);
+ AliConfigEntity byId = getById(id);
if(byId==null){
throw new BusinessException("閰嶇疆id閿欒鎴栭厤缃笉瀛樺湪");
}
@@ -82,21 +89,41 @@
- public List<AlipayConfigEntity> configList(BaseConditionVO baseConditionVO){
- LambdaQueryWrapper<AlipayConfigEntity> wrapper =new LambdaQueryWrapper<>();
+ public List<AliConfigEntity> configList(BaseConditionVO baseConditionVO,String keyword){
+ LambdaQueryWrapper<AliConfigEntity> wrapper =new LambdaQueryWrapper<>();
System.out.println("----------------------------"+clientService.findClientId());
PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
if(SecurityUtils.getClientId()!=null){//瀹㈡埛
if(clientService.findClientId()){//浜岀骇瀹㈡埛
PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
- wrapper= Wrappers.lambdaQuery(AlipayConfigEntity.class).eq(AlipayConfigEntity::getCreateUserId,SecurityUtils.getUserId());
+ wrapper= Wrappers.lambdaQuery(AliConfigEntity.class).eq(AliConfigEntity::getCreateUserId,SecurityUtils.getUserId());
}else if(!clientService.findClientId()){//涓�绾у鎴�
PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
- wrapper= Wrappers.lambdaQuery(AlipayConfigEntity.class).eq(AlipayConfigEntity::getClientId,SecurityUtils.getUserId());
+ wrapper= Wrappers.lambdaQuery(AliConfigEntity.class).eq(AliConfigEntity::getClientId,SecurityUtils.getUserId());
}
} else {//绠$悊
PageHelper.startPage(baseConditionVO.getPageNo(), baseConditionVO.getPageSize());
- wrapper= Wrappers.lambdaQuery(AlipayConfigEntity.class);
+ wrapper= Wrappers.lambdaQuery(AliConfigEntity.class);
+ }
+
+ if(!keyword.isEmpty()){
+ wrapper= wrapper.like(AliConfigEntity::getConfigId,keyword).or(
+ getAppId->{
+ getAppId.like(AliConfigEntity::getAppId,keyword);
+ }
+ ).or(
+ getPid->{
+ getPid.like(AliConfigEntity::getPid,keyword);
+ }
+ ).or(
+ getPublicKey->{
+ getPublicKey.like(AliConfigEntity::getPublicKey,keyword);
+ }
+ ).or(
+ getPrivateKey->{
+ getPrivateKey.like(AliConfigEntity::getPrivateKey,keyword);
+ }
+ );
}
return list(wrapper);
}
--
Gitblit v1.9.3