|
|
|
@ -26,10 +26,7 @@ import org.springframework.transaction.annotation.Transactional; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.*; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
import static org.springblade.common.constant.CommonConstant.*; |
|
|
|
import static org.springblade.common.constant.CommonConstant.*; |
|
|
|
@ -291,7 +288,18 @@ public class MaintenancePlanServiceImpl extends BaseServiceImpl<MaintenancePlanM |
|
|
|
List<User> maintenanceSupervisorList = userService.list(Wrappers.lambdaQuery(User.class).eq(User::getRoleId, roleId)); |
|
|
|
List<User> maintenanceSupervisorList = userService.list(Wrappers.lambdaQuery(User.class).eq(User::getRoleId, roleId)); |
|
|
|
try { |
|
|
|
try { |
|
|
|
for (User maintenanceSupervisor : maintenanceSupervisorList) { |
|
|
|
for (User maintenanceSupervisor : maintenanceSupervisorList) { |
|
|
|
smsService.sendSms(maintenanceSupervisor.getPhone(), maintenanceSupervisor.getRealName()); |
|
|
|
Optional<String> phone = Optional.ofNullable(maintenanceSupervisor.getPhone()); |
|
|
|
|
|
|
|
if (phone.isEmpty()) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
//TODO 当手机号为空时需要处理的逻辑
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Optional<String> realName = Optional.ofNullable(maintenanceSupervisor.getRealName()); |
|
|
|
|
|
|
|
//TODO 当真实姓名为空时需要处理的逻辑
|
|
|
|
|
|
|
|
if (realName.isEmpty()) { |
|
|
|
|
|
|
|
smsService.sendSms(phone.get(), "未实名"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
smsService.sendSms(phone.get(), realName.get()); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
} catch (Exception e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
throw new RuntimeException(e); |
|
|
|
|