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;
|
}
|
|
}
|