对比新文件 |
| | |
| | | package com.gk.firework.Service.ServiceImpl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.gk.firework.Domain.StandardDeviceToolsLeger; |
| | | import com.gk.firework.Domain.StandardGuardRoll; |
| | | import com.gk.firework.Domain.UserInfo; |
| | | import com.gk.firework.Mapper.StandDeviceToolsLegerMapper; |
| | | import com.gk.firework.Service.StandardDeviceToolsLegerService; |
| | | import com.gk.firework.Service.UserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | import java.util.List; |
| | | |
| | | @Service("standardDeviceToolsLegerService") |
| | | public class StandardDeviceToolsLegerServiceImpl extends ServiceImpl<StandDeviceToolsLegerMapper, StandardDeviceToolsLeger> implements StandardDeviceToolsLegerService { |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | @Autowired |
| | | private StandDeviceToolsLegerMapper standDeviceToolsLegerMapper; |
| | | |
| | | @Override |
| | | public IPage selectPage(Page<StandardDeviceToolsLeger> page, Map filter, UserInfo userInfo) { |
| | | UserInfo user = userService.getById(userInfo.getId()); |
| | | Map<String, Object> params = new HashMap<>(); |
| | | //菜单 |
| | | //可视权限 |
| | | { |
| | | params.put("enterprisenumber", user.getCompanynumber()); |
| | | params.put("province", user.getProvince()); |
| | | params.put("city", user.getCity()); |
| | | params.put("district", user.getArea()); |
| | | params.put("street", user.getTown()); |
| | | params.put("committee", user.getCommunity()); |
| | | } |
| | | |
| | | params.put("filterProvince", filter.get("province")); |
| | | params.put("filterCity", filter.get("city")); |
| | | params.put("filterDistrict", filter.get("district")); |
| | | params.put("filterStreet", filter.get("street")); |
| | | params.put("filterCommittee", filter.get("committee")); |
| | | params.put("safetysupervision", filter.get("safetysupervision")); |
| | | params.put("enterprisename", filter.get("enterprisename")); |
| | | List<StandardDeviceToolsLeger> list = standDeviceToolsLegerMapper.selectPages(page, params); |
| | | |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | @Override |
| | | public void addDeviceToolsLeger(StandardDeviceToolsLeger standardDeviceToolsLeger, UserInfo userInfo) { |
| | | |
| | | UserInfo user = userService.getById(userInfo.getId()); |
| | | standardDeviceToolsLeger.setCreateby(user.getId()); |
| | | standardDeviceToolsLeger.setCreatebyname(user.getUsername()); |
| | | standardDeviceToolsLeger.setCreatetime(new Date()); |
| | | standardDeviceToolsLeger.setValidflag(true); |
| | | standardDeviceToolsLeger.setEnterprisenumber(user.getUsername()); |
| | | standardDeviceToolsLeger.setEnterprisename(user.getUsername()); |
| | | this.save(standardDeviceToolsLeger); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | public void modDeviceToolsLeger(StandardDeviceToolsLeger standardDeviceToolsLeger, UserInfo user) { |
| | | standardDeviceToolsLeger.setUpdatebyname(user.getUsername()); |
| | | standardDeviceToolsLeger.setUpdatetime(new Date()); |
| | | standardDeviceToolsLeger.setUpdateby(user.getId()); |
| | | this.updateById(standardDeviceToolsLeger); |
| | | } |
| | | |
| | | @Override |
| | | public void delDeviceToolsLeger(Long id, UserInfo user) { |
| | | LambdaUpdateWrapper<StandardDeviceToolsLeger> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.set(StandardDeviceToolsLeger::getValidflag, false) |
| | | .set(StandardDeviceToolsLeger::getUpdatetime, new Date()) |
| | | .set(StandardDeviceToolsLeger::getUpdateby, user.getId()) |
| | | .set(StandardDeviceToolsLeger::getUpdatebyname,user.getUsername()) |
| | | .eq(StandardDeviceToolsLeger::getId, id); |
| | | this.update(updateWrapper); |
| | | |
| | | } |
| | | |
| | | |
| | | } |