fei.wang
10 天以前 e15f561a1f9eddfde503d59baf45a860b131928e
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//
 
package com.flow.controller;
 
import com.flow.pojo.Card;
import com.flow.pojo.Company;
import com.flow.service.CompanyService;
import com.flow.util.DESUtil;
import com.flow.util.result;
import com.flow.util.resultutil;
import com.github.pagehelper.PageInfo;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;
 
@RestController
@RequestMapping({"/hxzk"})
public class ComPanyController {
    @Autowired
    CompanyService companyService;
 
    public ComPanyController() {
    }
 
    @PostMapping({"FindCompany"})
    public result<List<Company>> FindCompany(Integer page, Integer limit,String entry) throws Exception {
        PageInfo<Company> cz = this.companyService.FindCompany(page, limit,entry);
        List<Company> companyList = new ArrayList();
 
        for(int i = 0; i < cz.getSize(); ++i) {
            Company c = new Company();
            c.setCompanyname(((Company)cz.getList().get(i)).getCompanyname());
            c.setLoginphone(DESUtil.decrypt(((Company)cz.getList().get(i)).getLoginphone(), DESUtil.key));
            c.setPhone(DESUtil.decrypt(((Company)cz.getList().get(i)).getPhone(), DESUtil.key));
            c.setCompanyabbname(((Company)cz.getList().get(i)).getCompanyabbname());
            c.setAccountbank(DESUtil.decrypt(((Company)cz.getList().get(i)).getAccountbank(), DESUtil.key));
            c.setAddress(DESUtil.decrypt(((Company)cz.getList().get(i)).getAddress(), DESUtil.key));
            c.setShuinum(DESUtil.decrypt(((Company)cz.getList().get(i)).getShuinum(), DESUtil.key));
            c.setAccount(DESUtil.decrypt(((Company)cz.getList().get(i)).getAccount(), DESUtil.key));
            c.setCompanyid(((Company)cz.getList().get(i)).getCompanyid());
            c.setPassword(((Company)cz.getList().get(i)).getPassword());
            companyList.add(c);
        }
 
        return resultutil.returnSuccess(cz.getTotal(), companyList);
    }
 
    @GetMapping({"FindCompanyZi"})
    public result<List<Company>> FindCompanyZi(String Zong, Integer page, Integer limit) throws Exception {
        PageInfo<Company> cz = this.companyService.FindCompanyZi(Zong, page, limit);
        List<Company> companyList = new ArrayList();
 
        for(int i = 0; i < cz.getSize(); ++i) {
            Company c = new Company();
            c.setCompanyname(((Company)cz.getList().get(i)).getCompanyname());
            c.setLoginphone(DESUtil.decrypt(((Company)cz.getList().get(i)).getLoginphone(), DESUtil.key));
            c.setPhone(DESUtil.decrypt(((Company)cz.getList().get(i)).getPhone(), DESUtil.key));
            c.setCompanyabbname(((Company)cz.getList().get(i)).getCompanyabbname());
            c.setAccountbank(DESUtil.decrypt(((Company)cz.getList().get(i)).getAccountbank(), DESUtil.key));
            c.setAddress(DESUtil.decrypt(((Company)cz.getList().get(i)).getAddress(), DESUtil.key));
            c.setShuinum(DESUtil.decrypt(((Company)cz.getList().get(i)).getShuinum(), DESUtil.key));
            c.setAccount(DESUtil.decrypt(((Company)cz.getList().get(i)).getAccount(), DESUtil.key));
            c.setCompanyid(((Company)cz.getList().get(i)).getCompanyid());
            c.setPassword(((Company)cz.getList().get(i)).getPassword());
            companyList.add(c);
        }
 
        return resultutil.returnSuccess(cz.getTotal(), companyList);
    }
 
    @PostMapping({"DeleteCompany"})
    public int DeleteCard(String companyId) {
        return this.companyService.DeleteCompany(companyId);
    }
 
