From 6dd22fcddcfee81404722690c0f3ff65b6f72eed Mon Sep 17 00:00:00 2001 From: gongbaoxiong <751575283@qq.com> Date: Tue, 4 Jun 2024 10:53:32 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E7=BB=99=E5=89=8D=E7=AB=AF=E7=9A=84?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/user/dto/OnlineUserDto.java | 5 +++ .../service/impl/EasOutInBillServiceImpl.java | 41 ++++++++++--------- .../org/nl/wms/schedule/EasBillSchedule.java | 22 +++++++++- 3 files changed, 48 insertions(+), 20 deletions(-) diff --git a/nlsso-server/src/main/java/org/nl/system/service/user/dto/OnlineUserDto.java b/nlsso-server/src/main/java/org/nl/system/service/user/dto/OnlineUserDto.java index 322f46f..3925cb5 100644 --- a/nlsso-server/src/main/java/org/nl/system/service/user/dto/OnlineUserDto.java +++ b/nlsso-server/src/main/java/org/nl/system/service/user/dto/OnlineUserDto.java @@ -41,6 +41,11 @@ public class OnlineUserDto { */ private String nickName; + /** + * 用户姓名 + */ + private String person_name; + /** * 岗位 */ diff --git a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java index 23e95c2..e60d7b8 100644 --- a/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java +++ b/nlsso-server/src/main/java/org/nl/wms/database/eas/service/impl/EasOutInBillServiceImpl.java @@ -86,19 +86,29 @@ public class EasOutInBillServiceImpl extends ServiceImpl getBillsCount() { - List allCounts =easOutInBillMapper.getBillsCount(); - HomeBillCounts allocations =new HomeBillCounts(); - Long allocation =allocationBillMapper.getAllocationCount(""); - allocations.setCounts(allocation.toString()); - allocations.setName(EasBillTypeEnum.DBQR.getName()); - allocations.setDjlx(EasBillTypeEnum.DBQR.getCode()); - allocations.setYwlx(EasBillTypeEnum.DB.getCode()); - HomeBillCounts receipts =new HomeBillCounts(); - Long receipt = receiptBillMapper.receiptCounts(); - receipts.setCounts(receipt.toString()); + Long receiptCount = 0L; + Long allocationCount = 0L; + List allCounts = easOutInBillMapper.getBillsCount(); + HomeBillCounts allocations = new HomeBillCounts(); + HomeBillCounts receipts = new HomeBillCounts(); receipts.setName(EasBillTypeEnum.SHDJ.getName()); receipts.setDjlx(EasBillTypeEnum.SHDJ.getCode()); receipts.setYwlx(EasBillTypeEnum.SH.getCode()); + allocations.setName(EasBillTypeEnum.DBQR.getName()); + allocations.setDjlx(EasBillTypeEnum.DBQR.getCode()); + allocations.setYwlx(EasBillTypeEnum.DB.getCode()); + receipts.setCounts(receiptCount.toString()); + allocations.setCounts(allocationCount.toString()); + try { + //receiptCount = receiptBillMapper.receiptCounts(); + //allocationCount = allocationBillMapper.getAllocationCount(""); + //receipts.setCounts(receiptCount.toString()); + //allocations.setCounts(allocationCount.toString()); + } catch (Exception e) { + allCounts.add(allocations); + allCounts.add(receipts); + return allCounts; + } allCounts.add(allocations); allCounts.add(receipts); return allCounts; @@ -159,10 +169,6 @@ public class EasOutInBillServiceImpl extends ServiceImpl existingUsers, List newUsers) { + Set ids = existingUsers.stream().map(SysUser::getUsername).collect(Collectors.toSet()); + // 过滤出需要插入的新用户,并设置默认属性 + List insertUsers = newUsers.stream() + .filter(user -> !ids.contains(user.getUsername())) + .peek(user -> { + user.setIs_used(true); // 设置默认启用 + user.setCreate_time(new Date()); // 设置创建时间 + }) + .collect(Collectors.toList()); + if (CollectionUtils.isNotEmpty(insertUsers)) { + // 批量插入新用户 + //this.saveBatch(insertUsers); + } + } /** * 定时清空单据 @@ -113,7 +133,7 @@ public class EasBillSchedule { SendHomeWebSocketServer.getWebSocketSet(); if (webSocketSet.size() > 0) { webSocketSet.forEach(c -> { - c.sendDataToClient(easOutInBillService.getBillsCount()); + // c.sendDataToClient(easOutInBillService.getBillsCount()); }); } //stopWatch.stop();