|
@@ -3,11 +3,14 @@ package com.example.demo.demos.web.service.impl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
|
+import com.example.demo.demos.web.constant.Constants;
|
|
|
import com.example.demo.demos.web.mapper.EcsInfoMapper;
|
|
import com.example.demo.demos.web.mapper.EcsInfoMapper;
|
|
|
import com.example.demo.demos.web.service.EcsInfoService;
|
|
import com.example.demo.demos.web.service.EcsInfoService;
|
|
|
import com.example.demo.demos.web.domain.EcsInfo;
|
|
import com.example.demo.demos.web.domain.EcsInfo;
|
|
|
import com.example.demo.demos.web.util.DateUtil;
|
|
import com.example.demo.demos.web.util.DateUtil;
|
|
|
|
|
+import com.example.demo.demos.web.util.SMSUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
@@ -15,12 +18,11 @@ import java.util.List;
|
|
|
|
|
|
|
|
@Service
|
|
@Service
|
|
|
public class EcsInfoServiceImpl extends ServiceImpl<EcsInfoMapper, EcsInfo> implements EcsInfoService {
|
|
public class EcsInfoServiceImpl extends ServiceImpl<EcsInfoMapper, EcsInfo> implements EcsInfoService {
|
|
|
-
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private EcsInfoMapper mapper;
|
|
private EcsInfoMapper mapper;
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public List<EcsInfo> getInfos() {
|
|
|
|
|
|
|
+ public void getInfos() {
|
|
|
LambdaQueryWrapper<EcsInfo> wrapper = Wrappers.lambdaQuery();
|
|
LambdaQueryWrapper<EcsInfo> wrapper = Wrappers.lambdaQuery();
|
|
|
List<EcsInfo> ecsInfos = mapper.selectList(wrapper);
|
|
List<EcsInfo> ecsInfos = mapper.selectList(wrapper);
|
|
|
|
|
|
|
@@ -37,6 +39,21 @@ public class EcsInfoServiceImpl extends ServiceImpl<EcsInfoMapper, EcsInfo> impl
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
- return list;
|
|
|
|
|
|
|
+ /*
|
|
|
|
|
+ 发送短信
|
|
|
|
|
+ */
|
|
|
|
|
+ if (!list.isEmpty()) {
|
|
|
|
|
+ for (String number : Constants.SEND_MSG_NUMBER) {
|
|
|
|
|
+ list.forEach(i -> {
|
|
|
|
|
+ String str = "{\"name\": \""+i.getSerialNumber()+"\"}";
|
|
|
|
|
+ try {
|
|
|
|
|
+ SMSUtil.sendMsg(number,"天目智能科技","SMS_475345133",str);
|
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
|
+ log.error("短信发送失败:{}",e);
|
|
|
|
|
+ throw new RuntimeException(e);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|