ch
Size: a a a
ch
KR
DC
KR
KR
DP
KR
DP
KR
DP
KR
KR
KR
KR
V
@Transactional
public boolean processing(Long clientId, Long clientCopyId, String mcc) {
if (!isRouteByAccountAndMcc(clientCopyId, mcc)) {
List<RoutingSmsRule> routes = getAllByLevelMccAndAccount(clientId, mcc);
List<RoutingSmsRuleControl> routesControlForCopy = routingSmsRuleControlService.getByAccount(clientId);
for (RoutingSmsRule route : routes) {
//saving routes
saveRoutingRule("-1", clientCopyId, route.getRuleOrder(), route.getWeight(), route.getMcc(), route.getMnc(), route.getVendor(), route.getVendorBackup(), route.getVendorFilter(), route.getVendorFilterBackup(), route.getFiltered(), route.getFilteredContent(), route.getFilterRule(), route.getReplacementRule());
}
routingSmsRuleControlService.deleteAllByAccountId(clientCopyId);
for (RoutingSmsRuleControl smsRuleControlForCopy : routesControlForCopy) {
boolean isUnique = false;
RoutingSmsRuleControl control = new RoutingSmsRuleControl(smsRuleControlForCopy.getMcc(), clientCopyId, smsRuleControlForCopy.getRateControl(), smsRuleControlForCopy.getVendorNegativeRate(), smsRuleControlForCopy.getProfitControl(), smsRuleControlForCopy.getNegativeProfit(), smsRuleControlForCopy.getVendorNegativeProfit(), new Date(0));
try {
routingSmsRuleControlService.save(control);
isUnique = true;
} catch (DataIntegrityViolationException e) {
}
if (!isUnique) {
control = routingSmsRuleControlService.getByMccAndAccount(smsRuleControlForCopy.getMcc(), clientCopyId);
control.setNegativeRateFound(false);
control.setRateControl(smsRuleControlForCopy.getRateControl());
control.setVendorNegativeRate(smsRuleControlForCopy.getVendorNegativeRate());
control.setProfitControl(smsRuleControlForCopy.getProfitControl());
control.setNegativeProfit(smsRuleControlForCopy.getNegativeProfit());
control.setVendorNegativeProfit(smsRuleControlForCopy.getVendorNegativeProfit());
routingSmsRuleControlService.save(control);
}
}
return true;
}
return false;
}
V
V
V