|
|
@@ -1,8 +1,10 @@ |
|
|
|
package cn.com.taiji.userw.manager.agency; |
|
|
|
|
|
|
|
import cn.com.taiji.core.entity.ass.AssAgencyConfig; |
|
|
|
import cn.com.taiji.core.entity.basic.QtkAgency; |
|
|
|
import cn.com.taiji.core.entity.dict.EnableStatus; |
|
|
|
import cn.com.taiji.core.manager.cache.RedisCacheManager; |
|
|
|
import cn.com.taiji.core.repo.jpa.basic.QtkAgencyRepo; |
|
|
|
import cn.com.taiji.userw.model.agency.config.*; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
@@ -20,6 +22,8 @@ import java.time.LocalDateTime; |
|
|
|
@Service |
|
|
|
public class AgencyConfigManagerImpl extends RedisCacheManager implements AgencyConfigManager { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private QtkAgencyRepo agencyRepo; |
|
|
|
@Autowired |
|
|
|
private AssAgencyConfigRepo agencyConfigRepo; |
|
|
|
|
|
|
@@ -44,6 +48,7 @@ public class AgencyConfigManagerImpl extends RedisCacheManager implements Agency |
|
|
|
|
|
|
|
@Override |
|
|
|
public AgencyConfigResponse add(AgencyConfigAddRequest req) throws ManagerException { |
|
|
|
checkAgency(req.getAgencyId()); |
|
|
|
AssAgencyConfig agencyConfig = agencyConfigRepo.findByAgencyId(req.getAgencyId()); |
|
|
|
if (agencyConfig != null){ |
|
|
|
throw new ManagerException("该渠道已有权限记录。"); |
|
|
@@ -70,4 +75,10 @@ public class AgencyConfigManagerImpl extends RedisCacheManager implements Agency |
|
|
|
return response; |
|
|
|
} |
|
|
|
|
|
|
|
public void checkAgency(String agencyId) throws ManagerException { |
|
|
|
QtkAgency agency = agencyRepo.findByAgencyId(agencyId); |
|
|
|
if (agency == null){ |
|
|
|
throw new ManagerException("没找到渠道。"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |