huminghao 1 개월 전
부모
커밋
f1ad1e1745
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11
    0
      zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/agency/AgencyConfigManagerImpl.java

+ 11
- 0
zhywpt-app-userw/src/main/java/cn/com/taiji/userw/manager/agency/AgencyConfigManagerImpl.java 파일 보기

package cn.com.taiji.userw.manager.agency; package cn.com.taiji.userw.manager.agency;


import cn.com.taiji.core.entity.ass.AssAgencyConfig; 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.entity.dict.EnableStatus;
import cn.com.taiji.core.manager.cache.RedisCacheManager; 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 cn.com.taiji.userw.model.agency.config.*;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@Service @Service
public class AgencyConfigManagerImpl extends RedisCacheManager implements AgencyConfigManager { public class AgencyConfigManagerImpl extends RedisCacheManager implements AgencyConfigManager {


@Autowired
private QtkAgencyRepo agencyRepo;
@Autowired @Autowired
private AssAgencyConfigRepo agencyConfigRepo; private AssAgencyConfigRepo agencyConfigRepo;




@Override @Override
public AgencyConfigResponse add(AgencyConfigAddRequest req) throws ManagerException { public AgencyConfigResponse add(AgencyConfigAddRequest req) throws ManagerException {
checkAgency(req.getAgencyId());
AssAgencyConfig agencyConfig = agencyConfigRepo.findByAgencyId(req.getAgencyId()); AssAgencyConfig agencyConfig = agencyConfigRepo.findByAgencyId(req.getAgencyId());
if (agencyConfig != null){ if (agencyConfig != null){
throw new ManagerException("该渠道已有权限记录。"); throw new ManagerException("该渠道已有权限记录。");
return response; return response;
} }


public void checkAgency(String agencyId) throws ManagerException {
QtkAgency agency = agencyRepo.findByAgencyId(agencyId);
if (agency == null){
throw new ManagerException("没找到渠道。");
}
}
} }

Loading…
취소
저장