package com.fgkj.actions; import java.util.List; import com.fgkj.dto.ServiceModel; import com.fgkj.dto.User_task_param; import com.fgkj.services.User_task_paramService; import com.google.gson.reflect.TypeToken; import com.opensymphony.xwork2.ActionSupport; public class User_task_paramAction extends ActionSupport{ private User_task_paramService service=new User_task_paramService(); private User_task_param utp; private String result; //4.2作业参数(新增作业参数) public String add() { utp=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,User_task_param.class); ServiceModel model=service.add(utp); result=ActionUtil.tojson(model); return SUCCESS; } //4.2作业参数(重命名操作) public String update() { utp=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,User_task_param.class); ServiceModel model=service.update(utp); result=ActionUtil.tojson(model); return SUCCESS; } //4.2作业参数(重命名操作) public String updatePro() { List uplist=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,new TypeToken>(){}.getType()); ServiceModel model=service.updatePro(uplist); result=ActionUtil.tojson(model); return SUCCESS; } //4.2作业参数(删除) public String delete() { utp=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,User_task_param.class); ServiceModel model=service.delete(utp); result=ActionUtil.tojson(model); return SUCCESS; } //4.2查询所有参数种类 public String searchAll(){ ServiceModel model=service.searchAll(); result=ActionUtil.tojson(model); return SUCCESS; } //4.2根据参数id查基本参数和模板参数 public String serchByCondition(){ ServiceModel model=service.serchByCondition(utp); result=ActionUtil.tojson(model); return SUCCESS; } public User_task_param getUtp() { return utp; } public void setUtp(User_task_param utp) { this.utp = utp; } public String getResult() { return result; } public void setResult(String result) { this.result = result; } }