whyclj
2019-10-29 1c0469e45346d464e0c5672ee68f9ecd4fb6be7c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
package com.fgkj.actions;
 
import java.util.List;
 
import com.fgkj.dao.UinfDaoFactory;
import com.fgkj.dto.BattMap_information;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_inf;
import com.fgkj.dto.User_log;
import com.fgkj.services.BattMap_informationService;
import com.fgkj.services.User_logService;
 
public class BattMap_informationAction extends ActionUtil{
    private BattMap_informationService service = new BattMap_informationService();
    private User_logService uservice=new User_logService();
    private String json;
    private String result;
    
    //9.1录入机房信息
    public String add(){
        BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.add(binfo);
        {
            String msg="设置"+binfo.getStationName()+"在"+binfo.getAddress();
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Increase, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        result = tojson(model);
        return SUCCESS;
    }
    public String update(){
        BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.update(binfo);
        result = tojson(model);
        return SUCCESS;
    }
    //删除机房的位置信息
    public String del(){
        BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.del(binfo);
        {
            String msg="删除"+binfo.getStationName()+"的位置";
            User_log ulog=UinfDaoFactory.CreateULog(UinfDaoFactory.Delete, msg);
            uservice.add(ulog);//将用户的操作记录下来
        }
        result = tojson(model);
        return SUCCESS;
    }
    
    //9.1百度地图定位查询电池组信息
    public String searchAll(){
        List list = service.searchAll();
        result = tojson(list);
        return SUCCESS;
    }
    //9.1地图上根据维护区查询机房经纬度
    public String serchByInfo(){
        BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.serchByInfo(binfo);
        result = tojson(model);
        return SUCCESS;
    }
        
    
    //9.1百度地图定位根据省份查询所有该区域的机房
    public String serchByCondition(){
        BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        List list = service.serchByCondition(binfo);
        result = tojson(list);
        return SUCCESS;
    }
    
    //9.1机房详情显示机房具体落后和告警的信息(机房信息内容画图)
    public String serchMonNum(){
        BattMap_information binfo = getGson().fromJson(json, BattMap_information.class);
        List list = service.serchMonNum(binfo);
        result = tojson(list);
        return SUCCESS;
    }
    
    //9.1查询未添加物理信息的机房
    public String serchNotInBattMap(){
        ServiceModel model = service.serchNotInBattMap();
        result = tojson(model);
        return SUCCESS;
    }
    //9.1查询未添加物理信息的机房(用户管理的)
    public String serchNotInBattMapByUid() {
        User_inf uinf=(User_inf) getUser();
        ServiceModel model = service.serchNotInBattMapByUid(uinf);
        result = tojson(model);
        return SUCCESS;
    }
    //9.1查询已经添加物理信息的机房(用户管理的)
    public String serchInBattMapByUid() {
        User_inf uinf=(User_inf) getUser();
        ServiceModel model = service.serchInBattMapByUid(uinf);
        result = tojson(model);
        return SUCCESS;
    }
    //9.1首页上查询已经添加物理信息的机房(用户管理的)  包括(告警总数落后总数延迟总数)
    public String searchUserManageStation() {
        User_inf uinf=(User_inf) getUser();
        List list = service.searchUserManageStation(uinf);
        result = tojson(list);
        return SUCCESS;
    }
    
    //9.1电池寿命管理
    public String serchByStationid(){
        BattMap_information bmap = getGson().fromJson(json, BattMap_information.class);
        ServiceModel model = service.serchByStationid(bmap);
        result = tojson(model);
        return SUCCESS;
    } 
    
    //9.1查询机房所在的所有省份
      public String serchStationName1(){
          ServiceModel model = service.serchStationName1();
          result = tojson(model);
          return SUCCESS;
      }
      
      //9.1根据省份查询机房所在的所有城市
      public String serchStationName2(){
          BattMap_information bmap = getGson().fromJson(json, BattMap_information.class);
          ServiceModel model = service.serchStationName2(bmap);
          result = tojson(model);
          return SUCCESS;
      }
      
      //9.1根据省份和城市查询机房所在的所有机房
      public String serchStationName(){
          BattMap_information bmap = getGson().fromJson(json, BattMap_information.class);
          ServiceModel model = service.serchStationName(bmap);
          result = tojson(model);
          return SUCCESS;
      }
 
    
    public String getResult() {
        return result;
    }
    public void setJson(String json) {
        this.json = json;
    }
    
    
}