¶Ô±ÈÐÂÎļþ |
| | |
| | | // |
| | | // Source code recreated from a .class file by IntelliJ IDEA |
| | | // (powered by FernFlower decompiler) |
| | | // |
| | | |
| | | package com.flow.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.flow.mapper.CompanyMapper; |
| | | import com.flow.mapper.ManagerMapper; |
| | | import com.flow.mapper.TbFuwuqiMapper; |
| | | import com.flow.pojo.*; |
| | | import com.flow.service.CompanyService; |
| | | import com.flow.service.OperationLogService; |
| | | import com.flow.util.DESUtil; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | @Service |
| | | public class CompanyServiceImpl extends ServiceImpl<CompanyMapper, Company> implements CompanyService { |
| | | String key = "FHGT4KHVJKVKV2KHCTBM"; |
| | | @Autowired |
| | | CompanyMapper companyMapper; |
| | | |
| | | @Autowired |
| | | ManagerMapper managerMapper; |
| | | |
| | | @Autowired |
| | | OperationLogService operationLogService; |
| | | public CompanyServiceImpl() { |
| | | } |
| | | |
| | | public PageInfo<Company> FindCompany(Integer page, Integer limit) throws Exception { |
| | | PageHelper.startPage(page, limit); |
| | | List<Company> cardList = this.companyMapper.findAllcompany(); |
| | | PageInfo<Company> info = new PageInfo(cardList); |
| | | return info; |
| | | } |
| | | |
| | | public PageInfo<Company> FindCompanyZi(String Zong, Integer page, Integer limit) throws Exception { |
| | | PageHelper.startPage(page, limit); |
| | | List<Company> cardList = this.companyMapper.findAllcompanyZi(Zong); |
| | | PageInfo<Company> info = new PageInfo(cardList); |
| | | return info; |
| | | } |
| | | |
| | | public int DeleteCompany(String companyId) { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("companyId", companyId); |
| | | Company company = new Company(); |
| | | company.setNone("1"); |
| | | Company company1 = (Company)((CompanyMapper)this.baseMapper).selectOne(queryWrapper); |
| | | OperationLog operationLog = new OperationLog(); |
| | | operationLog.setCaozuotype("å é¤"); |
| | | operationLog.setCaozuocontent("å é¤å
¬å¸ï¼"+company1.getCompanyname()); |
| | | operationLog.setCaozuoname(company1.getCaozuoname()); |
| | | operationLogService.addOperationLog(operationLog); |
| | | return ((CompanyMapper)this.baseMapper).update(company, queryWrapper); |
| | | } |
| | | |
| | | public List<Company> findSuoShu() throws Exception { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("none", "0"); |
| | | List<Company> c = ((CompanyMapper)this.baseMapper).selectList(queryWrapper); |
| | | List<Company> cardList = new ArrayList(); |
| | | |
| | | for(int i = 0; i < c.size(); ++i) { |
| | | Company card = new Company(); |
| | | card.setCompanyname(((Company)c.get(i)).getCompanyname()); |
| | | cardList.add(card); |
| | | } |
| | | |
| | | return cardList; |
| | | } |
| | | |
| | | public PageInfo<Company> tableSearch(Company company, int page, int limit) throws Exception { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("none", 0); |
| | | new PageInfo(); |
| | | PageInfo info; |
| | | if (company.getCompanyname() != "") { |
| | | queryWrapper.like("companyname", company.getCompanyname()); |
| | | queryWrapper.like("companyabbname", company.getCompanyname()); |
| | | info = new PageInfo(((CompanyMapper)this.baseMapper).selectList(queryWrapper)); |
| | | } else { |
| | | info = new PageInfo(((CompanyMapper)this.baseMapper).selectList(queryWrapper)); |
| | | } |
| | | |
| | | return info; |
| | | } |
| | | |
| | | public int UpdateCard(Company company) throws Exception { |
| | | System.out.println(company); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("companyId", company.getCompanyid()); |
| | | Company company1 = new Company(); |
| | | company1.setCompany(company.getCompanyname()); |
| | | company1.setAddress(DESUtil.encrypt(company.getAddress(), this.key)); |
| | | company1.setAccount(DESUtil.encrypt(company.getAccount(), this.key)); |
| | | company1.setCompanyabbname(company.getCompanyabbname()); |
| | | company1.setCompanyname(company.getCompanyname()); |
| | | company1.setPhone(DESUtil.encrypt(company.getPhone(), this.key)); |
| | | company1.setLoginphone(DESUtil.encrypt(company.getLoginphone(), this.key)); |
| | | company1.setAccountbank(DESUtil.encrypt(company.getAccountbank(), this.key)); |
| | | company1.setShuinum(DESUtil.encrypt(company.getShuinum(), this.key)); |
| | | System.out.println(company1); |
| | | OperationLog operationLog = new OperationLog(); |
| | | operationLog.setCaozuotype("ä¿®æ¹"); |
| | | operationLog.setCaozuocontent("ä¿®æ¹å
¬å¸ï¼"+company.getCompanyname()); |
| | | operationLog.setCaozuoname(company.getCaozuoname()); |
| | | |
| | | operationLogService.addOperationLog(operationLog); |
| | | Date date = new Date(); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | company1.setEnterdate(formatter.format(date)); |
| | | return ((CompanyMapper)this.baseMapper).update(company1, queryWrapper); |
| | | } |
| | | |
| | | public int addGongSi(Company company) throws Exception { |
| | | company.setCompany(company.getCompanyname()); |
| | | company.setAddress(DESUtil.encrypt(company.getAddress(), this.key)); |
| | | company.setAccount(DESUtil.encrypt(company.getAccount(), this.key)); |
| | | company.setCompanyabbname(company.getCompanyabbname()); |
| | | company.setCompanyname(company.getCompanyname()); |
| | | company.setPhone(DESUtil.encrypt(company.getPhone(), this.key)); |
| | | company.setLoginphone(DESUtil.encrypt(company.getLoginphone(), this.key)); |
| | | company.setAccountbank(DESUtil.encrypt(company.getAccountbank(), this.key)); |
| | | company.setShuinum(DESUtil.encrypt(company.getShuinum(), this.key)); |
| | | // Company company1 = (Company)((CompanyMapper)this.baseMapper).selectOne(queryWrapper); |
| | | OperationLog operationLog = new OperationLog(); |
| | | operationLog.setCaozuotype("æ°å¢"); |
| | | operationLog.setCaozuocontent("æ°å¢å
¬å¸ï¼"+company.getCompanyname()); |
| | | operationLog.setCaozuoname(company.getCaozuoname()); |
| | | |
| | | operationLogService.addOperationLog(operationLog); |
| | | Date date = new Date(); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | company.setEnterdate(formatter.format(date)); |
| | | return ((CompanyMapper)this.baseMapper).insert(company); |
| | | } |
| | | |
| | | public Company findUser(Company company) throws Exception { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | if (company.getPassword()!=null){ |
| | | queryWrapper.eq("password", company.getPassword()); |
| | | }else{ |
| | | queryWrapper.eq("companyabbName", company.getCompanyabbname()); |
| | | } |
| | | |
| | | queryWrapper.eq("loginPhone", company.getLoginphone()); |
| | | Company user = new Company(); |
| | | user = (Company)((CompanyMapper)this.baseMapper).selectOne(queryWrapper); |
| | | QueryWrapper queryWrapper1 = new QueryWrapper(); |
| | | queryWrapper1.eq("phone", DESUtil.decrypt(company.getLoginphone(), DESUtil.key)); |
| | | Manager manager = managerMapper.selectOne(queryWrapper1); |
| | | if (user==null){ |
| | | |
| | | if (manager!=null){ |
| | | QueryWrapper queryWrapper2 = new QueryWrapper(); |
| | | queryWrapper2.eq("company", "å京åæåææºæ§ææ¯æéå
¬å¸"); |
| | | user = (Company)((CompanyMapper)this.baseMapper).selectOne(queryWrapper2); |
| | | if (manager.getJuese().equals("访客")){ |
| | | user.setRudq("访客"); |
| | | }else if (manager.getJuese().equals("æ®é管çå")){ |
| | | user.setRudq(manager.getJuese()+","+manager.getUadd()+","+manager.getUupdate()+","+manager.getUdelete()+","+manager.getName()); |
| | | |
| | | }else{ |
| | | user.setRudq(manager.getJuese()+","+manager.getUadd()+","+manager.getUupdate()+","+manager.getUdelete()+","+manager.getName()+","); |
| | | |
| | | } |
| | | } |
| | | }else{ |
| | | if (manager!=null){ |
| | | user.setRudq(manager.getJuese()+","+manager.getUadd()+","+manager.getUupdate()+","+manager.getUdelete()+","+manager.getName()); |
| | | } |
| | | } |
| | | return user; |
| | | } |
| | | |
| | | public String chaZi(String Zong) throws Exception { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("companyname", Zong); |
| | | Company company = (Company)((CompanyMapper)this.baseMapper).selectOne(queryWrapper); |
| | | String zi = company.getCompanyname(); |
| | | return zi; |
| | | } |
| | | |
| | | public int upUser(Company company) throws Exception { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("companyabbName", company.getCompanyabbname()); |
| | | company.setLoginphone(DESUtil.encrypt(company.getLoginphone(), DESUtil.key)); |
| | | company.setCompanyabbname(company.getCompanyabbname()); |
| | | return ((CompanyMapper)this.baseMapper).update(company, queryWrapper); |
| | | } |
| | | |
| | | public Card ifGongSi(Company company) throws Exception { |
| | | new QueryWrapper(); |
| | | String name = company.getCompanyname(); |
| | | String namea = company.getCompanyabbname(); |
| | | return this.companyMapper.ifGongSi(name, namea); |
| | | } |
| | | |
| | | public List<Company> MoHuGongSi(Company company) { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.like("companyName", "%" + company.getCompanyname() + "%"); |
| | | queryWrapper.eq("none", "0"); |
| | | return ((CompanyMapper)this.baseMapper).selectList(queryWrapper); |
| | | } |
| | | |
| | | public Company findLoginPhone(Company company) { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("companyabbName", company.getCompanyabbname()); |
| | | return (Company)((CompanyMapper)this.baseMapper).selectOne(queryWrapper); |
| | | } |
| | | |
| | | public List<Company> findLength() { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | return ((CompanyMapper)this.baseMapper).selectList(queryWrapper); |
| | | } |
| | | |
| | | public Company HuoPhone(Company company) throws Exception { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("loginPhone", DESUtil.encrypt(company.getLoginphone(), DESUtil.key)); |
| | | Company company1=new Company(); |
| | | company1= companyMapper.selectOne(queryWrapper); |
| | | if (company1==null){ |
| | | Company company2=new Company(); |
| | | QueryWrapper queryWrapper1 = new QueryWrapper(); |
| | | queryWrapper1.eq("phone", company.getLoginphone()); |
| | | Manager manager = managerMapper.selectOne(queryWrapper1); |
| | | if (manager!=null){ |
| | | if (manager.getJuese().equals("访客")){ |
| | | company2.setCompany("访客"); |
| | | company2.setCompanyabbname("访客"); |
| | | }else{ |
| | | company2.setCompanyname("å京åæåææºæ§ææ¯æéå
¬å¸"); |
| | | company2.setCompanyabbname("åææºæ§"); |
| | | } |
| | | |
| | | } |
| | | return company2; |
| | | }else{ |
| | | return company1; |
| | | } |
| | | |
| | | // |
| | | |
| | | } |
| | | |
| | | public Company findC(String companyName) throws Exception { |
| | | System.out.println(companyName); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("company", companyName); |
| | | Company company = (Company)((CompanyMapper)this.baseMapper).selectOne(queryWrapper); |
| | | System.out.println(company); |
| | | company.setAccount(DESUtil.decrypt(company.getAccount(), DESUtil.key)); |
| | | company.setAccountbank(DESUtil.decrypt(company.getAccountbank(), DESUtil.key)); |
| | | company.setAddress(DESUtil.decrypt(company.getAddress(), DESUtil.key)); |
| | | company.setShuinum(DESUtil.decrypt(company.getShuinum(), DESUtil.key)); |
| | | company.setPhone(DESUtil.decrypt(company.getPhone(), DESUtil.key)); |
| | | System.out.println(company); |
| | | return company; |
| | | } |
| | | |
| | | public int bcHxg(Company company) throws Exception { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("company", company.getCompany()); |
| | | company.setShuinum(DESUtil.encrypt(company.getShuinum(), DESUtil.key)); |
| | | company.setAddress(DESUtil.encrypt(company.getAddress(), DESUtil.key)); |
| | | company.setPhone(DESUtil.encrypt(company.getPhone(), DESUtil.key)); |
| | | company.setAccountbank(DESUtil.encrypt(company.getAccountbank(), DESUtil.key)); |
| | | company.setAccount(DESUtil.encrypt(company.getAccount(), DESUtil.key)); |
| | | company.setCompanyname(company.getCompanyname()); |
| | | return ((CompanyMapper)this.baseMapper).update(company, queryWrapper); |
| | | } |
| | | } |