| | |
| | | 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(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value="mom_eam_equipment-分页列表查询", notes="mom_eam_equipment-分页列表查询") |
| | | @GetMapping(value = "/showEquipmentList") |
| | | public Result<IPage<Equipment>> showEquipmentList(Equipment equipment, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<Equipment> queryWrapper = new QueryWrapper<>(); |
| | | if(StringUtils.isNotBlank(equipment.getNum())){ |
| | | queryWrapper.like("num",equipment.getNum()); |
| | | } |
| | | if(StringUtils.isNotBlank(equipment.getName())){ |
| | | queryWrapper.like("name",equipment.getName()); |
| | | } |
| | | queryWrapper.eq("equipment_status","1"); |
| | | queryWrapper.in("technology_status","qualified","limitedUse"); |
| | | queryWrapper.eq("status","1"); |
| | | queryWrapper.eq("del_flag",0); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | |
| | | Page<Equipment> page = new Page<Equipment>(pageNo, pageSize); |
| | | IPage<Equipment> pageList = equipmentService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value="mom_eam_equipment-分页列表查询", notes="mom_eam_equipment-分页列表查询") |
| | | @GetMapping(value = "/findEquipmentList") |
| | | public Result<IPage<Equipment>> findEquipmentList(Equipment equipment, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<Equipment> queryWrapper = new QueryWrapper<>(); |
| | | if(StringUtils.isNotBlank(equipment.getNum())){ |
| | | queryWrapper.like("num",equipment.getNum()); |
| | | } |
| | | if(StringUtils.isNotBlank(equipment.getName())){ |
| | | queryWrapper.like("name",equipment.getName()); |
| | | } |
| | | queryWrapper.eq("equipment_status","1"); |
| | | queryWrapper.in("technology_status","qualified","limitedUse"); |
| | | queryWrapper.in("equipment_importance_id","A","B","C"); |
| | | queryWrapper.eq("status","1"); |
| | | queryWrapper.eq("del_flag",0); |
| | | queryWrapper.orderByDesc("create_time"); |
| | | |
| | | Page<Equipment> page = new Page<Equipment>(pageNo, pageSize); |
| | | IPage<Equipment> pageList = equipmentService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | |
| | | /** |
| | |
| | | equipmentService.updateBatchById(equipmentList); |
| | | return Result.OK("编辑成功"); |
| | | } |
| | | @PostMapping("/updateKeyEquipment") |
| | | public Result<?>updateKeyEquipment(@RequestBody Equipment equipment){ |
| | | equipmentService.update(new UpdateWrapper<Equipment>().eq("specific_equipment","0").set("specific_equipment",null)); |
| | | List<Equipment> keyEquipmentUpdateList = equipment.getKeyEquipmentUpdateList(); |
| | | for(Equipment updateEquipment:keyEquipmentUpdateList){ |
| | | updateEquipment.setId(updateEquipment.getEquipmentId()); |
| | | equipmentService.updateById(updateEquipment); |
| | | } |
| | | 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); |
| | | } |
| | | |
| | | } |