Created
March 25, 2024 08:00
-
-
Save SinTeZWh1te/eaab9e2f7bc6bd162b0f7dd6cda6d05d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ru.test.bgbilling.kernel.scripts.global; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
import ru.bitel.bgbilling.common.model.KeyValue; | |
import ru.bitel.bgbilling.kernel.container.managed.ServerContext; | |
import ru.bitel.bgbilling.kernel.script.server.dev.GlobalScriptBase; | |
import ru.bitel.bgbilling.server.util.Setup; | |
import ru.bitel.common.sql.ConnectionSet; | |
import ru.bitel.oss.kernel.directories.address.common.bean.AddressEntityData; | |
import ru.bitel.oss.kernel.directories.address.common.bean.AddressEntityParam; | |
import ru.bitel.oss.kernel.directories.address.common.bean.AddressEntityType; | |
import ru.bitel.oss.kernel.directories.address.common.service.AddressService; | |
import java.sql.Connection; | |
/** | |
* @author sintezwh1te | |
*/ | |
public class Test4 extends GlobalScriptBase { | |
private static final Logger logger = LogManager.getLogger(); | |
@Override | |
public void execute(Setup setup, ConnectionSet connectionSet) throws Exception { | |
Connection con = connectionSet.getConnection(); | |
ServerContext serverContext = ServerContext.get(); | |
AddressService addressService = serverContext.getService(AddressService.class, 0); | |
AddressEntityData addressEntityData = addressService.addressEntityDataGet(AddressEntityType.HOUSE, 1); | |
print("----------------------"); | |
for (KeyValue entity : addressEntityData.getEntityParams()) { | |
print(entity.getKey() + " - " + entity.getValue()); | |
} | |
print("----------------------"); | |
for (AddressEntityParam param : addressEntityData.getConfigParams()) { | |
print(param.getTitle() + " - " + param.getValue()); | |
} | |
print("----------------------"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment