| | |
| | | LoginUser user = (LoginUser) SecurityUtils.getSubject().getPrincipal(); |
| | | Integer userType = user.getUserType(); |
| | | List<Map<String, Object>> list = calibrationOrderService.getAreaEquipmentList(equipmentNum,"",null); |
| | | for (Map<String, Object> map : list) { |
| | | String equipmentId = (String)map.get("id"); |
| | | List<Map<String, Object>> counts = calibrationOrderService.getEquipmentReportRepairCount(equipmentId); |
| | | if(counts.size()>0){ |
| | | map.put("repairCount",counts.get(0).get("repairCount")); |
| | | }else{ |
| | | map.put("repairCount","0"); |
| | | } |
| | | } |
| | | return Result.ok(list); |
| | | } |
| | | |
| | |
| | | Area area = areaService.getOne(new LambdaQueryWrapper<Area>().eq(Area::getNum, productionCode).eq(Area::getType, "3").eq(Area::getDelFlag, 0)); |
| | | if(area != null){ |
| | | list = calibrationOrderService.getAreaEquipmentList("",area.getId(),null); |
| | | for (Map<String, Object> map : list) { |
| | | String equipmentId = (String)map.get("id"); |
| | | List<Map<String, Object>> counts = calibrationOrderService.getEquipmentReportRepairCount(equipmentId); |
| | | if(counts.size()>0){ |
| | | map.put("repairCount",counts.get(0).get("repairCount")); |
| | | }else{ |
| | | map.put("repairCount","0"); |
| | | } |
| | | } |
| | | } |
| | | }else{ |
| | | List<Map<String, Object>> operationCertificatelist = calibrationOrderService.getOperationCertificate(user.getUsername()); |
| | |
| | | String equipmentIds = (String)operationCertificatelist.get(0).get("equipmentIds"); |
| | | List<String> strings = Arrays.asList(equipmentIds.split(",")); |
| | | list = calibrationOrderService.getAreaEquipmentList("","",strings); |
| | | for (Map<String, Object> map : list) { |
| | | String equipmentId = (String)map.get("id"); |
| | | List<Map<String, Object>> counts = calibrationOrderService.getEquipmentReportRepairCount(equipmentId); |
| | | if(counts.size()>0){ |
| | | map.put("repairCount",counts.get(0).get("repairCount")); |
| | | }else{ |
| | | map.put("repairCount","0"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return Result.ok(list); |