| | |
| | | import org.springframework.beans.factory.annotation.Value;
|
| | | import org.springframework.cache.annotation.Cacheable;
|
| | |
|
| | | import com.smtaiserver.smtaiserver.attach.SMTAIAttachMetricDef;
|
| | | import com.smtaiserver.smtaiserver.attach.SMTAIAttachTableDef;
|
| | | import com.smtaiserver.smtaiserver.database.SMTDatabase;
|
| | | import com.smtaiserver.smtaiserver.database.SMTDatabase.DBQueryNotify;
|
| | |
| | | public CoordinateTransform[] getGisTransform() throws Exception
|
| | | {
|
| | | String gisProjParam = (String)SMTAIServerApp.getApp().getGlobalConfig("gis.proj.src", "+proj=longlat +datum=WGS84 +no_defs");
|
| | | String mapProjParam = (String)SMTAIServerApp.getApp().getGlobalConfig("gis.proj.tag");
|
| | | String mapProjParam = (String)SMTAIServerApp.getApp().getGlobalConfig("gis.proj.tag", "+proj=longlat +datum=WGS84 +no_defs");
|
| | |
|
| | | CRSFactory crsFactory = new CRSFactory();
|
| | | CoordinateTransformFactory ctFactory = new CoordinateTransformFactory();
|
| | |
| | |
|
| | | try
|
| | | {
|
| | | // 读取所有amis的agent
|
| | | db.querySQLNotify(
|
| | | String sql = |
| | | " SELECT agent_id,agent_type,agent_xml,clz_name,clz_arguments, group_type, agent_title, agent_group, agent_order,inner_call"
|
| | | + " FROM ai_agent_amis A"
|
| | | + " LEFT JOIN ai_scene_group G ON A.agent_group = G.group_id"
|
| | | + " WHERE " + (debugMode ? " agent_order > 0 OR is_debug='Y'" : "agent_order > 0 AND is_debug IS NULL")
|
| | | + " ORDER BY abs(agent_order)"
|
| | | , null,
|
| | | new DBQueryNotify() {
|
| | | ;
|
| | |
|
| | | // 读取所有amis的agent
|
| | | db.querySQLNotify(sql, null, new DBQueryNotify() {
|
| | | @Override
|
| | | public boolean onNextRecord(DBRecord rec) throws Exception
|
| | | {
|
| | |
| | | }
|
| | | return mapResult;
|
| | | }
|
| | | |
| | | @Cacheable(value="getAttachMetricDefMap")
|
| | | public Map<String, SMTAIAttachMetricDef> getAttachMetricDefMap() throws Exception
|
| | | {
|
| | | Map<String, SMTAIAttachMetricDef> mapResult = new HashMap<>();
|
| | | SMTDatabase db = SMTAIServerApp.getApp().allocDatabase();
|
| | | try
|
| | | {
|
| | | DBRecords recs;
|
| | | |
| | | recs = db.querySQL("SELECT * FROM ai_attach_metric", null);
|
| | | for(DBRecord rec : recs.getRecords())
|
| | | {
|
| | | SMTAIAttachMetricDef attachMetricDef = new SMTAIAttachMetricDef(rec);
|
| | | mapResult.put(attachMetricDef.getId(), attachMetricDef);
|
| | | }
|
| | |
|
| | | }
|
| | | finally
|
| | | {
|
| | | db.close();
|
| | | }
|
| | | return mapResult; |
| | | }
|
| | |
|
| | | }
|