From 7d88ebd9cfb078e417a2c9b650ace77e63458070 Mon Sep 17 00:00:00 2001 From: WendyYang Date: Wed, 6 Mar 2024 17:44:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=AD=A6=E9=80=9A?= =?UTF-8?q?=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scheduler/task/EarlyWarningInstanceNotStartTask.java | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningInstanceNotStartTask.java b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningInstanceNotStartTask.java index 4c2d566..28dd9fc 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningInstanceNotStartTask.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/scheduler/task/EarlyWarningInstanceNotStartTask.java @@ -11,7 +11,7 @@ import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.hz.pm.api.common.enumeration.CommonEnum; import com.hz.pm.api.common.model.constant.BizConst; -import com.hz.pm.api.projectdeclared.model.entity.Contract; +import com.hz.pm.api.common.util.StrUtils; import com.hz.pm.api.projectdeclared.model.entity.Operation; import com.hz.pm.api.projectdeclared.service.IContractService; import com.hz.pm.api.projectdeclared.service.IOperationService; @@ -189,19 +189,16 @@ public class EarlyWarningInstanceNotStartTask { } for (Project needToWaringProject : needToWaringProjects) { - String username = null; - String mobile = null; + String username; + String mobile; //去预警通知人 1.项目联系人 2.项目负责人 如果都包含 都要发 List batchEmployees = Lists.newArrayList(); if (notice.contains(WarningNoticeTypeEnum.CONTACT.getCode().toString())) { String employeeCode = null; username = needToWaringProject.getContactName(); mobile = needToWaringProject.getContactPhone(); - if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(mobile)) { - UserInfo user = userInfoService.getOne(Wrappers.lambdaQuery(UserInfo.class) - .eq(UserInfo::getUsername, username) - .eq(UserInfo::getMobile, mobile) - .last(BizConst.LIMIT_1)); + if (StrUtils.isAllNotBlank(username, mobile)) { + UserInfo user = userInfoService.getByUserNameAndMobile(username, mobile); if (Objects.nonNull(user)) { employeeCode = user.getEmployeeCode(); } @@ -214,7 +211,7 @@ public class EarlyWarningInstanceNotStartTask { String employeeCode = null; username = needToWaringProject.getResponsibleMan(); mobile = needToWaringProject.getResponsibleManMobile(); - if (StringUtils.isNotBlank(username) && StringUtils.isNotBlank(mobile)) { + if (StrUtils.isAllNotBlank(username, mobile)) { UserInfo user = userInfoService.getByUserNameAndMobile(username, mobile); if (Objects.nonNull(user)) { employeeCode = user.getEmployeeCode();