| | |
| | | resultMap.put("itemCode", weekInsDetailResultResponse.getItemCode()); |
| | | resultMap.put("itemName", weekInsDetailResultResponse.getItemName()); |
| | | resultMap.put("itemDemand", weekInsDetailResultResponse.getItemDemand()); |
| | | // 使用AtomicInteger作为计数器,从1开始 |
| | | AtomicInteger counter = new AtomicInteger(1); |
| | | Map<Integer, EamWeekInsDetailResultResponse> collect = weekInsDetailResultResponseList |
| | | .stream() |
| | | .collect(Collectors.toMap( |
| | | // 分组键:使用自增序号(从1开始) |
| | | item -> counter.getAndIncrement(), |
| | | // 分组键:使用planInspectionDate字段落在本月的周数 |
| | | item -> { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(item.getPlanInspectionDate()); |
| | | return calendar.get(Calendar.WEEK_OF_MONTH); |
| | | }, |
| | | // 值:直接使用当前对象 |
| | | item -> item, |
| | | // 合并函数:当同一序号有多个对象时(理论上不会发生),如何处理 |
| | | (existing, replacement) -> existing, // 若有重复键,保留已存在的对象 |
| | | // 合并函数:当同一周有多个对象时(根据需求不会发生,但仍需提供) |
| | | (existing, replacement) -> existing, |
| | | // 指定Map的具体实现(可选) |
| | | LinkedHashMap::new // 保持插入顺序 |
| | | )); |
| | |
| | | Map<Integer, EamWeekInsDetailUserResponse> groupMap = eamWeekInsDetailUserResponseList |
| | | .stream() |
| | | .collect(Collectors.toMap( |
| | | // 分组键:使用自增序号(从1开始) |
| | | item -> counter.getAndIncrement(), |
| | | // 值:直接使用当前对象(作为初始值) |
| | | // 分组键:使用 planInspectionDate 字段落在本月的周数 |
| | | item -> { |
| | | Calendar calendar = Calendar.getInstance(); |
| | | calendar.setTime(item.getPlanInspectionDate()); |
| | | return calendar.get(Calendar.WEEK_OF_MONTH); |
| | | }, |
| | | // 值:直接使用当前对象 |
| | | item -> item, |
| | | // 合并函数:当同一“天”有多个对象时,如何处理(这里示例取第一个) |
| | | (existing, replacement) -> existing // 若有重复键,保留已存在的对象 |
| | | // 合并函数:当同一周有多个对象时(根据需求不会发生) |
| | | (existing, replacement) -> existing, |
| | | // 使用 LinkedHashMap 保持插入顺序 |
| | | LinkedHashMap::new |
| | | )); |
| | | Map<String, Object> resultMap = new LinkedHashMap<>(); |
| | | for (int i = 1; i <= 5; i++) { |
| | |
| | | } else { |
| | | eamInspectionOrder.setEquipmentId(equipment.getId()); |
| | | } |
| | | flowCommonService.initActBusiness("工单号: " + eamInspectionOrder.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode() + (equipment.getInstallationPosition() == null ? "" : ";安装位置: " + equipment.getInstallationPosition()), |
| | | flowCommonService.initActBusiness("工单号: " + eamInspectionOrder.getOrderNum() + ";设备编号: " + equipment.getEquipmentCode(), |
| | | eamInspectionOrder.getId(), "IEamInspectionOrderService", "eam_inspection", null); |
| | | Map<String, Object> variables = new HashMap<>(); |
| | | variables.put("dataId", eamInspectionOrder.getId()); |
| | |
| | | updateEamInspectionOrder(eamInspectionOrder); |
| | | |
| | | //查询数据,进行设备维修处理 |
| | | if (eamInspectionOrder.getInspectionStatus().equals(InspectionStatus.WAIT_CONFIRM.name())) { |
| | | updateEamInspectionOrderDetail(eamInspectionOrder); |
| | | } |
| | | // if (eamInspectionOrder.getInspectionStatus().equals(InspectionStatus.WAIT_CONFIRM.name())) { |
| | | // updateEamInspectionOrderDetail(eamInspectionOrder); |
| | | // } |
| | | |
| | | return eamInspectionOrder; |
| | | } catch (Exception e) { |
| | |
| | | values.put("organization", request.getConfirmComment()); |
| | | values.put("comment", request.getConfirmComment()); |
| | | values.put("confirmation", request.getConfirmDealType()); |
| | | request.setComment(request.getConfirmComment()); |
| | | request.setComment("维修工确认结束"); |
| | | if ("2".equals(request.getConfirmDealType())) { |
| | | // 维修工驳回 |
| | | List<String> usernames = new ArrayList<>(); |
| | | usernames.add(order.getOperator()); |
| | | order.setInspectionStatus(InspectionStatus.UNDER_INSPECTION.name()); |
| | | values.put("NextAssignee", usernames); |
| | | request.setComment("维修工驳回结束"); |
| | | } |
| | | } |
| | | request.setValues(values); |