//
|
// 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() {
|
}
|
|
@GetMapping({"FindCompany"})
|
public result<List<Company>> FindCompany(Integer page, Integer limit) throws Exception {
|
PageInfo<Company> cz = this.companyService.FindCompany(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());
|
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());
|
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));
|
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);
|
}
|
}
|