From eea27b448ec2d289f5c9665bf4b3678d580457ee Mon Sep 17 00:00:00 2001 From: Lius <Lius2225@163.com> Date: 星期二, 22 七月 2025 15:45:23 +0800 Subject: [PATCH] 三保变更基础代码,点检导出修改 --- lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java | 30 +++++++++++++++++++----------- 1 files changed, 19 insertions(+), 11 deletions(-) diff --git a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java index bd393ff..fb90334 100644 --- a/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java +++ b/lxzn-module-eam/src/main/java/org/jeecg/modules/eam/service/impl/EamInspectionOrderServiceImpl.java @@ -371,17 +371,19 @@ 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 // 淇濇寔鎻掑叆椤哄簭 )); @@ -442,12 +444,18 @@ 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++) { -- Gitblit v1.9.3