| | |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | |
| | | import org.jeecg.modules.system.entity.SysDepart; |
| | | import org.jeecg.modules.system.entity.SysUser; |
| | | import org.jeecg.modules.system.service.ISysDepartService; |
| | | import org.jeecg.modules.system.service.ISysUserService; |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | |
| | | @Autowired |
| | | private IMaintenanceStandardService maintenanceStandardService; |
| | | |
| | | |
| | | @Autowired |
| | | private ISysUserService sysUserService; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | if(StringUtils.isNotBlank(equipment.getEquipmentCategoryId())){ |
| | | queryWrapper.eq("equipment_category_id",equipment.getEquipmentCategoryId()); |
| | | } |
| | | List<String> userWorkCenterIds = getUserWorkCenterIds(); |
| | | if(CollectionUtils.isNotEmpty(userWorkCenterIds)) { |
| | | queryWrapper.in("work_center_id",userWorkCenterIds); |
| | | } |
| | | if(StringUtils.isNotBlank(equipment.getWorkCenterId())){ |
| | | queryWrapper.eq("work_center_id",equipment.getWorkCenterId()); |
| | |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | private List<String> getUserWorkCenterIds(){ |
| | | LoginUser user= (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | SysUser sysUser = sysUserService.getById(user.getId()); |
| | | String areaId = sysUser.getAreaId(); |
| | | List<String> workCenterIds = null; |
| | | if(StringUtils.isNotBlank(areaId)){ |
| | | // strings = new ArrayList<>(); |
| | | String[] split = areaId.split(","); |
| | | workCenterIds = Arrays.asList(split); |
| | | } |
| | | return workCenterIds; |
| | | } |
| | | |
| | | } |