Commit 205b762f authored by 赵啸非's avatar 赵啸非

修改同步逻辑

parent 66c86372
...@@ -36,6 +36,16 @@ ...@@ -36,6 +36,16 @@
<Field label="最近上线时间" prop="onlineTime" v-model="form.onlineTime" type="date" /> <Field label="最近上线时间" prop="onlineTime" v-model="form.onlineTime" type="date" />
<Field label="最近离线时间" prop="offlineTime" v-model="form.offlineTime" type="date" /> <Field label="最近离线时间" prop="offlineTime" v-model="form.offlineTime" type="date" />
<Field :span="20" label="选择工作人员" prop="roomId" v-model="form.workmanId" :multiple="true" type="select" :enumData="dict.workmanId" placeholder="请选择人员"/>
<Field label="轮播图片"><fileUpload v-model="filePaths" :limit="limit" :fileType="fileType" :fileName="form.fileName" @getFileName="getFileName" prePath="/file/fileupload"/></Field>
</el-row> </el-row>
<form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn /> <form-buttons @submit='submitForm' v-if="pageInfo.type!='view'" noCancelBtn />
...@@ -57,6 +67,12 @@ ...@@ -57,6 +67,12 @@
}, },
data() { data() {
return { return {
filePaths:"",
fileNames:"",
limit:10,
deviceFileEntityList: [],
deviceWorkmanEntityList:[],
fileType:['png', 'jpg', 'jpeg', 'mp4', 'avi'],
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 弹出层标题 // 弹出层标题
...@@ -90,6 +106,9 @@ ...@@ -90,6 +106,9 @@
}, },
methods: { methods: {
getFileName(fileName) {
this.fileNames = fileName;
},
/** 编辑 */ /** 编辑 */
edit(row) { edit(row) {
this.reset() this.reset()
...@@ -120,11 +139,45 @@ ...@@ -120,11 +139,45 @@
cancel() { cancel() {
this.open = false; this.open = false;
}, },
// 渲染前置处理
beforeRender(data) {
this.fileNames = ""
this.filePaths = ""
if (data.entity.deviceFileEntityList && data.entity.deviceFileEntityList.length > 0) {
this.fileNames=data.entity.deviceFileEntityList.map(i=>i.fileName+",")
this.filePaths=data.entity.deviceFileEntityList.map(i=>i.filePaths+",")
}
},
/**获取数据后弹框 */ /**获取数据后弹框 */
afterRender(data) { afterRender(data) {
this.open = true; this.open = true;
}, },
beforeSubmit(data) {
// data.deviceName=this.dict.deviceId[data.deviceId]
console.log(this.filePaths)
console.log(this.fileNames)
let deviceFileEntityList=[];
var filePathList = this.filePaths.split(",");
var fileNameList = this.fileNames.split(",");
for (let i = 0; i < filePathList.length; i++) {
let obj={}
obj.filePath=filePathList[i]
obj.fileName=fileNameList[i]
deviceFileEntityList.push(obj)
}
/* let deviceFileEntityList=this.filePaths.map(i=>{
let obj={}
obj.filePath=i
return obj
})*/
data.deviceFileEntityList=deviceFileEntityList;
return data
},
afterSubmit(data) { afterSubmit(data) {
this.open = false; this.open = false;
this.$emit("ok"); this.$emit("ok");
......
@echo off
setlocal enabledelayedexpansion
echo please make sure you are admin
echo 解压并部署redis,notepad及相关软件,请确保相关压缩包在当前目录。
echo 执行此脚本前,请确认已经安装解压缩程序WinRAR.exe
:::::::::: 配置参数 ::::::::::
::解压程序WinRAR.exe所在目录 32位%ProgramFiles(x86)% 或64位 %ProgramFiles%
::set WinRarDir=%ProgramFiles%\WinRAR
set WinRarDir=D:\Program Files\WinRAR
REM 基础文件
set project=info-publish-manager.tar.gz
REM 部署盘符
set Pan=D:\temp\
:::::::::: 执行脚本前,请配置以上参数。::::::::::
echo ------------------------------
set curdir=%~dp0
cd /d %curdir%
echo 开始准备部署资源:
::检查基础文件
if exist %curdir%%project% (echo 存在:%project%) else (echo %project%文件不存在 & pause&exit)
echo ------------------------------
::创建部署目录
set deploydir=%Pan%
if exist %Pan% ( ^
if exist %deploydir% (echo 存在:%deploydir%) else (mkdir %deploydir% & echo 已创建:%deploydir%)
) else ( ^
echo !!
echo !!执行失败,当前系统不存在%Pan%
echo !!
pause&exit
)
echo ------------------------------
::解压并放到部署目录 32位%ProgramFiles(x86)% 或64位 %ProgramFiles%
if exist "%WinRarDir%\WinRAR.exe" (echo 已找到:"%WinRarDir%\WinRAR.exe") else (echo 找不到:"%WinRarDir%\WinRAR.exe"请检查。 & pause&exit)
echo 开始解压部署资源:
::替换掉.zip即移除后缀名形成解压到文件夹名
set "redisdir=%redis:.zip=%"
:: x即解压。-y是说如果遇到提示说是否覆盖,选择yes
start /wait "" "%WinRarDir%\WinRAR.exe" x -l %curdir%%project% %deploydir%\%project%\
copy "%curdir%script\Redis*" "%deploydir%\%project%\"
echo 部署资源已准备好,你可以开始部署了(请注意修改redis,preview等相关应用配置文件)。
echo ------------------------------
echo 检查服务是否存在:
::检查服务是否存在
set redisServerName=Redis
sc query "%redisServerName%" >nul && (echo 服务已存在:%redisServerName%) || (echo 请安装部署:%redisServerName%)
echo 检查服务已完成。
echo ------------------------------
echo 部署资源已准备好,请开始部署吧。
::部署完成,打开windows服务管理器
start "" "services.msc" -refresh
pause
\ No newline at end of file
...@@ -13,9 +13,13 @@ import com.mortals.xhx.common.code.EnabledEnum; ...@@ -13,9 +13,13 @@ import com.mortals.xhx.common.code.EnabledEnum;
import com.mortals.xhx.common.pdu.LoginForm; import com.mortals.xhx.common.pdu.LoginForm;
import com.mortals.xhx.common.pdu.device.DeviceReq; import com.mortals.xhx.common.pdu.device.DeviceReq;
import com.mortals.xhx.feign.device.IDeviceFeign; import com.mortals.xhx.feign.device.IDeviceFeign;
import com.mortals.xhx.module.device.model.DeviceEntity; import com.mortals.xhx.module.device.model.*;
import com.mortals.xhx.module.device.model.DeviceQuery; import com.mortals.xhx.module.device.service.DeviceFileService;
import com.mortals.xhx.module.device.service.DeviceService; import com.mortals.xhx.module.device.service.DeviceService;
import com.mortals.xhx.module.device.service.DeviceWorkmanService;
import com.mortals.xhx.module.workman.model.WorkmanEntity;
import com.mortals.xhx.module.workman.model.WorkmanQuery;
import com.mortals.xhx.module.workman.service.WorkmanService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -51,6 +55,12 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -51,6 +55,12 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
private String loginName; private String loginName;
@Value("${token.password:'admin'}") @Value("${token.password:'admin'}")
private String password; private String password;
@Autowired
private WorkmanService workmanService;
@Autowired
private DeviceFileService deviceFileService;
@Autowired
private DeviceWorkmanService deviceWorkmanService;
public DeviceController() { public DeviceController() {
super.setModuleDesc("设备"); super.setModuleDesc("设备");
...@@ -63,9 +73,26 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe ...@@ -63,9 +73,26 @@ public class DeviceController extends BaseCRUDJsonBodyMappingController<DeviceSe
this.addDict(model, "source", paramService.getParamBySecondOrganize("Device", "source")); this.addDict(model, "source", paramService.getParamBySecondOrganize("Device", "source"));
this.addDict(model, "enabled", EnabledEnum.getEnumMap()); this.addDict(model, "enabled", EnabledEnum.getEnumMap());
this.addDict(model, "workmanId", workmanService.find(new WorkmanQuery()).stream().collect(Collectors.toMap(x -> x.getId().toString(), y -> y.getName(), (o, n) -> n)));
super.init(model, context); super.init(model, context);
} }
@Override
protected int editAfter(Long id, Map<String, Object> model, DeviceEntity entity, Context context) throws AppException {
List<DeviceFileEntity> deviceFileEntities = deviceFileService.find(new DeviceFileQuery().deviceId(entity.getId()));
if (!ObjectUtils.isEmpty(deviceFileEntities)) {
entity.setDeviceFileEntityList(deviceFileEntities);
}
List<DeviceWorkmanEntity> deviceWorkmanEntityList = deviceWorkmanService.find(new DeviceWorkmanQuery().deviceId(entity.getId()));
if (!ObjectUtils.isEmpty(deviceWorkmanEntityList)) {
entity.setDeviceWorkmanEntityList(deviceWorkmanEntityList);
}
return super.editAfter(id, model, entity, context);
}
/** /**
* 设备获取信息 * 设备获取信息
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment