| | |
| | | import org.jeecg.modules.base.service.IFactoryModelService; |
| | | import org.jeecg.modules.eam.entity.*; |
| | | import org.jeecg.modules.eam.model.DepartVo; |
| | | import org.jeecg.modules.eam.model.MaintenanceCycleVo; |
| | | import org.jeecg.modules.eam.service.*; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | |
| | | @Autowired |
| | | private IAreaService areaService; |
| | | |
| | | @Autowired |
| | | private IDailyInspectionStandardService dailyInspectionStandardService; |
| | | |
| | | @Autowired |
| | | private IMaintenanceStandardService maintenanceStandardService; |
| | | |
| | | |
| | | |
| | |
| | | return Result.OK("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | *设备台站-保养标准 |
| | | */ |
| | | @GetMapping("getEquipmentListAllStandard") |
| | | public Result<?> getEquipmentListAllStandard(@RequestParam("pageNo") Integer pageNo, @RequestParam("pageSize") Integer pageSize, @RequestParam Map<String, Object> params) { |
| | | IPage<Map<String, Object>> equipmentListAllStandards = equipmentService.getEquipmentListAllStandard(pageNo, pageSize, params); |
| | | List<Map<String, Object>> records = equipmentListAllStandards.getRecords(); |
| | | for (Map<String, Object> record : records) { |
| | | String id = (String) record.get("id"); |
| | | String precisionParameters = (String)record.get("precisionParameters"); |
| | | if("1".equals(precisionParameters)){ |
| | | record.put("yseNoPrecisionParameters","0"); |
| | | }else{ |
| | | record.put("yseNoPrecisionParameters","1"); |
| | | } |
| | | List<DailyInspectionStandard> dailyInspectionStandards = dailyInspectionStandardService.lambdaQuery() |
| | | .eq(DailyInspectionStandard::getEquipmentId, id) |
| | | .eq(DailyInspectionStandard::getVersionStatus, "2") |
| | | .list(); |
| | | if(dailyInspectionStandards.size()>0){ |
| | | record.put("yseNoInspectionStandard","0"); |
| | | }else{ |
| | | record.put("yseNoInspectionStandard","1"); |
| | | } |
| | | List<MaintenanceStandard> maintenance2Standards = maintenanceStandardService.lambdaQuery() |
| | | .eq(MaintenanceStandard::getEquipmentId, id) |
| | | .eq(MaintenanceStandard::getMaintenanceType, "2") |
| | | .eq(MaintenanceStandard::getVersionStatus, "2").list(); |
| | | if(maintenance2Standards.size()>0){ |
| | | record.put("yseNoMaintenance2Standard","0"); |
| | | }else{ |
| | | record.put("yseNoMaintenance2Standard","1"); |
| | | } |
| | | |
| | | List<MaintenanceStandard> maintenance3Standards = maintenanceStandardService.lambdaQuery() |
| | | .eq(MaintenanceStandard::getEquipmentId, id) |
| | | .eq(MaintenanceStandard::getMaintenanceType, "3") |
| | | .eq(MaintenanceStandard::getVersionStatus, "2").list(); |
| | | if(maintenance3Standards.size()>0){ |
| | | record.put("yseNoMaintenance3Standard","0"); |
| | | }else{ |
| | | record.put("yseNoMaintenance3Standard","1"); |
| | | } |
| | | |
| | | } |
| | | return Result.ok(equipmentListAllStandards); |
| | | } |
| | | @GetMapping(value = "/planEquipmentList") |
| | | @PermissionData |
| | | public Result<IPage<Equipment>> planEquipmentList(Equipment equipment, |
| | | @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.orderByAsc("next_third_maintenance_time"); |
| | | //如果startTime和endTime不为空,则查询下次三保时间在这个时间段内的设备 |
| | | if(equipment.getStartTime()!=null && equipment.getEndTime()!=null){ |
| | | queryWrapper.between("next_third_maintenance_time",equipment.getStartTime(),equipment.getEndTime()); |
| | | } |
| | | Page<Equipment> page = new Page<Equipment>(pageNo, pageSize); |
| | | IPage<Equipment> pageList = equipmentService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | } |