Administrator
2018-10-31 781d14b992881ae11bbf3ca60adb42ded26b7b90
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
package com.fgkj.actions;
 
import java.util.List;
 
import com.fgkj.dto.BattInf;
import com.fgkj.dto.Deverror_record;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_inf;
import com.fgkj.services.Deverror_recordService;
 
public class Deverror_recordAction extends ActionUtil{
    private Deverror_recordService service=new Deverror_recordService();
    private String json;
    private String result;
    //用户手动添加问题
    public String add(){
        Deverror_record dev_record=getGson("yyyy-MM-dd").fromJson(json, Deverror_record.class);
        User_inf uinf=(User_inf) getUser();
        dev_record.setUid(uinf.getUId());
        ServiceModel model=service.add(dev_record);
        result=tojson(model);
        return SUCCESS;
    }
    //根据stationid查询设备的问题记录
    public String serchByCondition(){
        BattInf binf=getGson().fromJson(json, BattInf.class);
        User_inf uinf=(User_inf) getUser();
        binf.setNum(uinf.getUId());
        ServiceModel model=service.serchByCondition(binf);
        result=tojson(model);
        return SUCCESS;
    }
    
    public String getResult() {
        return result;
    }
    public void setJson(String json) {
        this.json = json;
    }
    
 
}