¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.DuanxinlogMapper; |
| | | import com.flow.mapper.ManagerMapper; |
| | | import com.flow.mapper.TbFuwuqiMapper; |
| | | import com.flow.pojo.*; |
| | | import com.flow.service.DuanxinlogService; |
| | | import com.flow.service.ManagerService; |
| | | import com.flow.service.OperationLogService; |
| | | import com.github.pagehelper.PageHelper; |
| | | import com.github.pagehelper.PageInfo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Service |
| | | public class ManagerServiceImpl extends ServiceImpl<ManagerMapper, Manager> implements ManagerService { |
| | | |
| | | @Autowired |
| | | ManagerMapper managerMapper; |
| | | |
| | | @Autowired |
| | | OperationLogService operationLogService; |
| | | @Override |
| | | public PageInfo<Manager> FindManager(Integer page, Integer limit) { |
| | | PageHelper.startPage(page, limit); |
| | | List<Manager> cardList = this.managerMapper.FindManager(); |
| | | PageInfo<Manager> info = new PageInfo(cardList); |
| | | return info; |
| | | } |
| | | |
| | | public int addManager(Manager manager) { |
| | | // Manager manager = (Manager)((ManagerMapper)this.baseMapper).selectOne(queryWrapper); |
| | | OperationLog operationLog = new OperationLog(); |
| | | operationLog.setCaozuotype("æ°å¢"); |
| | | operationLog.setCaozuocontent("æ°å¢ç¨æ·ï¼"+manager.getName()); |
| | | operationLog.setCaozuoname(manager.getCaozuoname()); |
| | | |
| | | operationLogService.addOperationLog(operationLog); |
| | | |
| | | Date date = new Date(); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | manager.setAddtime(formatter.format(date)); |
| | | return ((ManagerMapper) this.baseMapper).insert(manager); |
| | | } |
| | | |
| | | public int UpdateManager(Manager tbFuwuqi) { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("id", tbFuwuqi.getId()); |
| | | Manager manager = (Manager)((ManagerMapper)this.baseMapper).selectOne(queryWrapper); |
| | | OperationLog operationLog = new OperationLog(); |
| | | operationLog.setCaozuotype("ä¿®æ¹"); |
| | | operationLog.setCaozuocontent("ä¿®æ¹ç¨æ·ï¼"+manager.getName()); |
| | | operationLog.setCaozuoname(manager.getCaozuoname()); |
| | | |
| | | operationLogService.addOperationLog(operationLog); |
| | | Date date = new Date(); |
| | | SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | tbFuwuqi.setAddtime(formatter.format(date)); |
| | | return ((ManagerMapper) this.baseMapper).update(tbFuwuqi, queryWrapper); |
| | | } |
| | | |
| | | public int DeleteManager(String id,String caozuoname) { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("id", id); |
| | | Manager tbFuwuqi = new Manager(); |
| | | tbFuwuqi.setNone("1"); |
| | | Manager manager = (Manager)((ManagerMapper)this.baseMapper).selectOne(queryWrapper); |
| | | OperationLog operationLog = new OperationLog(); |
| | | operationLog.setCaozuotype("å é¤"); |
| | | operationLog.setCaozuocontent("å é¤ç¨æ·ï¼"+manager.getName()); |
| | | operationLog.setCaozuoname(caozuoname); |
| | | |
| | | operationLogService.addOperationLog(operationLog); |
| | | return ((ManagerMapper) this.baseMapper).deleteById(id); |
| | | } |
| | | |
| | | |
| | | public PageInfo<Manager> tableSearch(Manager manager, int page, int limit) throws Exception { |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | PageHelper.startPage(page, limit); |
| | | PageInfo<Manager> info = null; |
| | | queryWrapper.like("name", manager.getName()); |
| | | queryWrapper.eq("none", 0); |
| | | info = new PageInfo(((ManagerMapper) this.baseMapper).selectList(queryWrapper)); |
| | | // if (tbFuwuqi.getCompany() != "") { |
| | | // if (tbFuwuqi.getCompany().equals("åææºæ§")) { |
| | | // info = new PageInfo(this.tbFuwuqiMapper.FindSearch(tbFuwuqi.getCompany(),tbFuwuqi.getServername())); |
| | | // } else { |
| | | // queryWrapper.like("company", tbFuwuqi.getCompany()); |
| | | // queryWrapper.eq("none", 0); |
| | | // info = new PageInfo(((TbFuwuqiMapper) this.baseMapper).selectList(queryWrapper)); |
| | | // } |
| | | // } else { |
| | | // queryWrapper.eq("company", tbFuwuqi.getCompany()); |
| | | // queryWrapper.eq("none", 0); |
| | | // info = new PageInfo(((TbFuwuqiMapper) this.baseMapper).selectList(queryWrapper)); |
| | | // } |
| | | |
| | | return info; |
| | | } |
| | | |
| | | |
| | | public List<Manager> ifManager(Manager manager) { |
| | | // PageHelper.startPage(manager); |
| | | // Manager cardList = this.managerMapper.ifManager(); |
| | | // Manager info = new cardList; |
| | | return this.managerMapper.ifManager(manager.getName(),manager.getJuese()); |
| | | } |
| | | } |