whyclj
2019-10-29 1c0469e45346d464e0c5672ee68f9ecd4fb6be7c
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package com.fgkj.actions;
 
import java.util.List;
 
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.BaseDAOFactory;
import com.fgkj.dto.ServiceModel;
import com.fgkj.dto.Task_Batt_Test;
import com.fgkj.dto.User_task_change;
import com.fgkj.services.User_task_changeService;
import com.opensymphony.xwork2.ActionSupport;
 
public class User_task_changeAction extends ActionSupport{
    private User_task_changeService service = new User_task_changeService();
    private User_task_change utc;
    private Task_Batt_Test tbt;
    private String result;
    
    
    //4.1作业变更申请
    public String add() {
        utc=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,User_task_change.class);
        //System.out.println(utc);
        ServiceModel model=service.add(utc);
        result=ActionUtil.tojson(model);
        return SUCCESS;        
    }
    //4.5作业变更查询(审批)
    public String update() {
        utc=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,User_task_change.class);
        ServiceModel model=service.update(utc);
        result=ActionUtil.tojson(model);
        return SUCCESS;    
    }
    //4.5作业变更查询(删除记录)
    public String delete() {
        utc=ActionUtil.getGson("yyyy-MM-dd HH:mm:ss").fromJson(result,User_task_change.class);
        ServiceModel model=service.delete(utc);
        result=ActionUtil.tojson(model);
        return SUCCESS;    
    }
    
    //4.5作业变更查询
    public String serchByCondition(){
        //System.out.println(result);
        tbt=ActionUtil.getGson("yyyy-MM-dd").fromJson(result, Task_Batt_Test.class);
        ServiceModel model=service.serchByCondition(tbt);
        result=ActionUtil.tojson(model);
        return SUCCESS;    
    } 
    
    //查询所有
    public String searchAll(){
        ServiceModel model=service.searchAll();
        result=ActionUtil.tojson(model);
        return SUCCESS;    
    }
    public String getResult() {
        return result;
    }
    public void setUtc(User_task_change utc) {
        this.utc = utc;
    }
    public void setTbt(Task_Batt_Test tbt) {
        this.tbt = tbt;
    }
    public void setResult(String result) {
        this.result = result;
    }     
}