package com.fgkj.actions;
|
|
import java.util.List;
|
|
import com.fgkj.dto.ServiceModel;
|
import com.fgkj.dto.User_inf;
|
import com.fgkj.dto.User_task_batt_template;
|
import com.fgkj.services.User_task_batt_templateService;
|
import com.google.gson.reflect.TypeToken;
|
|
import com.opensymphony.xwork2.ActionSupport;
|
|
public class User_task_batt_templateAction extends ActionSupport{
|
private User_task_batt_templateService service=new User_task_batt_templateService();
|
private String result;
|
private User_task_batt_template utbt;
|
|
//4.4 作业模板管理(新建模板)
|
public String add(){
|
utbt=ActionUtil.getGson("yyyy-MM-dd").fromJson(result,User_task_batt_template.class);
|
ServiceModel model=service.add(utbt);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//4.4 作业模板管理(修改模板/重命名)
|
public String update() {
|
List<User_task_batt_template> uplist=ActionUtil.getGson("yyyy-MM-dd").fromJson(result, new TypeToken<List<User_task_batt_template>>(){}.getType());
|
ServiceModel model=service.update(uplist);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//4.4 作业模板管理(删除)
|
public String delete(){
|
utbt=ActionUtil.getGson("yyyy-MM-dd").fromJson(result, User_task_batt_template.class);
|
ServiceModel model=service.delete(utbt);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//4.4根据模板id查询模板的信息
|
public String serchByCondition(){
|
ServiceModel model=service.serchByCondition(utbt);
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
//4.4查询所有的模板
|
public String searchAll(){
|
ServiceModel model=service.searchAll();
|
result=ActionUtil.tojson(model);
|
return SUCCESS;
|
}
|
|
public String getResult() {
|
return result;
|
}
|
|
public void setResult(String result) {
|
this.result = result;
|
}
|
|
public void setUtbt(User_task_batt_template utbt) {
|
this.utbt = utbt;
|
}
|
|
|
}
|