|
@@ -1081,28 +1081,32 @@ public class ProductionresourceServiceImpl extends SuperCacheServiceImpl<Product
|
|
|
*/
|
|
|
@Override
|
|
|
public Map getEquipListByInterface() {
|
|
|
+ Map<String,Map>returnMap = new HashMap<>();
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
|
|
|
HttpEntity<String> formEntity = new HttpEntity<String>("", headers);
|
|
|
String instructionUrl = DictionaryKey.INSTRUCTION_URL + "/api/getEquipment" ;
|
|
|
- String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
|
|
|
- //TODO
|
|
|
- Map<String,Map>returnMap = new HashMap<>();
|
|
|
- if(StringUtil.isNotEmpty(returnData)){
|
|
|
- JSONArray jsonArray = JSONArray.parseArray(returnData);
|
|
|
- for(Object obj:jsonArray){
|
|
|
- if(obj!=null){
|
|
|
- JSONObject jsonObject = (JSONObject)obj;
|
|
|
- String no = jsonObject.getString("SerialNo");
|
|
|
- String status = jsonObject.getString("Status");
|
|
|
- String controlStatus = jsonObject.getString("ControlStatus");
|
|
|
- Map childMap = new HashMap();
|
|
|
- childMap.put("no",no);
|
|
|
- childMap.put("status",status);
|
|
|
- childMap.put("controlStatus",controlStatus);
|
|
|
- returnMap.put(no,childMap);
|
|
|
+ try{
|
|
|
+ String returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
|
|
|
+ //TODO
|
|
|
+ if(StringUtil.isNotEmpty(returnData)){
|
|
|
+ JSONArray jsonArray = JSONArray.parseArray(returnData);
|
|
|
+ for(Object obj:jsonArray){
|
|
|
+ if(obj!=null){
|
|
|
+ JSONObject jsonObject = (JSONObject)obj;
|
|
|
+ String no = jsonObject.getString("SerialNo");
|
|
|
+ String status = jsonObject.getString("Status");
|
|
|
+ String controlStatus = jsonObject.getString("ControlStatus");
|
|
|
+ Map childMap = new HashMap();
|
|
|
+ childMap.put("no",no);
|
|
|
+ childMap.put("status",status);
|
|
|
+ childMap.put("controlStatus",controlStatus);
|
|
|
+ returnMap.put(no,childMap);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
return returnMap;
|
|
|
}
|