From ea9c48535dcbc143d4938d2bfa8d206726c9b461 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 11 十月 2024 15:16:59 +0800
Subject: [PATCH] 最新版本
---
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java | 293 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 162 insertions(+), 131 deletions(-)
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
index f7e8781..d9cf7a7 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -5,8 +5,6 @@
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.config.DataSyncConfig;
-import com.doumee.config.SpringContextUtil;
-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.*;
@@ -22,21 +20,14 @@
import com.doumee.dao.business.*;
import com.doumee.dao.business.join.VisitsJoinMapper;
import com.doumee.dao.business.model.*;
-import com.doumee.dao.system.model.SystemUser;
import com.doumee.dao.web.reqeust.SavePlatformWarnEventDTO;
-import com.doumee.service.business.DeviceEventService;
-import com.doumee.service.business.InterfaceLogService;
-import com.doumee.service.business.MemberService;
import com.doumee.service.business.impl.PlatformWarnEventServiceImpl;
-import com.github.yulichang.interfaces.MPJBaseJoin;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
-import com.hikvision.artemis.sdk.config.ArtemisConfig;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-import org.yaml.snakeyaml.scanner.Constant;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
@@ -135,7 +126,7 @@
//鍐嶆彃鍏ユ渶鏂扮殑鍦ㄥ巶浜哄憳
retentionMapper.insert(retentionList);
}
- log.error("銆愭捣搴烽棬绂佷簨浠舵帹閫併��========鎴愬姛=======");
+ log.info("銆愭捣搴烽棬绂佷簨浠舵帹閫併��========鎴愬姛=======");
}catch (Exception e) {
log.error("銆愭捣搴烽棬绂佷簨浠舵帹閫併��========澶辫触=======锛歕n" + e.getMessage());
}finally {
@@ -325,7 +316,7 @@
//鍐嶆彃鍏ユ渶鏂扮殑鍦ㄥ巶浜哄憳
retentionMapper.insert(retentionList);
}
- log.error("銆愭捣搴疯瀹簨浠舵帹閫併��========鎴愬姛=======");
+ log.info("銆愭捣搴疯瀹簨浠舵帹閫併��========鎴愬姛=======");
}catch (Exception e){
log.error("銆愭捣搴疯瀹簨浠舵帹閫併��========澶辫触=======锛歕n"+e.getMessage());
@@ -379,7 +370,7 @@
//鍐嶆彃鍏ユ渶鏂扮殑鍦ㄥ巶浜哄憳
retentionMapper.insert(retentionList);
}
- log.error("銆愭捣搴疯瀹簨浠舵帹閫併��========鎴愬姛=======");
+ log.info("銆愭捣搴疯瀹簨浠舵帹閫併��========鎴愬姛=======");
}catch (Exception e){
log.error("銆愭捣搴疯瀹簨浠舵帹閫併��========澶辫触=======锛歕n"+e.getMessage());
}
@@ -423,7 +414,7 @@
member.setLastVisitDate(updateVistis.getInDate());
member.setId(visits.getMemberId());
memberMapper.updateById(member);
- }else if (Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.VISIT_SIGN_ICCM_OUT.getKey()) {
+ }else if (Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.VISIT_SIGN_ICCM_OUT.getKey()) {
//濡傛灉鏄瀹㈢绂讳簨浠�
updateVistis.setStatus(Constants.VisitStatus.signout);
updateVistis.setInDate(DateUtil.getISO8601DateByStr(data.getBeginTime()));
@@ -436,7 +427,6 @@
updateVistis.setEditDate(new Date());
//鏇存柊璁垮鏉ヨ鎴栬�呯绂绘椂闂翠俊鎭�
visitsMapper.updateById(updateVistis) ;
-
}
}
private Retention getRetentionModelByVisitRequest(Visits visits, String happentTime,String srcType) {
@@ -674,7 +664,7 @@
//鍐嶆彃鍏ユ渶鏂扮殑鍦ㄥ巶浜哄憳
retentionMapper.insert(retentionList);
}
- log.error("銆愭捣搴峰仠杞﹀満浜嬩欢鎺ㄩ�併��========鎴愬姛=======");
+ log.info("銆愭捣搴峰仠杞﹀満浜嬩欢鎺ㄩ�併��========鎴愬姛=======");
}catch (Exception e){
log.error("銆愭捣搴峰仠杞﹀満浜嬩欢鎺ㄩ�併��========澶辫触=======锛歕n"+e.getMessage());
@@ -735,7 +725,6 @@
event.setReleaseResult(request.getData().getInResult().getRlsResult().getReleaseResult());
event.setReleaseResultEx(request.getData().getInResult().getRlsResult().getReleaseResultEx());
}
-
if(request.getData().getPicUrl()!=null){
//杞﹁締鍜屽拰杞︾墝鐓х墖
event.setVehiclePicUrl(getHkImgUrl(request.getData().getPicUrl().getVehiclePicUrl()));
@@ -770,9 +759,7 @@
delRetentionList.add(event.getPlateNos());
}
}
-
return event;
-
}
private Retention getRetentionModelByParkRequest(EventParkInfoRequest request) {
@@ -783,7 +770,6 @@
retention.setType(Constants.THREE);
// retention.setDeviceName(request.getSrcName());
// retention.setDeviceIndex(request.getSrcIndex());
-
return retention;
}
@@ -843,7 +829,7 @@
}
}
result = "鎴愬姛";
- log.error("銆愭捣搴锋湀鍙板伐浣滅姸鎬佷簨浠舵帹閫併��========鎴愬姛=======");
+ log.info("銆愭捣搴锋湀鍙板伐浣滅姸鎬佷簨浠舵帹閫併��========鎴愬姛=======");
}catch (Exception e) {
result = "澶辫触"+e.getMessage();
log.error("銆愭捣搴锋湀鍙板伐浣滅姸鎬佷簨浠舵帹閫併��========澶辫触=======锛歕n" + e.getMessage());
@@ -870,81 +856,108 @@
List<EventPlatformCarsInfoRequest> events = param.getParams().getEvents();
List<PlatformEvent> eventList = new ArrayList<>();
for(EventPlatformCarsInfoRequest request : events){
- if( request.getData() ==null || request.getData().size()==0){
+ if( request.getData() ==null ){
continue;
}
Integer workStatus = 0;
- for(EventPlatformCarsDataRequest data : request.getData()){
- if( data.getHPVehicleStatus() ==null || data.getHPVehicleStatus().size() ==0){
- continue;//濡備綍鎺ㄩ�佺姸鎬侀泦鍚堜负绌猴紝涓嶅鐞嗚烦杩�
+ EventPlatformCarsDataRequest data = request.getData();
+ if( data.getHPVehicleStatus() ==null ){
+ continue;//濡備綍鎺ㄩ�佺姸鎬侀泦鍚堜负绌猴紝涓嶅鐞嗚烦杩�
+ }
+ //鍚勮溅閬撹溅杈嗙姸鎬�
+ EventPlatformCarsStatusInfoRequest status = data.getHPVehicleStatus();
+ PlatformEvent event = initPlatformEventModel(request,data,status);
+ if(StringUtils.isBlank(status.getPlateNo())){
+ eventList.add(event);//灏佽浜嬩欢锛堝凡鏈堝彴閫氶亾涓虹淮搴︼級
+ continue;//濡傛灉杞﹁締淇℃伅涓虹┖锛屼笉澶勭悊鐩存帴璺宠繃
+ }
+ PlatformDevice model = platformDeviceMapper.selectOne(new QueryWrapper<PlatformDevice>().lambda()
+ .eq(PlatformDevice::getDeviceId,request.getSrcIndex())
+ .eq(PlatformDevice::getIsdeleted,Constants.ZERO)
+ .last("limit 1"));
+ if(model ==null){
+ eventList.add(event);//灏佽浜嬩欢锛堝凡鏈堝彴閫氶亾涓虹淮搴︼級
+ continue;//鐩戞帶鐐规湭鍚屾锛岃烦杩囧鐞�
+ }
+ event.setPlatformId(model.getPlatformId());//鏈堝彴缂栫爜
+ eventList.add(event);//灏佽浜嬩欢锛堝凡鏈堝彴閫氶亾涓虹淮搴︼級
+ //鎴帀绗竴涓鑹叉眽瀛�,鍘绘帀鈥滄寕鈥濆瓧
+ status.setPlateNo(status.getPlateNo().substring(1,status.getPlateNo().length()).replace("鎸�",""));
+ PlatformJob job = platformJobMapper.selectJoinOne(PlatformJob.class, new MPJLambdaWrapper<PlatformJob>()
+ .selectAll(PlatformJob.class)
+ .selectAs(Platform::getName,PlatformJob::getPlatformName)
+ .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
+// .eq(StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeFront,status.getPlateNo() )//鍓嶈溅鐗屽彿
+// .eq(!StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeBack,status.getPlateNo() )//鍚庤溅鐗屽彿
+ .eq(PlatformJob::getIsdeleted,Constants.ZERO )
+ .eq(PlatformJob::getPlatformId,model.getPlatformId() )
+ .orderByDesc(PlatformJob::getCallDate)
+ .last("limit 1 "));
+ if(job == null){
+ continue;//濡傛灉浣滀笟涓虹┖锛岃烦杩囧鐞�
+ }
+ PlatformJob update = new PlatformJob();
+ update.setId(job.getId());
+ update.setEditDate(new Date());
+ if(StringUtils.equals(status.getMotionStatus(),"leave")){
+ //濡傛灉鏄溅杈嗙寮�,涓嶅仛鐩稿叧鑷姩瀹屾垚浣滀笟涓氬姟澶勭悊
+ /* if(job ==null && !Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){
+ continue;//濡傛灉娌℃煡鍒板搴旂殑浣滀笟鎴栬�呬綔涓氬苟闈炰綔涓氫腑锛屼笉鍋氫笟鍔″鐞�
}
- PlatformDevice model = platformDeviceMapper.selectOne(new QueryWrapper<PlatformDevice>().lambda()
- .eq(PlatformDevice::getDeviceId,request.getSrcIndex())
- .eq(PlatformDevice::getIsdeleted,Constants.ZERO)
- .last("limit 1"));
- if(model ==null){
- continue;//鐩戞帶鐐规湭鍚屾锛岃烦杩囧鐞�
-
+ if(Constants.equalsInteger(job.getType(), Constants.THREE) || Constants.equalsInteger(job.getType(), Constants.TWO)){
+ //濡傛灉鏄痺ms鎺ㄩ�佺殑澶栧崗杞﹁締澶栧崗杞﹁締
+ if(platformWmsDetailMapper.selectCount(new QueryWrapper<PlatformWmsDetail>().lambda()
+ .eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO)
+ .eq(PlatformWmsDetail::getJobId,job.getId())
+ .ne(PlatformWmsDetail::getLockStatus,Constants.ONE)) >0){
+ continue;//濡傛灉澶栧崗浠诲姟浣滀笟锛屽悎鍚屽彿鏈夋湭涓婇攣鐨勬儏鍐碉紝涓嶅仛鑷姩瀹屾垚浣滀笟閫昏緫澶勭悊锛岃烦杩囦笉澶勭悊
+ }
}
- //鍚勮溅閬撹溅杈嗙姸鎬�
- for(EventPlatformCarsStatusInfoRequest status : data.getHPVehicleStatus()){
- eventList.add(initPlatformEventModel(request,data,status));//灏佽浜嬩欢锛堝凡鏈堝彴閫氶亾涓虹淮搴︼級
- if(StringUtils.isBlank(status.getPlateNo())){
- continue;//濡傛灉杞﹁締淇℃伅涓虹┖锛屼笉澶勭悊鐩存帴璺宠繃
+ //濡傛灉鏄鍦ㄤ綔涓氱殑鐘舵�侊紝鏍囪浣滀笟宸插畬鎴�
+ update.setStatus(Constants.PlatformJobStatus.DONE.getKey());//浣滀笟宸插畬鎴�
+ update.setDoneDate(update.getEditDate());*/
+ if(Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.DONE.getKey()) ||
+ Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.AUTHED_LEAVE.getKey())){
+ if(((StringUtils.equals(status.getStockStatus(),"front") && StringUtils.equals(job.getCarCodeFront(),status.getPlateNo()))
+ ||(!StringUtils.equals(status.getStockStatus(),"front") && StringUtils.equals(job.getCarCodeBack(),status.getPlateNo()))
+ )){
+ //璇存槑杞﹁締杩涢敊鏈堝彴 鎴栬�呰繕鏈彨鍙风姸鎬侊紝鍙戣捣璀﹀憡
+// dealCarsInErrorPlatformBiz(job,status);
+ update.setInOut(Constants.ZERO);//杞﹁締宸茬粡绂诲紑
+ platformJobMapper.updateById(update);
}
- PlatformJob job = platformJobMapper.selectJoinOne(PlatformJob.class, new MPJLambdaWrapper<PlatformJob>()
- .selectAll(PlatformJob.class)
- .selectAs(Platform::getName,PlatformJob::getPlatformName)
- .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId)
- .eq(StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeFront,status.getPlateNo() )//鍓嶈溅鐗屽彿
- .eq(!StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeBack,status.getPlateNo() )//鍚庤溅鐗屽彿
- .eq(PlatformJob::getIsdeleted,Constants.ZERO )
- .last("limit 1 "));
- PlatformJob update = new PlatformJob();
- update.setId(job.getId());
- update.setEditDate(new Date());
- if(StringUtils.equals(status.getMotionStatus(),"leave")){
- //濡傛灉鏄溅杈嗙寮�,涓嶅仛鐩稿叧鑷姩瀹屾垚浣滀笟涓氬姟澶勭悊
- /* if(job ==null && !Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){
- continue;//濡傛灉娌℃煡鍒板搴旂殑浣滀笟鎴栬�呬綔涓氬苟闈炰綔涓氫腑锛屼笉鍋氫笟鍔″鐞�
- }
- if(Constants.equalsInteger(job.getType(), Constants.THREE) || Constants.equalsInteger(job.getType(), Constants.TWO)){
- //濡傛灉鏄痺ms鎺ㄩ�佺殑澶栧崗杞﹁締澶栧崗杞﹁締
- if(platformWmsDetailMapper.selectCount(new QueryWrapper<PlatformWmsDetail>().lambda()
- .eq(PlatformWmsDetail::getIsdeleted,Constants.ZERO)
- .eq(PlatformWmsDetail::getJobId,job.getId())
- .ne(PlatformWmsDetail::getLockStatus,Constants.ONE)) >0){
- continue;//濡傛灉澶栧崗浠诲姟浣滀笟锛屽悎鍚屽彿鏈夋湭涓婇攣鐨勬儏鍐碉紝涓嶅仛鑷姩瀹屾垚浣滀笟閫昏緫澶勭悊锛岃烦杩囦笉澶勭悊
- }
- }
- //濡傛灉鏄鍦ㄤ綔涓氱殑鐘舵�侊紝鏍囪浣滀笟宸插畬鎴�
- update.setStatus(Constants.PlatformJobStatus.DONE.getKey());//浣滀笟宸插畬鎴�
- update.setDoneDate(update.getEditDate());*/
- }else if(StringUtils.equals(status.getMotionStatus(),"enter")){
- //濡傛灉鏄溅杈嗚繘鍏�
- if(job ==null || !Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())){
- //璇存槑杞﹁締杩涢敊鏈堝彴 鎴栬�呰繕鏈彨鍙风姸鎬侊紝鍙戣捣璀﹀憡
- dealCarsInErrorPlatformBiz(job,status);
- }
- if(job.getStartDate() == null){
- update.setStartDate(update.getEditDate());
- }
- update.setStatus(Constants.PlatformJobStatus.WORKING.getKey());//寮�濮嬩綔涓�
+ }
+ }else if(StringUtils.equals(status.getMotionStatus(),"enter")){
+ //濡傛灉鏄溅杈嗚繘鍏�
+ if(Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())){
+ if(!((StringUtils.equals(status.getStockStatus(),"front") && StringUtils.equals(job.getCarCodeFront(),status.getPlateNo()))
+ ||(!StringUtils.equals(status.getStockStatus(),"front") && StringUtils.equals(job.getCarCodeBack(),status.getPlateNo()))
+ )){
+ //璇存槑杞﹁締杩涢敊鏈堝彴 鎴栬�呰繕鏈彨鍙风姸鎬侊紝鍙戣捣璀﹀憡
+ dealCarsInErrorPlatformBiz(job,status);
}else{
- continue;//鍏朵粬鐘舵�佷笉澶勭悊锛岃烦杩�
+ //杞﹁締宸茬粡杩涘叆
+ update.setInOut(Constants.ONE);//杞﹁締宸茬粡杩涘叆
+ platformJobMapper.updateById(update);
}
+ }
+ /*if(job.getStartDate() == null){
+ update.setStartDate(update.getEditDate());
+ }
+ update.setStatus(Constants.PlatformJobStatus.WORKING.getKey());//寮�濮嬩綔涓�
+ */
+ }else{
+ continue;//鍏朵粬鐘舵�佷笉澶勭悊锛岃烦杩�
+ }
//鏆傛椂涓嶅仛鐩稿叧鑷姩瀹屾垚浣滀笟涓氬姟澶勭悊
// dealPlatformJobLogBiz(update,status);//璁板綍浣滀笟鏃ュ織
- }
- break;//鍙鐞嗙涓�涓暟鎹姸鎬�
- }
}
if(eventList.size()>0){
//鐢熸垚浜嬩欢
platformEventMapper.insert(eventList);
}
result = "鎴愬姛";
- log.error("銆愭捣搴锋湀鍙拌溅杈嗙姸鎬佷簨浠舵帹閫併��========鎴愬姛=======");
+ log.info("銆愭捣搴锋湀鍙拌溅杈嗙姸鎬佷簨浠舵帹閫併��========鎴愬姛=======");
}catch (Exception e) {
result = "澶辫触"+e.getMessage();
log.error("銆愭捣搴锋湀鍙拌溅杈嗙姸鎬佷簨浠舵帹閫併��========澶辫触=======锛歕n" + e.getMessage());
@@ -1061,71 +1074,29 @@
return;
}
String content =Constants.PlatformLedContent.WRONG_IN.getInfo();
- content = content.replace("${param}",model.getPlatformName());
- content = content.replace("${param2}",model.getCarCodeFront());
+ content = content.replace("${param2}",model.getPlatformName());
+ content = content.replace("${param}",status.getPlateNo());
List<String> broadcastList = new ArrayList<>();
List<String> ledList = new ArrayList<>();
+ String bNames = "";
List<PlatformBroadcastLog> logList = new ArrayList<>();
for(PlatformDevice device : deviceList){
- if(StringUtils.isNotBlank(device.getHkId())){
+ if(StringUtils.isBlank(device.getHkId())){
continue;
}
if(Constants.equalsInteger(device.getType(),Constants.ZERO)){
//濡傛灉鏄疞ED
- PlatformBroadcastLog log = new PlatformBroadcastLog();
- log.setCreateDate(new Date());
- log.setBizType(Constants.ONE);
- log.setHkDate(new Date());
- log.setObjType(Constants.ONE);
- log.setIds(device.getHkNo());
- log.setInfo(content);
- log.setNum(Constants.ONE);
- BaseResponse response = dealLedContentBiz(device.getHkNo(),content,speed,1);
- if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){
- log.setHkInfo("璇锋眰澶辫触锛�"+JSONObject.toJSONString(response));
- log.setHkStatus(Constants.THREE);
- }else{
- log.setHkInfo("璇锋眰鎴愬姛");
- log.setHkStatus(Constants.TWO);
- }
- log.setDeviceType(Constants.ONE);
- log.setName("璁剧疆LED灞忔樉鍐呭");
+ PlatformBroadcastLog log = dealLedContentBiz(device.getHkNo(),device.getName(),content,speed,1);
logList.add(log);
ledList.add(device.getHkId());
- }else if(Constants.equalsInteger(device.getType(),Constants.ZERO)){
+ }else if(Constants.equalsInteger(device.getType(),Constants.TWO)){
//濡傛灉鏄箍鎾偣
+ bNames += device.getName()+";";
broadcastList.add(device.getHkId());
}
}
-
if(broadcastList.size()>0){
- String content1 =Constants.PlatformBroadcastContent.WRONG_IN.getInfo();
- content1 = content1.replace("${param}",model.getCarCodeFront());
- PlatformBroadcastLog log = new PlatformBroadcastLog();
- log.setCreateDate(new Date());
- log.setBizType(Constants.ONE);
- log.setHkDate(new Date());
- log.setObjType(Constants.ONE);
- log.setInfo(content1);
- log.setNum(Constants.ONE);
- log.setIds(String.join(",",broadcastList));
- CustomBroadcastRequest request = new CustomBroadcastRequest();
- request.setAudioPointIndexCode(broadcastList);
- request.setPlayDuration(15);//鍗曚綅绉�
- request.setBroadCastMode("tts");
- request.setPriority(1);
- request.setState(1);//鎾斁/鍋滄鏍囪瘑 1-鎾斁锛�0-鍋滄
- request.setPlayTtsContent(content1);
- BaseResponse response = HKService.customBroadcast(request);
- if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){
- log.setHkInfo("璇锋眰澶辫触锛�"+JSONObject.toJSONString(response));
- log.setHkStatus(Constants.THREE);
- }else{
- log.setHkInfo("璇锋眰鎴愬姛");
- log.setHkStatus(Constants.TWO);
- }
- log.setDeviceType(Constants.ONE);
- log.setName("鍙戦�佸箍鎾挱鎶ュ唴瀹�");
+ PlatformBroadcastLog log = dealBroadcastBiz(model,broadcastList,bNames,Constants.PlatformBroadcastContent.WRONG_IN.getInfo().replace("${param}",status.getPlateNo()));
logList.add(log);
}
if(logList.size()>0){
@@ -1133,7 +1104,57 @@
}
}
- public static BaseResponse dealLedContentBiz(String hkNo, String content,int speed,int color) {
+ /**
+ * 骞挎挱閫氱煡
+ * @param model
+ * @param broadcastList
+ * @param bNames
+ * @param content1
+ * @return
+ */
+ public static PlatformBroadcastLog dealBroadcastBiz(PlatformJob model, List<String> broadcastList,String bNames , String content1) {
+ PlatformBroadcastLog log = new PlatformBroadcastLog();
+ content1 = content1.replace("${param}",model.getCarCodeFront());
+
+ log.setCreateDate(new Date());
+ log.setBizType(Constants.ONE);
+ log.setHkDate(new Date());
+ log.setObjType(Constants.ONE);
+ log.setInfo(content1);
+ log.setRemark(bNames);
+ log.setNum(Constants.ONE);
+ log.setIds(String.join(",",broadcastList));
+ CustomBroadcastRequest request = new CustomBroadcastRequest();
+ request.setAudioPointIndexCode(broadcastList);
+ request.setPlayDuration(15);//鍗曚綅绉�
+ request.setBroadCastMode("tts");
+ request.setPriority(1);
+ request.setState(1);//鎾斁/鍋滄鏍囪瘑 1-鎾斁锛�0-鍋滄
+ request.setPlayTtsContent(content1);
+ BaseResponse response = HKService.customBroadcast(request);
+ if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){
+ log.setHkInfo("璇锋眰澶辫触锛�"+JSONObject.toJSONString(response));
+ log.setHkStatus(Constants.THREE);
+ }else{
+ log.setHkInfo("璇锋眰鎴愬姛");
+ log.setHkStatus(Constants.TWO);
+ }
+ log.setDeviceType(Constants.ONE);
+ log.setName("鍙戦�佸箍鎾挱鎶ュ唴瀹�");
+ return log;
+ }
+
+ public static PlatformBroadcastLog dealLedContentBiz(String hkNo,String hkName, String content,int speed,int color) {
+ PlatformBroadcastLog log = new PlatformBroadcastLog();
+ log.setCreateDate(new Date());
+ log.setBizType(Constants.ONE);
+ log.setHkDate(new Date());
+ log.setObjType(Constants.ONE);
+ log.setIds(hkNo);
+ log.setRemark(hkName);
+ log.setInfo(content);
+ log.setNum(Constants.ONE);
+
TransparentChannelBodyRequest body = new TransparentChannelBodyRequest();
TransparentChannelHeadRequest head = new TransparentChannelHeadRequest();
TransparentChannelBodyParamRequest request = new TransparentChannelBodyParamRequest();
@@ -1160,6 +1181,16 @@
request.getRegions().add(regions);
regions.setSpeed(speed>0?speed:13);
body.setParams(request);
- return HKService.transparentchannel(head,body);
+ BaseResponse response = HKService.transparentchannel(head,body);
+ if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){
+ log.setHkInfo("璇锋眰澶辫触锛�"+JSONObject.toJSONString(response));
+ log.setHkStatus(Constants.THREE);
+ }else{
+ log.setHkInfo("璇锋眰鎴愬姛");
+ log.setHkStatus(Constants.TWO);
+ }
+ log.setDeviceType(Constants.ONE);
+ log.setName("璁剧疆LED灞忔樉鍐呭");
+ return log;
}
}
--
Gitblit v1.9.3