From eaf4587b47701f3df0559e64362d6ea413d782f3 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 11 十月 2024 10:41:49 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/dmvisit
---
server/system_service/src/main/java/com/doumee/core/utils/Constants.java | 22 ++++++
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java | 52 +++++++++++++---
admin/src/components/business/OperaPlatformWindow.vue | 4 +
server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java | 3 +
server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformStatusListResponse.java | 2
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java | 47 +++++++++++----
server/visits/dmvisit_admin/src/main/resources/bootstrap.yml | 2
admin/src/views/platform/platform.vue | 1
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncImgServiceImpl.java | 5 +
9 files changed, 109 insertions(+), 29 deletions(-)
diff --git a/admin/src/components/business/OperaPlatformWindow.vue b/admin/src/components/business/OperaPlatformWindow.vue
index 6214951..322b834 100644
--- a/admin/src/components/business/OperaPlatformWindow.vue
+++ b/admin/src/components/business/OperaPlatformWindow.vue
@@ -26,6 +26,9 @@
</el-option>
</el-select>
</el-form-item>
+ <el-form-item label="LED绌洪棽鏂囨锛�" prop="remark">
+ <el-input type="text" v-model="form.remark" placeholder="璇疯緭鍏ED绌洪棽鏂囨" v-trim />
+ </el-form-item>
<el-form-item label="鍚屾椂浣滀笟鏁伴噺锛�" prop="workingNum">
<el-input type="number" v-model="form.workingNum" placeholder="璇疯緭鍏ュ悓鏃朵綔涓氭暟閲�" v-trim />
</el-form-item>
@@ -68,6 +71,7 @@
startTime: '',
endTime: '',
workingNum: 1,
+ remark: '',
workRate: '',
stayTimeoutAlarmTime: '',
workTimeoutAlarmTime: '',
diff --git a/admin/src/views/platform/platform.vue b/admin/src/views/platform/platform.vue
index a9e3979..e5615f6 100644
--- a/admin/src/views/platform/platform.vue
+++ b/admin/src/views/platform/platform.vue
@@ -50,6 +50,7 @@
</el-table-column> -->
<el-table-column prop="broadcastNames" label="鍏宠仈骞挎挱" min-width="100px"></el-table-column>
<el-table-column prop="ledNames" label="鍏宠仈LED" min-width="100px"></el-table-column>
+ <el-table-column prop="remark" label="LED绌洪棽鏂囨" min-width="180px"></el-table-column>
<el-table-column prop="hkDate" label="鍚屾鏃堕棿" min-width="150px"></el-table-column>
<el-table-column label="鏈堝彴鐘舵��" fixed="right" width="100px">
<template slot-scope="{row}">
diff --git a/server/system_service/src/main/java/com/doumee/core/utils/Constants.java b/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
index 5ab2efa..4c8339d 100644
--- a/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
+++ b/server/system_service/src/main/java/com/doumee/core/utils/Constants.java
@@ -288,6 +288,23 @@
return s.substring(0,5)+"*******"+s.substring(l-6,l);
}
+
+ public static String carCodeTuominStr(String s){
+ if(StringUtils.isEmpty(s)){
+ return "";
+ }
+ int l = s.length();
+ if(Constants.equalsInteger(l,7)){
+ return s.substring(0,3)+"***"+s.substring(l-1,l);
+ }
+ if(l <= 8){
+ return s.substring(0,3)+"****"+s.substring(l-1,l);
+ }
+ return s;
+ }
+
+
+
/**
* 鍒囧垎閫楀彿鎷兼帴鐨勬暣褰㈤泦鍚�
* @param memberIds
@@ -584,7 +601,8 @@
}
public static void main(String[] args) {
- System.out.println(Constants.getVehiclePlateNo("鐨朅A10991").getDescription());
+ System.out.println(Constants.carCodeTuominStr("鐨朅10991"));
+ System.out.println(Constants.carCodeTuominStr("鐨朅A10991"));
// System.out.println(Constants.getVehiclePlateNo("婀楤140D17").getDescription());
// System.out.println(Constants.getVehiclePlateNo("瀹緼P0637").getDescription());
@@ -934,7 +952,7 @@
4. 瓒呮椂鍋滈潬锛氱殩A12345鏈堝彴鍋滈潬瓒呮椂锛岃灏藉揩椹剁璇峰敖蹇┒绂�
*/
public enum PlatformBroadcastContent {
- CALLING(1, "鍙彿涓�"," ${param}璇峰墠寰�${param2}绛夊緟浣滀笟"),
+ CALLING(1, "鍙彿涓�","${param}璇峰墠寰�${param2}绛夊緟浣滀笟"),
DONE(2, "浣滀笟瀹屾垚","${param}浣滀笟瀹屾垚锛岃灏藉揩椹剁" ),
WRONG_IN(3, "閿欒鍋滈潬","${param}鏈堝彴鍋滈潬閿欒锛岃灏藉揩椹剁" ),
TIMEOUT_IN(4, "瓒呮椂鍋滈潬","${param}鏈堝彴鍋滈潬瓒呮椂锛岃灏藉揩椹剁璇峰敖蹇┒绂�" ),
diff --git a/server/visits/dmvisit_admin/src/main/resources/bootstrap.yml b/server/visits/dmvisit_admin/src/main/resources/bootstrap.yml
index 9dc10e9..2df12af 100644
--- a/server/visits/dmvisit_admin/src/main/resources/bootstrap.yml
+++ b/server/visits/dmvisit_admin/src/main/resources/bootstrap.yml
@@ -1,6 +1,6 @@
spring:
profiles:
- active: dev
+ active: pro
application:
name: visitsAdmin
# 瀹夊叏閰嶇疆
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java
index 64a7346..846bc80 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/business/model/PlatformJob.java
@@ -61,6 +61,9 @@
@ApiModelProperty(value = "鐘舵�� 0寰呯‘璁� 1寰呯鍒� 2绛夊緟鍙彿 3鍏ュ洯绛夊緟 4宸插彨鍙� 5浣滀笟涓� 6浣滀笟瀹屾垚 7杞Щ涓� 8寮傚父鎸傝捣 9宸叉巿鏉冪鍥� 10宸茬鍥� 11 宸茶繃鍙� 12鍙栨秷锛圵MS锛�" , example = "1")
@ExcelColumn(name="鐘舵�� 0寰呯‘璁� 1寰呯鍒� 2绛夊緟鍙彿 3鍏ュ洯绛夊緟 4宸插彨鍙� 5浣滀笟涓� 6浣滀笟瀹屾垚 7杞Щ涓� 8寮傚父鎸傝捣 9宸叉巿鏉冪鍥� 10宸茬鍥� 11 宸茶繃鍙� 12鍙栨秷锛圵MS锛�")
private Integer status;
+ @ApiModelProperty(value = "杞﹁締杩涘叆鐘舵�� 0涓嶅湪 1杩涘叆 " , example = "1")
+ @ExcelColumn(name="杞﹁締杩涘叆鐘舵�� 0涓嶅湪 1杩涘叆 ")
+ private Integer inOut;
@ApiModelProperty(value = "鎺掑簭鐮�", example = "1")
@ExcelColumn(name="鎺掑簭鐮�")
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformStatusListResponse.java b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformStatusListResponse.java
index 720916f..ccd1767 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformStatusListResponse.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/dao/openapi/response/PlatformStatusListResponse.java
@@ -23,6 +23,6 @@
@ApiModelProperty(value = "杞︾墝鍙�" )
private String carCode;
@ApiModelProperty(value = "鏈堝彴鐘舵�� 0-鏃犺溅 1-鏈夎溅 2-瓒呮椂鍋滈潬 3-閿欒鍋滈潬" )
- private Integer status;
+ private Integer status = 0 ;
}
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
index 5957712..6341d06 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/PlatformJobServiceImpl.java
@@ -1035,47 +1035,67 @@
);
//骞挎挱 led閫氱煡
- this.broadcastAndLEed(platformJob,Constants.PlatformBroadcastContent.CALLING.getInfo().replace("{param2}",platform.getName()));
+ platformJob.setPlatformName(platform.getName());
+ this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.CALLING.getInfo(),
+ Constants.PlatformBroadcastContent.CALLING.getInfo()
+ );
return platformJob;
}
- public void broadcastAndLEed(PlatformJob model,String content){
+ public void broadcastAndLEed(PlatformJob model,String ledContent,String broadcastContent){
int speed = 13;
try {
speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode());
}catch (Exception e){
}
+ log.error("鏌ヨLED涓庡箍鎾暟鎹�------------------------------------------------------------------------------------------");
List<PlatformDevice> deviceList = platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda()
.eq(PlatformDevice::getPlatformId,model.getPlatformId())
.eq(PlatformDevice::getIsdeleted,Constants.ZERO));
if(deviceList ==null || deviceList.size() == 0){
return;
}
- content = content.replace("${param}",model.getPlatformName());
- content = content.replace("${param2}",model.getCarCodeFront());
+
+ Boolean sendLed = StringUtils.isBlank(ledContent)?false:true;
+ Boolean sendBroadcast = StringUtils.isBlank(broadcastContent)?false:true;
+
+ if (sendLed) {
+ //骞挎挱 param2 = 杞︾墝鍙� param = 鏈堝彴
+ ledContent = ledContent.replace("${param}",model.getPlatformName());
+ ledContent = ledContent.replace("${param2}",model.getCarCodeFront());
+ }
+ if(sendBroadcast){
+ //骞挎挱 param2 = 鏈堝彴 param = 杞︾墝鍙�
+ broadcastContent = broadcastContent.replace("${param2}",model.getPlatformName());
+ broadcastContent = broadcastContent.replace("${param}",model.getCarCodeFront());
+ }
+
List<String> broadcastList = new ArrayList<>();
List<String> ledList = new ArrayList<>();
String bNames = "";
List<PlatformBroadcastLog> logList = new ArrayList<>();
+ log.error("寰幆璋冭捣led涓庡箍鎾�------------------------------------------------------------------------------------------");
for(PlatformDevice device : deviceList){
- if(StringUtils.isNotBlank(device.getHkId())){
+ if(StringUtils.isBlank(device.getHkId())){
continue;
}
- if(Constants.equalsInteger(device.getType(),Constants.ZERO)){
+ if(Constants.equalsInteger(device.getType(),Constants.ZERO)&&sendLed){
+ log.error("璋冭捣led------------------------------------------------------------------------------------------");
//濡傛灉鏄疞ED
- PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(device.getHkNo(),device.getName(),content,speed,1);
+ PlatformBroadcastLog log = HkSyncPushServiceImpl.dealLedContentBiz(device.getHkNo(),device.getName(),ledContent,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)&&sendBroadcast){
+ log.error("璋冭捣骞挎挱------------------------------------------------------------------------------------------");
//濡傛灉鏄箍鎾偣
bNames += device.getName()+";";
broadcastList.add(device.getHkId());
}
}
if(broadcastList.size()>0){
- PlatformBroadcastLog log = HkSyncPushServiceImpl.dealBroadcastBiz(model,broadcastList,bNames,Constants.PlatformBroadcastContent.WRONG_IN.getInfo());
+ PlatformBroadcastLog log = HkSyncPushServiceImpl.dealBroadcastBiz(model,broadcastList,bNames,broadcastContent);
logList.add(log);
}
if(logList.size()>0){
@@ -1261,7 +1281,13 @@
emayService,smsEmailMapper,smsConfigMapper,platformJobMapper,platformJob.getId(),
SmsConstants.platformJobContent.platformJobWorking,platform.getName(),null
);
-
+
+ //骞挎挱 led閫氱煡
+ platformJob.setPlatformName(platform.getName());
+ this.broadcastAndLEed(platformJob,Constants.PlatformLedContent.WORKING.getInfo(),
+ null
+ );
+
return platformJob;
}
@@ -1317,7 +1343,9 @@
);
//骞挎挱 led閫氱煡
- this.broadcastAndLEed(platformJob,Constants.PlatformBroadcastContent.DONE.getInfo());
+ platformJob.setPlatformName(platform.getName());
+ this.broadcastAndLEed(platformJob,null,
+ Constants.PlatformBroadcastContent.DONE.getInfo());
return platformJob;
}
@@ -1875,6 +1903,8 @@
);
if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){
for (PlatformJob platformJob:platformJobList) {
+ //杞︾墝鍙疯劚鏁�
+ platformJob.setCarCodeFront(Constants.carCodeTuominStr(platformJob.getCarCodeFront()));
if(Constants.equalsInteger(platformJob.getStatus(),Constants.PlatformJobStatus.WORKING.getKey())){
//璁$畻宸蹭綔涓氭椂闀� 鏍规嵁鏈堝彴宸ヤ綔鏁堢巼 璁$畻浠诲姟閲忛渶瑕佹椂闂�
if(Objects.isNull(platformJob.getWorkNum()) || Objects.isNull(platformJob.getWorkRate())){
diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncImgServiceImpl.java b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncImgServiceImpl.java
index 8aeaa4b..887c3f7 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncImgServiceImpl.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncImgServiceImpl.java
@@ -12,6 +12,7 @@
import com.doumee.dao.business.*;
import com.doumee.dao.business.model.*;
import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -291,7 +292,9 @@
log.info("鏈堝彴鍥剧墖涓嬭浇寮�濮嬶細=========================="+img1);
try {
is = new URL(img1).openStream();
-// is = HttpsUtil.connectionInputsteam(img1,"GET",null,null);
+ byte[] bytes = IOUtils.toByteArray(is);
+ is = new ByteArrayInputStream(bytes);
+// is = HttpsUtil.connectionInputsteam(img1,"GET",null,null);
}catch (Exception e){
e.printStackTrace();
log.error("鏈堝彴鍥剧墖涓嬭浇澶辫触锛�=========================="+img1+"\n"+e.getMessage());
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 202db3a..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
@@ -414,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()));
@@ -427,7 +427,6 @@
updateVistis.setEditDate(new Date());
//鏇存柊璁垮鏉ヨ鎴栬�呯绂绘椂闂翠俊鎭�
visitsMapper.updateById(updateVistis) ;
-
}
}
private Retention getRetentionModelByVisitRequest(Visits visits, String happentTime,String srcType) {
@@ -888,9 +887,11 @@
.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(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;//濡傛灉浣滀笟涓虹┖锛岃烦杩囧鐞�
@@ -915,16 +916,36 @@
//濡傛灉鏄鍦ㄤ綔涓氱殑鐘舵�侊紝鏍囪浣滀笟宸插畬鎴�
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);
+ }
+ }
}else if(StringUtils.equals(status.getMotionStatus(),"enter")){
//濡傛灉鏄溅杈嗚繘鍏�
- if(job ==null || !Constants.equalsInteger(job.getStatus(),Constants.PlatformJobStatus.CALLED.getKey())){
- //璇存槑杞﹁締杩涢敊鏈堝彴 鎴栬�呰繕鏈彨鍙风姸鎬侊紝鍙戣捣璀﹀憡
- dealCarsInErrorPlatformBiz(job,status);
+ 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{
+ //杞﹁締宸茬粡杩涘叆
+ update.setInOut(Constants.ONE);//杞﹁締宸茬粡杩涘叆
+ platformJobMapper.updateById(update);
+ }
}
- if(job.getStartDate() == null){
+ /*if(job.getStartDate() == null){
update.setStartDate(update.getEditDate());
}
update.setStatus(Constants.PlatformJobStatus.WORKING.getKey());//寮�濮嬩綔涓�
+ */
}else{
continue;//鍏朵粬鐘舵�佷笉澶勭悊锛岃烦杩�
}
@@ -1053,14 +1074,14 @@
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)){
@@ -1068,14 +1089,14 @@
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){
- PlatformBroadcastLog log = dealBroadcastBiz(model,broadcastList,bNames,Constants.PlatformBroadcastContent.WRONG_IN.getInfo());
+ PlatformBroadcastLog log = dealBroadcastBiz(model,broadcastList,bNames,Constants.PlatformBroadcastContent.WRONG_IN.getInfo().replace("${param}",status.getPlateNo()));
logList.add(log);
}
if(logList.size()>0){
--
Gitblit v1.9.3