| | |
| | | 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()); |
| | |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<Equipment> queryWrapper = QueryGenerator.initQueryWrapper(equipment, req.getParameterMap()); |
| | | //QueryWrapper<Equipment> queryWrapper = QueryGenerator.initQueryWrapper(equipment, req.getParameterMap()); |
| | | Page<Equipment> page = new Page<Equipment>(pageNo, pageSize); |
| | | IPage<Equipment> pageList = equipmentService.getEquipmentTZList(page, equipment); |
| | | List<Equipment> list = pageList.getRecords(); |
| | | list.forEach(equip -> { |
| | | String id = equip.getId(); |
| | | List<DailyInspectionStandard> dailyInspectionStandards = dailyInspectionStandardService.lambdaQuery() |
| | | .eq(DailyInspectionStandard::getEquipmentId, id) |
| | | .eq(DailyInspectionStandard::getVersionStatus, "2") |
| | | .list(); |
| | | if (dailyInspectionStandards.size() > 0) { |
| | | equip.setYseNoInspectionStandard("0"); |
| | | } else { |
| | | equip.setYseNoInspectionStandard("1"); |
| | | } |
| | | List<MaintenanceStandard> maintenance2Standards = maintenanceStandardService.lambdaQuery() |
| | | .eq(MaintenanceStandard::getEquipmentId, id) |
| | | .eq(MaintenanceStandard::getMaintenanceType, "2") |
| | | .eq(MaintenanceStandard::getVersionStatus, "2").list(); |
| | | if (maintenance2Standards.size() > 0) { |
| | | equip.setYseNoMaintenance2Standard("0"); |
| | | } else { |
| | | equip.setYseNoMaintenance2Standard("1"); |
| | | } |
| | | |
| | | List<MaintenanceStandard> maintenance3Standards = maintenanceStandardService.lambdaQuery() |
| | | .eq(MaintenanceStandard::getEquipmentId, id) |
| | | .eq(MaintenanceStandard::getMaintenanceType, "3") |
| | | .eq(MaintenanceStandard::getVersionStatus, "2").list(); |
| | | if (maintenance3Standards.size() > 0) { |
| | | equip.setYseNoMaintenance3Standard("0"); |
| | | } else { |
| | | equip.setYseNoMaintenance3Standard("1"); |
| | | } |
| | | }); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |