对比新文件 |
| | |
| | | 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.StandardGuardRoll; |
| | | import com.gk.firework.Domain.UserInfo; |
| | | import com.gk.firework.Mapper.StandardGuardRollMapper; |
| | | import com.gk.firework.Service.StandardGuardRollService; |
| | | 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("standardGuardRollService") |
| | | public class StandardGuardRollServiceImpl extends ServiceImpl<StandardGuardRollMapper, StandardGuardRoll> implements StandardGuardRollService { |
| | | |
| | | @Autowired |
| | | private UserService userService; |
| | | @Autowired |
| | | private StandardGuardRollMapper standardGuardRollMapper; |
| | | |
| | | |
| | | @Override |
| | | public IPage selectPage(Page<StandardGuardRoll> 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<StandardGuardRoll> list = standardGuardRollMapper.selectPages(page,params); |
| | | return page.setRecords(list); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void addStandardGuardRoll(StandardGuardRoll standardGuardRoll, UserInfo userInfo) { |
| | | |
| | | UserInfo user = userService.getById(userInfo.getId()); |
| | | standardGuardRoll.setCreateby(user.getId()); |
| | | standardGuardRoll.setCreatebyname(user.getUsername()); |
| | | standardGuardRoll.setCreatetime(new Date()); |
| | | standardGuardRoll.setValidflag(true); |
| | | standardGuardRoll.setEnterprisenumber(user.getUsername()); |
| | | standardGuardRoll.setEnterprisename(user.getUsername()); |
| | | |
| | | this.save(standardGuardRoll); |
| | | } |
| | | |
| | | @Override |
| | | public void modStandardGuardRoll(StandardGuardRoll standardGuardRoll, UserInfo user) { |
| | | standardGuardRoll.setUpdatebyname(user.getUsername()); |
| | | standardGuardRoll.setUpdatetime(new Date()); |
| | | standardGuardRoll.setUpdateby(user.getId()); |
| | | this.updateById(standardGuardRoll); |
| | | } |
| | | |
| | | @Override |
| | | public void delStandardGuardRoll(Long id, UserInfo user) { |
| | | LambdaUpdateWrapper<StandardGuardRoll> updateWrapper = new LambdaUpdateWrapper<>(); |
| | | updateWrapper.set(StandardGuardRoll::getValidflag, false) |
| | | .set(StandardGuardRoll::getUpdatetime, new Date()) |
| | | .set(StandardGuardRoll::getUpdateby, user.getId()) |
| | | .set(StandardGuardRoll::getUpdatebyname,user.getUsername()) |
| | | .eq(StandardGuardRoll::getId, id); |
| | | this.update(updateWrapper); |
| | | } |
| | | |
| | | |
| | | } |