From 4ed09be8e23b555ee43dfc471020cb4619da20a0 Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期一, 20 十月 2025 17:00:28 +0800
Subject: [PATCH] 月台自动叫号处理问题
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java | 107 ++++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 85 insertions(+), 22 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java
index 591a1b2..b8c1545 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/DeviceServiceImpl.java
@@ -1,37 +1,31 @@
package com.doumee.service.business.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
-import com.doumee.core.haikang.model.HKConstants;
-import com.doumee.core.haikang.model.param.BaseResponse;
-import com.doumee.core.haikang.model.param.request.AcsDeviceListRequest;
-import com.doumee.core.haikang.model.param.respose.AcsDeviceInfoResponse;
-import com.doumee.core.haikang.model.param.respose.AcsDeviceListResponse;
-import com.doumee.core.haikang.service.HKService;
-import com.doumee.core.model.PageData;
-import com.doumee.core.model.PageWrap;
+import com.doumee.core.haikang.model.param.request.TransparentChannelSingleRequest;
+import com.doumee.dao.business.*;
+import com.doumee.dao.business.model.*;
+import com.doumee.service.business.third.model.PageData;
+import com.doumee.service.business.third.model.PageWrap;
import com.doumee.core.utils.Constants;
import com.doumee.core.utils.Utils;
-import com.doumee.dao.business.DeviceMapper;
-import com.doumee.dao.business.model.Company;
-import com.doumee.dao.business.model.Device;
-import com.doumee.dao.business.model.Retention;
import com.doumee.service.business.DeviceService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.doumee.service.business.impl.hksync.HkSyncPushServiceImpl;
+import com.github.yulichang.wrapper.MPJLambdaWrapper;
+import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
+import java.util.stream.Collectors;
/**
* 璁惧淇℃伅琛⊿ervice瀹炵幇
@@ -39,10 +33,19 @@
* @date 2023/11/30 15:33
*/
@Service
+@Slf4j
public class DeviceServiceImpl implements DeviceService {
@Autowired
private DeviceMapper deviceMapper;
+ @Autowired
+ private PlatformMapper platformMapper;
+ @Autowired
+ private PlatformDeviceMapper platformDeviceMapper;
+ @Autowired
+ private SystemDictDataBiz systemDictDataBiz;
+ @Autowired
+ private PlatformBroadcastLogMapper platformBroadcastLogMapper;
@Override
@@ -106,11 +109,10 @@
public List<Device> findIdAndNameList(Device param) {
LambdaQueryWrapper<Device> wrapper = new LambdaQueryWrapper<>(param);
wrapper.select(Device::getId, Device::getName, Device::getDoorName,Device::getRegionPathName, Device::getRegionName);
- if(null != param.getType() && null != param.getIsdeleted() && null != param.getHkStatus()) {
- wrapper.eq(Device::getType,param.getType())
- .eq(Device::getIsdeleted,param.getIsdeleted())
- .eq(Device::getHkStatus,param.getHkStatus());
- }
+ wrapper.eq(null != param.getType(),Device::getType,param.getType())
+ .eq(null !=param.getIsdeleted(),Device::getIsdeleted,param.getIsdeleted())
+ .eq(Objects.isNull(param.getIsdeleted()),Device::getIsdeleted,Constants.ZERO)
+ .eq(null != param.getHkStatus(),Device::getHkStatus,param.getHkStatus());
return deviceMapper.selectList(wrapper);
}
@@ -118,6 +120,7 @@
public PageData<Device> findPage(PageWrap<Device> pageWrap) {
IPage<Device> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
QueryWrapper<Device> queryWrapper = new QueryWrapper<>();
+ pageWrap.getModel().setIsdeleted(Constants.ZERO);
Utils.MP.blankToNull(pageWrap.getModel());
if (pageWrap.getModel().getId() != null) {
queryWrapper.lambda().eq(Device::getId, pageWrap.getModel().getId());
@@ -228,4 +231,64 @@
return deviceMapper.selectCount(wrapper);
}
+ @Override
+ public void setLedContent(TransparentChannelSingleRequest model) {
+ Device device = findById(model.getDeviceId());
+ if(device == null
+ || Constants.equalsInteger(device.getIsdeleted(),Constants.ONE)
+ || !Constants.equalsInteger(device.getType(),Constants.TWO)){
+ throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ }
+ if(model.getSpeed()<=0){
+ int speed = 13;
+ try {
+ speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode());
+ }catch (Exception e){
+ }
+ model.setSpeed(speed);
+ }
+ PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(0,device.getNo(),device.getName(),model.getContent(),model.getSpeed(),1);
+ platformBroadcastLogMapper.insert(log);
+ if(log.getHkStatus() == null || !Constants.equalsInteger(log.getHkStatus(), Constants.TWO)){
+ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "瀵逛笉璧凤紝灞忓箷鍐呭璁剧疆澶辫触"+(log!=null?log.getHkInfo():""));
+ }
+ }
+ @Override
+ public void allLedDefualtContent() {
+ log.error( "灞忓箷鍐呭璁剧疆=======================寮�濮�========" );
+ int speed = 13;
+ try {
+ speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode());
+ }catch (Exception e){
+ }
+ //鎵�鏈夋湀鍙板叧鑱旇澶囦俊鎭�
+ List<PlatformDevice> list = platformDeviceMapper.selectList(new MPJLambdaWrapper<PlatformDevice>().
+ selectAll(PlatformDevice.class)
+ .selectAs(Platform::getLedContent,PlatformDevice::getLedContent)
+ .leftJoin(Platform.class,Platform::getId,PlatformDevice::getPlatformId)
+ .eq(PlatformDevice::getType,Constants.ZERO)
+ .eq(PlatformDevice::getIsdeleted,Constants.ZERO)
+ .eq(Platform::getIsdeleted,Constants.ZERO)
+ );
+ if(list==null || list.size()==0){
+ return;
+ }
+ for(PlatformDevice device :list){
+ try {
+ String content = device.getLedContent();
+ if(StringUtils.isBlank(content)){
+ continue;
+ }
+ PlatformBroadcastLog log1 = HkSyncPushServiceImpl.dealLedContentBiz(0,device.getHkNo(),device.getName(),content,speed,1);
+ platformBroadcastLogMapper.insert(log1);
+ if(log1.getHkStatus() == null || !Constants.equalsInteger(log1.getHkStatus(), Constants.TWO)){
+ log.error( "瀵逛笉璧凤紝灞忓箷鍐呭璁剧疆澶辫触"+(log1!=null?log1.getHkInfo():""));
+ }
+ }catch (Exception e){
+ log.error( "瀵逛笉璧凤紝灞忓箷鍐呭璁剧疆寮傚父"+ device.getName());
+ }
+
+ }
+ log.error( "灞忓箷鍐呭璁剧疆=======================缁撴潫========" );
+ }
}
--
Gitblit v1.9.3