81041
2019-06-24 a7cdf717e2ad9f3c7a8dcff5ecfa499e2fd372e8
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package com.fgkj.services;
 
import java.util.List;
 
import com.fgkj.actions.ActionUtil;
import com.fgkj.dao.BaseDAO;
import com.fgkj.dao.BaseDAOFactory;
import com.fgkj.dao.ProcessServerDao;
import com.fgkj.dao.impl.Process_surveyImpl;
import com.fgkj.dto.Process_survey;
import com.fgkj.dto.ServiceModel;
 
public class Process_surveyService {
    private BaseDAO dao;
    private ServiceModel model;
    
    public Process_surveyService() {
        this.model = new ServiceModel();
        this.dao = BaseDAOFactory.getBaseDAO(BaseDAO.PROCESS_SURVEY);
    }
    //根据进程名字,将服务是否开启的标识符改为0
    public ServiceModel update(Object obj){
        boolean bl=dao.update(obj);
        
        if(bl){
            model.setCode(1);
            model.setMsg("修改成功!");
        }else{
            model.setCode(0);
            model.setMsg("修改失败!");
        }
        return model;
    }
    //界面修改进程名字和超时时间
    public ServiceModel updateAll(Object obj){
        boolean bl=((Process_surveyImpl)dao).updateAll(obj);
        if(bl){
            model.setCode(1);
            model.setMsg("修改成功!");
        }else{
            model.setCode(0);
            model.setMsg("修改失败!");
        }
        return model;
    }
    //界面修改进程同服务对应的标识位
    public ServiceModel updateFlag(Object obj){
        boolean bl=((Process_surveyImpl)dao).updateFlag(obj);
        if(bl){
            model.setCode(1);
            model.setMsg("修改成功!");
        }else{
            model.setCode(0);
            model.setMsg("修改失败!");
        }
        return model;
    }
    //查询所有进程的运行情况
    public ServiceModel searchAll(){
        List<Process_survey> list=dao.searchAll();
        
        if(list!=null&&list.size()>0){
            model.setCode(1);
            model.setData(list);
            model.setMsg("查询成功!");
        }else{
            model.setCode(0);
            model.setMsg("查询失败!");
        }
        return model;
    }
    //验证重启密码
    public ServiceModel judgeRestart(Object obj){
        String default_pwd=(String) ActionUtil.EncryptionMD5(ProcessServerDao.RESTART_PWD);
        String restart_pwd=(String) ActionUtil.EncryptionMD5(obj);
        if(restart_pwd.equals(default_pwd)){
            model.setCode(1);
            model.setMsg("验证通过!");
        }else{
            model.setCode(0);
            model.setMsg("验证失败!");
        }
        return model;
    }
    public static void main(String[] args) {
        Process_surveyService ps=new Process_surveyService();
        ps.searchAll();
    }
}