Добрый день! Для добавления сервиса в модуль Inet я написал такой метод:
Код:
public int addInternetTariff(
@WebParam(name = "contract") int contract,
@WebParam(name = "tariff") int tariff
) throws Exception
{
this.addModule(contract, 1);
ServiceObjectManager som = new ServiceObjectManager(getConnection(), 1);
ServiceObject so = new ServiceObject();
so.setServiceId(3);
so.setContractId(contract);
so.setDate1(new java.util.Date());
som.updateServiceObject(so);
this.addModule(contract, 4);
int tplink = this.addTariff(contract, tariff);
InetServ is = new InetServ();
is.setContractId(contract);
is.setDateFrom(new java.util.Date());
is.setDeviceId(7);
is.setInterfaceId(5);
is.setStatus(is.STATUS_ACTIVE);
is.setDeviceState(is.STATE_ENABLE);
is.setTypeId(1);
is.setLogin("*****");
is.setTitle("111222333");
InetServDao isd = new InetServDao(getConnection(), 4);
isd.update(is);
return tplink;
}
private void addModule(int contract, int module) throws Exception
{
ContractModuleManager cmm = new ContractModuleManager(getConnection());
cmm.addContractModule(contract, module);
}
Сервис создается, но состояние у него "Удален". Состояние у него меняется, только если я зайду в него в клиенте и сохраню руками. Подскажите пожалуйста, как правильно добавить сервис?