    @GetMapping({"findSuoShu"})
    public List<Company> findSuoShu() throws Exception {
        return this.companyService.findSuoShu();
    }
 
    @PostMapping({"GongSitableSearch"})
    public result<List<Company>> tableSearch(Company company, int page, int limit) throws Exception {
        PageInfo<Company> cz = this.companyService.tableSearch(company, page, limit);
        List<Company> companyList = new ArrayList();
 
        for(int i = 0; i < cz.getSize(); ++i) {
            Company company1 = new Company();
            company1.setCompanyname(((Company)cz.getList().get(i)).getCompanyname());
            company1.setAddress(DESUtil.decrypt(((Company)cz.getList().get(i)).getAddress(), DESUtil.key));
            company1.setCompanyid(((Company)cz.getList().get(i)).getCompanyid());
            company1.setLoginphone(DESUtil.decrypt(((Company)cz.getList().get(i)).getLoginphone(), DESUtil.key));
            company1.setCompanyabbname(((Company)cz.getList().get(i)).getCompanyabbname());
            company1.setShuinum(DESUtil.decrypt(((Company)cz.getList().get(i)).getShuinum(), DESUtil.key));
            company1.setPhone(DESUtil.decrypt(((Company)cz.getList().get(i)).getPhone(), DESUtil.key));
            company1.setAccountbank(DESUtil.decrypt(((Company)cz.getList().get(i)).getAccountbank(), DESUtil.key));
            company1.setAccount(DESUtil.decrypt(((Company)cz.getList().get(i)).getAccount(), DESUtil.key));
            company1.setPassword(((Company)cz.getList().get(i)).getPassword());
            companyList.add(company1);
        }
 
        return resultutil.returnSuccess(cz.getTotal(), companyList);
    }
 
    @PostMapping({"UpdateGongSi"})
    public ModelAndView UpdateCard(Company company) throws Exception {
        this.companyService.UpdateCard(company);
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/page/Gongs.jsp");
        return modelAndView;
    }
 
    @PostMapping({"addGongSi"})
    public ModelAndView addCard(Company company) throws Exception {
        this.companyService.addGongSi(company);
        ModelAndView modelAndView = new ModelAndView();
        modelAndView.setViewName("/page/Gongs.jsp");
        return modelAndView;
    }
 
    @PostMapping({"ifGongSi"})
    public Card ifGongSi(Company company) throws Exception {
        return this.companyService.ifGongSi(company);
    }
 
    @PostMapping({"MoHuGongSi"})
    @ResponseBody
    public List<Company> MoHuGongSi(Company company) throws Exception {
        company.setCompanyname(company.getCompanyname());
        List<Company> companyList = this.companyService.MoHuGongSi(company);
 
        for(int i = 0; i < companyList.size(); ++i) {
            ((Company)companyList.get(i)).setCompanyname(((Company)companyList.get(i)).getCompanyname());
        }
 
        return companyList;
    }
 
    @PostMapping({"findLoginPhone"})
    public Company findLoginPhone(Company company) throws Exception {
        company.setCompanyabbname(company.getCompanyabbname());
        Company company1 = this.companyService.findLoginPhone(company);
        company1.setLoginphone(DESUtil.decrypt(company1.getLoginphone(), DESUtil.key));
        return company1;
    }
 
    @PostMapping({"bcHxg"})
    public int bcHxg(Company company) throws Exception {
        return this.companyService.bcHxg(company);
    }
 
 
    @PostMapping({"findcomPnone"})
    public String findcomPnone(String company) throws Exception {
        return this.companyService.findcomPnone(company);
    }
 
 
    @PostMapping({"findPnone"})
    public String findPnone(String phone,String companyId) throws Exception {
        return this.companyService.findPnone(phone,companyId);
    }
 
    @PostMapping({"findCompanyname"})
    public String findCompanyname(String companyname) throws Exception {
        return this.companyService.findCompanyname(companyname);
    }
}