|
|
@@ -11,6 +11,7 @@ import com.nb.common.notice.msg.DeviceMsg;
|
|
|
import com.nb.common.notice.wechat.EnterpriseWeChatNotify;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
|
|
|
+import org.springframework.scheduling.annotation.Scheduled;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.List;
|
|
|
@@ -31,6 +32,14 @@ public class DeviceFlowStatsJob {
|
|
|
private final LocalBusHospitalLogService hospitalLogService;
|
|
|
private final EnterpriseWeChatNotify enterpriseWeChatNotify;
|
|
|
|
|
|
+ /**
|
|
|
+ * 描述: 每天早上9点定时发送
|
|
|
+ * @author lifang
|
|
|
+ * @date 2022/7/29 9:03
|
|
|
+ * @param
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ @Scheduled(cron = "0 0 9 * * ?")
|
|
|
public void flowStats(){
|
|
|
DateTime yesterday = DateUtil.yesterday();
|
|
|
DateTime startTime = DateUtil.beginOfDay(yesterday);
|
|
|
@@ -41,6 +50,13 @@ public class DeviceFlowStatsJob {
|
|
|
.eq(BusHospitalLogEntity::getType, HospitalLogEnum.ALI_DATA_UPLOAD)
|
|
|
.lt(BusHospitalLogEntity::getCreateTime, endTime)
|
|
|
.gt(BusHospitalLogEntity::getCreateTime, startTime));
|
|
|
+
|
|
|
+ hospitalLogService.list(new QueryWrapper<BusHospitalLogEntity>()
|
|
|
+ .lambda()
|
|
|
+ .select(BusHospitalLogEntity::getIdentityCode, BusHospitalLogEntity::isSuccess)
|
|
|
+ .eq(BusHospitalLogEntity::getType, HospitalLogEnum.ALI_DATA_UPLOAD)
|
|
|
+ .lt(BusHospitalLogEntity::getCreateTime, endTime)
|
|
|
+ .gt(BusHospitalLogEntity::getCreateTime, startTime));
|
|
|
Set<String> deviceIds = deviceLogs.parallelStream().map(BusHospitalLogEntity::getIdentityCode).collect(Collectors.toSet());
|
|
|
int deviceCount= CollectionUtil.size(deviceIds);
|
|
|
int msgCount=CollectionUtil.size(deviceLogs);
|