|
|
@@ -73,10 +73,10 @@ public class AgencyManagerImpl extends AbstractManager implements AgencyManager |
|
|
|
if (byAgencyId != null) throw new ManagerException("该机构编号已存在"); |
|
|
|
QtkAgency byName = qtkAgencyRepo.findByName(req.getName()); |
|
|
|
if (byName != null) throw new ManagerException("该机构名称已存在"); |
|
|
|
QtkAgencyMap byCenterAgencyId = qtkAgencyMapRepo.findByCenterAgencyId(req.getCenterAgencyId()); |
|
|
|
QtkAgencyMap byCenterAgencyId = qtkAgencyMapRepo.findByCenterAgencyId(req.getMapAgencyId()); |
|
|
|
if (byCenterAgencyId == null) throw new ManagerException("该中心渠道编号不存在"); |
|
|
|
QtkAgency qtkAgency = copyProperties(req, new QtkAgency()); |
|
|
|
qtkAgency.setMapAgencyId(req.getCenterAgencyId()); |
|
|
|
qtkAgency.setMapAgencyId(req.getMapAgencyId()); |
|
|
|
qtkAgencyRepo.persist(qtkAgency); |
|
|
|
QtkAgencyBkModel[] agencyModels = req.getAgencyModels(); |
|
|
|
ArrayList<QtkAgencyModel> qtkAgencyModels = new ArrayList<>(); |
|
|
@@ -102,11 +102,11 @@ public class AgencyManagerImpl extends AbstractManager implements AgencyManager |
|
|
|
QtkAgency byName = qtkAgencyRepo.findByName(reqDTO.getName()); |
|
|
|
if (byName != null) throw new ManagerException("该机构名称已存在"); |
|
|
|
} |
|
|
|
if (!byAgencyId.getMapAgencyId().equals(reqDTO.getCenterAgencyId())) { |
|
|
|
QtkAgencyMap byCenterAgencyId = qtkAgencyMapRepo.findByCenterAgencyId(reqDTO.getCenterAgencyId()); |
|
|
|
if (!byAgencyId.getMapAgencyId().equals(reqDTO.getMapAgencyId())) { |
|
|
|
QtkAgencyMap byCenterAgencyId = qtkAgencyMapRepo.findByCenterAgencyId(reqDTO.getMapAgencyId()); |
|
|
|
if (byCenterAgencyId == null) throw new ManagerException("该中心渠道编号不存在"); |
|
|
|
} |
|
|
|
byAgencyId.setMapAgencyId(reqDTO.getCenterAgencyId()); |
|
|
|
byAgencyId.setMapAgencyId(reqDTO.getMapAgencyId()); |
|
|
|
byAgencyId.setType(reqDTO.getType()); |
|
|
|
byAgencyId.setName(reqDTO.getName()); |
|
|
|
byAgencyId.setContact(reqDTO.getContact()); |