1
81041
2019-10-18 cc4059f9f5a2cd6766f4d888bd35d19f3827a053
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
package com.fgkj.actions;
 
import com.fgkj.dto.Chart_Color;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.User_inf;
import com.fgkj.services.Chart_ColorService;
 
public class Chart_ColorAction extends ActionUtil{
    private Chart_ColorService service=new Chart_ColorService();
    private String json;
    private String result;
    
    
    //修改用户的颜色组
    public String update() {
        Chart_Color ccolor=getGson("yyyy-MM-dd HH:mm:ss").fromJson(json, Chart_Color.class);
        Object obj = getUser();
        ServiceModel model = new ServiceModel();
        if(obj != null){
            User_inf user = (User_inf)obj;
            ccolor.setUid(user.getUId());
            model=service.update(ccolor);
            result=tojson(model);
            return SUCCESS;
        }
        result=tojson(model);
        return ERROR;
    }
    //查询用户对应得颜色组
    public String serchByCondition() {        
        Object obj = (User_inf) getUser();
        ServiceModel model = new ServiceModel();
        if(obj!=null){
            User_inf user = (User_inf)obj;
            Chart_Color ccolor = new Chart_Color();
            ccolor.setUid(user.getUId());
            model = service.serchByCondition(ccolor);
            result=tojson(model);
            return SUCCESS;
        }
        result=tojson(model);
        return ERROR;
    }
    
    public String getResult() {
        return result;
    }
    public void setJson(String json) {
        this.json = json;
    }
    
}