| | |
| | | import com.alibaba.fastjson.JSONObject;
|
| | | import com.github.houbb.opencc4j.core.impl.ZhConvertBootstrap;
|
| | | import com.yb.config.XzConfig;
|
| | | import com.yb.controller.WebSocketController;
|
| | | import com.yb.helper.RsaHelper;
|
| | | import com.yb.util.EntityHttpUtil;
|
| | | import org.springframework.beans.factory.annotation.Autowired;
|
| | |
| | | @Autowired
|
| | | private EntityHttpUtil entityHttpUtil;
|
| | |
|
| | | public HashMap<String, Object> getFunctionMatch(String orderString, Map<String, String> allParams) throws Exception {
|
| | | @Autowired
|
| | | private WebSocketController webSocketController ;
|
| | |
|
| | | public HashMap<String, Object> getFunctionMatch(String orderString, Map<String, String> allParams,String report) throws Exception {
|
| | | HashMap<String, Object> mapObj = new HashMap<String, Object>();
|
| | | JSONObject orderObject = JSON.parseObject(orderString);
|
| | | String name = JSONObject.parseObject(orderObject.getString("args")).getString("place");
|
| | |
| | | } else if (func.equals(xzConfig.funcName[4])) {
|
| | | mapObj = getCombatSimulate(orderObject, func);
|
| | | } else if (func.equals(xzConfig.funcName[5])) {
|
| | | mapObj = getBatEnv(orderObject, func, allParams);
|
| | | // mapObj = getBatEnv(orderObject, func, allParams);
|
| | | getBatEnv(orderObject, func, allParams,report);
|
| | | }else{
|
| | |
|
| | | }
|
| | | return mapObj;
|
| | |
|
| | |
| | | return hashMap;
|
| | | }
|
| | |
|
| | | private HashMap<String, Object> getBatEnv(JSONObject orderObject, String func, Map<String, String> allParams) throws Exception {
|
| | | private void getBatEnv(JSONObject orderObject, String func, Map<String, String> allParams,String report) throws Exception {
|
| | | HashMap<String, Object> hashMap = new HashMap<String, Object>();
|
| | | hashMap.put("func", func);
|
| | |
|
| | | hashMap.put("session_id", (String)allParams.get("session_id"));
|
| | | System.out.println("rec history1:" + allParams);
|
| | |
|
| | | String val = entityHttpUtil.postAgentMessage(xzConfig.battleReport, allParams);
|
| | | JSONObject js = JSONObject.parseObject(val);
|
| | | if (js == null) {
|
| | | // String val = entityHttpUtil.postAgentMessage(xzConfig.battleReport, allParams);
|
| | | // JSONObject js = JSONObject.parseObject(val);
|
| | | if (report ==""|| report == null) {
|
| | | hashMap.put("msg", "报告生成失败");
|
| | | return hashMap;
|
| | | webSocketController.sendAllMessage(JSON.toJSONString(hashMap));
|
| | | }else{
|
| | | hashMap.put("msg", report);
|
| | | webSocketController.sendAllMessage(JSON.toJSONString(hashMap));
|
| | | }
|
| | | System.out.println("rec history1:" + val);
|
| | | hashMap.put("msg", js.getString("content"));
|
| | |
|
| | | return hashMap;
|
| | |
|
| | | }
|
| | |
|
| | | //查看某个区域内各个实体/对象之间的关系
|
| | |
| | | String key = "msg";
|
| | | String msg = (String) poiMap.get(key);
|
| | | hashMap.put("msg", msg);
|
| | | String center = (String) poiMap.get("center");
|
| | | if(center != null){
|
| | | hashMap.put("data", poiMap);
|
| | | }
|
| | | hashMap.put("data", poiMap);
|
| | |
|
| | | return hashMap;
|
| | | }
|
| | |
| | | List<Integer> cNum = new ArrayList<>();
|
| | | for (int i = 0; i < dataArray.size(); i++) {
|
| | | JSONObject dataObj = dataArray.getJSONObject(i);
|
| | | String fclass1 = dataObj.getString("fclass_1");
|
| | | String fclass1 = dataObj.getString(xzConfig.typeFiled);
|
| | | String ids = dataObj.getString("seid");
|
| | | if (cName.contains(fclass1)) {
|
| | | for (int j = 0; j < cName.size(); j++) {
|