提交代码
parent
482a7322bf
commit
78325d3fbd
|
@ -37,4 +37,14 @@ public interface RemoteFileService
|
|||
*/
|
||||
@PostMapping(value = "/upload/{proPackage}/dirs/{dirs}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<SysFile> dirsUploadFile(@PathVariable("proPackage") String proPackage, @PathVariable("dirs") String dirs, @RequestPart(value = "file") MultipartFile file);
|
||||
|
||||
/**
|
||||
* 指定上传文件
|
||||
* @param proPackage 项目包
|
||||
* @param dirs 目录
|
||||
* @param file 文件
|
||||
* @return
|
||||
*/
|
||||
@PostMapping(value = "/upload/{proPackage}/dirs/{dirs}/date/{datePath}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
|
||||
public R<SysFile> dirDatePathUploadFile(@PathVariable("proPackage") String proPackage, @PathVariable("dirs") String dirs, @PathVariable("datePath") String datePath, @RequestPart(value = "file") MultipartFile file);
|
||||
}
|
||||
|
|
|
@ -36,6 +36,12 @@ public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileServ
|
|||
{
|
||||
return R.fail("上传文件失败:" + throwable.getMessage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public R<SysFile> dirDatePathUploadFile(String proPackage, String dirs, String datePath, MultipartFile file)
|
||||
{
|
||||
return R.fail("上传文件失败:" + throwable.getMessage());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,33 +18,43 @@ const findTowerConfigListByProjectId = (data) => {
|
|||
};
|
||||
|
||||
// 查询塔基运行统计
|
||||
const findTowerStatisticsView = (deviceSn) => {
|
||||
const findTowerStatisticsView = (proId,deviceSn) => {
|
||||
return request({
|
||||
url: `/manage/bgscreen/tower/findTowerStatisticsView?deviceKey=${deviceSn}`,
|
||||
url: `/manage/bgscreen/tower/findTowerStatisticsView?projectId=${proId}&deviceSn=${deviceSn}`,
|
||||
method: "get",
|
||||
});
|
||||
};
|
||||
|
||||
// 查询塔基限位数据
|
||||
const selectDevTowerDataLimitList = (deviceSn) => {
|
||||
const selectDevTowerDataLimitList = (proId,deviceSn) => {
|
||||
return request({
|
||||
url: `/manage/bgscreen/tower/selectDevTowerDataLimitList?deviceKey=${deviceSn}&pageNum=1&pageSize=10`,
|
||||
url: `/manage/bgscreen/tower/selectDevTowerDataLimitList?projectId=${proId}&deviceKey=${deviceSn}`,
|
||||
method: "get",
|
||||
});
|
||||
};
|
||||
|
||||
// 查询塔基实时数据
|
||||
const selectDevTowerDataRunList = (deviceSn) => {
|
||||
const selectDevTowerDataRunList = (proId,deviceSn) => {
|
||||
return request({
|
||||
url: `manage/bgscreen/tower/selectDevTowerDataRunList?deviceKey=${deviceSn}&pageNum=1&pageSize=10`,
|
||||
url: `manage/bgscreen/tower/selectDevTowerDataRunList?projectId=${proId}&deviceKey=${deviceSn}`,
|
||||
method: "get",
|
||||
});
|
||||
};
|
||||
|
||||
// 查询塔基实时数据
|
||||
const findDevTowerDataWarningDatas = (query) => {
|
||||
return request({
|
||||
url: `manage/bgscreen/tower/findDevTowerDataWarningDatas`,
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
};
|
||||
|
||||
export default {
|
||||
findTowerConfigGroupOnline,
|
||||
findTowerConfigListByProjectId,
|
||||
findTowerStatisticsView,
|
||||
selectDevTowerDataLimitList,
|
||||
selectDevTowerDataRunList,
|
||||
findDevTowerDataWarningDatas
|
||||
};
|
||||
|
|
|
@ -34,15 +34,29 @@
|
|||
</el-row>
|
||||
|
||||
<el-row style="height: 160px; overflow: hidden" :key="chart1Key">
|
||||
<staff-survey-chart :height="chart1Height" :unit="'个'" :data="towerConfigView" width="100%"></staff-survey-chart>
|
||||
<staff-survey-chart
|
||||
:height="chart1Height"
|
||||
:unit="'个'"
|
||||
:data="towerConfigView"
|
||||
width="100%"
|
||||
></staff-survey-chart>
|
||||
</el-row>
|
||||
|
||||
<el-row class="left-data-list">
|
||||
<div class="warning-info-title" style="padding-left: 20px; position: relative; z-index: 9">
|
||||
<div
|
||||
class="warning-info-title"
|
||||
style="padding-left: 20px; position: relative; z-index: 9"
|
||||
>
|
||||
<div :class="'active'">监控列表</div>
|
||||
</div>
|
||||
<div class="drv-list scroll" id="listMin">
|
||||
<div v-for="(it, idx) in towerConfigList" :key="idx" class="drv-item list-for" :class="index == idx ? 'active' : ''" @click="onTowerCraneList(idx)">
|
||||
<div
|
||||
v-for="(it, idx) in towerConfigList"
|
||||
:key="idx"
|
||||
class="drv-item list-for"
|
||||
:class="index == idx ? 'active' : ''"
|
||||
@click="onTowerCraneList(idx)"
|
||||
>
|
||||
<div class="item-content">
|
||||
<div class="dev-row1">
|
||||
<div class="survey_content">
|
||||
|
@ -62,10 +76,11 @@
|
|||
</div>
|
||||
<div class="data-row">
|
||||
<span class="sp-label">设备状态:</span>
|
||||
<span class="sp-value" :class="it.online == 2 ? 'is-offline' : 'is-online'">
|
||||
{{
|
||||
it.online == 2 ? "离线" : "在线"
|
||||
}}
|
||||
<span
|
||||
class="sp-value"
|
||||
:class="it.online == 2 ? 'is-offline' : 'is-online'"
|
||||
>
|
||||
{{ it.online == 2 ? "离线" : "在线" }}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -111,7 +126,10 @@
|
|||
<el-col :span="16" class="h100">
|
||||
<el-row class="total-data">
|
||||
<el-col :span="6">
|
||||
<div class="warning-info-title" style="padding-left: 20px; position: relative; z-index: 9">
|
||||
<div
|
||||
class="warning-info-title"
|
||||
style="padding-left: 20px; position: relative; z-index: 9"
|
||||
>
|
||||
<div :class="'active'">吊重次数({{ towerConfigStat.a0 }}次)</div>
|
||||
<div class="title-bg"></div>
|
||||
</div>
|
||||
|
@ -128,7 +146,10 @@
|
|||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="warning-info-title" style="padding-left: 20px; position: relative; z-index: 9">
|
||||
<div
|
||||
class="warning-info-title"
|
||||
style="padding-left: 20px; position: relative; z-index: 9"
|
||||
>
|
||||
<div :class="'active'">超载次数({{ towerConfigStat.b0 }}次)</div>
|
||||
<div class="title-bg"></div>
|
||||
</div>
|
||||
|
@ -145,24 +166,36 @@
|
|||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="warning-info-title" style="padding-left: 20px; position: relative; z-index: 9">
|
||||
<div :class="'active'">超载率({{ getRoudValue(towerConfigStat.b0, towerConfigStat.a0) }})</div>
|
||||
<div
|
||||
class="warning-info-title"
|
||||
style="padding-left: 20px; position: relative; z-index: 9"
|
||||
>
|
||||
<div :class="'active'">
|
||||
超载率({{ getRoudValue(towerConfigStat.b0, towerConfigStat.a0) }})
|
||||
</div>
|
||||
<div class="title-bg"></div>
|
||||
</div>
|
||||
<div class="data-row2">
|
||||
<div class="data-row2-col">
|
||||
<div class="s-text">本月</div>
|
||||
<div class="s-number">{{ getRoudValue(towerConfigStat.b1, towerConfigStat.a1) }}</div>
|
||||
<div class="s-number">
|
||||
{{ getRoudValue(towerConfigStat.b1, towerConfigStat.a1) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="data-row2-col">
|
||||
<div class="s-text">累计</div>
|
||||
<div class="s-number">{{ getRoudValue(towerConfigStat.b0, towerConfigStat.a0) }}</div>
|
||||
<div class="s-number">
|
||||
{{ getRoudValue(towerConfigStat.b0, towerConfigStat.a0) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="6">
|
||||
<div class="warning-info-title" style="padding-left: 20px; position: relative; z-index: 9">
|
||||
<div
|
||||
class="warning-info-title"
|
||||
style="padding-left: 20px; position: relative; z-index: 9"
|
||||
>
|
||||
<div :class="'active'">告警次数(10次)</div>
|
||||
<div class="title-bg"></div>
|
||||
</div>
|
||||
|
@ -183,7 +216,11 @@
|
|||
<div class="safe-tower-crane-min" style="position: relative">
|
||||
<el-row class="row-crane-min">
|
||||
<el-col :span="2">
|
||||
<div class="safe-tower-left" v-if="towerConfigList.length > 1" @click="safeTowerLeft"></div>
|
||||
<div
|
||||
class="safe-tower-left"
|
||||
v-if="towerConfigList.length > 1"
|
||||
@click="safeTowerLeft"
|
||||
></div>
|
||||
</el-col>
|
||||
<el-col :span="20">
|
||||
<div class="safe-tower-content-max">
|
||||
|
@ -208,7 +245,11 @@
|
|||
</div>
|
||||
</el-col>
|
||||
<el-col :span="2">
|
||||
<div class="safe-tower-right" v-if="towerConfigList.length > 1" @click="safeTowerRight"></div>
|
||||
<div
|
||||
class="safe-tower-right"
|
||||
v-if="towerConfigList.length > 1"
|
||||
@click="safeTowerRight"
|
||||
></div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -226,18 +267,21 @@
|
|||
<div class="afoot-overflow safe-afoot-overflow" id="afootOverflow">
|
||||
<div v-if="warningData.length == 0" class="not-data">暂无预警数据</div>
|
||||
|
||||
<div v-if="warningData.length > 0" class="quality-table special-table scroll" style="padding:0px;" :key="tbHeight">
|
||||
<el-table :data="warningData" class="mytable" style="width: 100%;background: transparent;" :height="tbHeight" ref="fbsubordinateUnit">
|
||||
<el-table-column prop="createTime" label="发送时间"></el-table-column>
|
||||
<el-table-column label="预警类型">
|
||||
<template slot-scope="scope">
|
||||
<div class="tag-group">
|
||||
<template v-for="(item, idx) in dicts">
|
||||
<el-tag :key="idx" v-if="dic(item.value, scope.row.warnings)" type="danger" effect="dark">{{ item.label }}</el-tag>
|
||||
</template>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<div
|
||||
v-if="warningData.length > 0"
|
||||
class="quality-table special-table scroll"
|
||||
style="padding: 0px"
|
||||
:key="tbHeight"
|
||||
>
|
||||
<el-table
|
||||
:data="warningData"
|
||||
class="mytable"
|
||||
style="width: 100%; background: transparent"
|
||||
:height="tbHeight"
|
||||
ref="fbsubordinateUnit"
|
||||
>
|
||||
<el-table-column prop="createTime" label="发生时间" />
|
||||
<el-table-column prop="warnNote" label="预警内容" />
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -248,7 +292,13 @@
|
|||
<div class="analyse-text">力矩曲线</div>
|
||||
</div>
|
||||
<div class="safe-moment">
|
||||
<my-chart :key="itemChartKey1" id="project-tower-crane-item2" width="100%" height="100%" :render="o => renderDataItem2(o)"></my-chart>
|
||||
<my-chart
|
||||
:key="itemChartKey1"
|
||||
id="project-tower-crane-item2"
|
||||
width="100%"
|
||||
height="100%"
|
||||
:render="(o) => renderDataItem2(o)"
|
||||
></my-chart>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -256,7 +306,12 @@
|
|||
</el-row>
|
||||
|
||||
<el-row class="dev-info-list">
|
||||
<el-col :span="4" class="dev-info-item" v-for="(it, idx) in devBottomInfo" :key="idx">
|
||||
<el-col
|
||||
:span="4"
|
||||
class="dev-info-item"
|
||||
v-for="(it, idx) in devBottomInfo"
|
||||
:key="idx"
|
||||
>
|
||||
<div class="info-item-content">
|
||||
<div class="row-1">
|
||||
<span class="sp-title">{{ it.title }}</span>
|
||||
|
@ -272,9 +327,12 @@
|
|||
<div v-for="i in 10" :key="i" class="scale-item"></div>
|
||||
</div>
|
||||
<span class="sp-data1 sp-data sp-sc">报警:{{ it.data1 }}</span>
|
||||
<span class="sp-data2 sp-data sp-sc" v-if="it.data2 >= 5" :style="calcTop(it)">
|
||||
报警:{{
|
||||
it.data2 }}
|
||||
<span
|
||||
class="sp-data2 sp-data sp-sc"
|
||||
v-if="it.data2 >= 5"
|
||||
:style="calcTop(it)"
|
||||
>
|
||||
报警:{{ it.data2 }}
|
||||
</span>
|
||||
<span class="sp-sc2 sp-sc">{{ it.scale2 }}</span>
|
||||
</div>
|
||||
|
@ -286,46 +344,46 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import debounce from 'lodash.debounce'
|
||||
import '@/components/tower-crane-value-1'
|
||||
import '@/components/tower-crane-value-2'
|
||||
import debounce from "lodash.debounce";
|
||||
import "@/components/tower-crane-value-1";
|
||||
import "@/components/tower-crane-value-2";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
tbHeight: 290,
|
||||
itemChartKey1: 0,
|
||||
chart1Key: 0,
|
||||
chart1Height: '200px',
|
||||
dpi: '',
|
||||
chart1Height: "200px",
|
||||
dpi: "",
|
||||
selProject: null,
|
||||
index: 0,
|
||||
towerConfigView: [],
|
||||
towerConfigList: [],
|
||||
towerConfigStat: { a0: 0, b0: 0, c0: 0, a1: 0, b1: 0, c1: 0 },
|
||||
runData: {
|
||||
height: '0',
|
||||
range: '0',
|
||||
rotation: '0',
|
||||
load: '0',
|
||||
windSpeed: '0',
|
||||
leanAngleX: '0',
|
||||
leanAngleY: '0',
|
||||
loadPercent: '0',
|
||||
momentPercent: '0',
|
||||
windSpeedPercent: '0',
|
||||
height: "0",
|
||||
range: "0",
|
||||
rotation: "0",
|
||||
load: "0",
|
||||
windSpeed: "0",
|
||||
leanAngleX: "0",
|
||||
leanAngleY: "0",
|
||||
loadPercent: "0",
|
||||
momentPercent: "0",
|
||||
windSpeedPercent: "0",
|
||||
warnings: null,
|
||||
},
|
||||
selDev: {},
|
||||
devBottomInfo: [
|
||||
{ title: '幅度', data1: 0, data2: 0, scale1: '0', scale2: '0m' },
|
||||
{ title: '风速', data1: 0, data2: 0, scale1: '0', scale2: '0m' },
|
||||
{ title: '吊重', data1: 0, data2: 0, scale1: '0', scale2: '0m' },
|
||||
{ title: '倾角', data1: 0, data2: 0, scale1: '0', scale2: '0m' },
|
||||
{ title: '转角', data1: 0, data2: 0, scale1: '0', scale2: '0m' },
|
||||
{ title: '高度', data1: 0, data2: 0, scale1: '0', scale2: '0m' },
|
||||
{ title: "幅度", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "风速", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "吊重", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "倾角", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "转角", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
{ title: "高度", data1: 0, data2: 0, scale1: "0", scale2: "0m" },
|
||||
],
|
||||
direction: 'right',
|
||||
comName: 'tower-crane-value-1',
|
||||
direction: "right",
|
||||
comName: "tower-crane-value-1",
|
||||
warningData: [],
|
||||
momentData: {},
|
||||
forIndex: 0,
|
||||
|
@ -336,291 +394,301 @@ export default {
|
|||
prjs: [],
|
||||
project: null,
|
||||
dicts: [],
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
window.safetyApp = this
|
||||
this.$store.dispatch('ChangeNav', 304)
|
||||
this.$bus.$on('projectChange', (prj) => {
|
||||
this.selProject = prj
|
||||
this.init()
|
||||
})
|
||||
this.selProject = this.$store.getters.selProject
|
||||
this.init()
|
||||
this.dpi = this.$dpi()
|
||||
this.resize()
|
||||
window.addEventListener('resize', () => {
|
||||
window.safetyApp = this;
|
||||
this.$store.dispatch("ChangeNav", 304);
|
||||
this.$bus.$on("projectChange", (prj) => {
|
||||
this.selProject = prj;
|
||||
this.init();
|
||||
});
|
||||
this.selProject = this.$store.getters.selProject;
|
||||
this.init();
|
||||
this.dpi = this.$dpi();
|
||||
this.resize();
|
||||
window.addEventListener("resize", () => {
|
||||
if (this.dpi != this.$dpi()) {
|
||||
this.dpi = this.$dpi()
|
||||
this.resize()
|
||||
this.dpi = this.$dpi();
|
||||
this.resize();
|
||||
}
|
||||
})
|
||||
this.$api.dict('ssp_proble_sub_type').then((d) => {
|
||||
this.dangerTypeDict = d || []
|
||||
})
|
||||
});
|
||||
this.$api.dict("ssp_proble_sub_type").then((d) => {
|
||||
this.dangerTypeDict = d || [];
|
||||
});
|
||||
this.momentData = JSON.parse(
|
||||
'{"point":[[null,null]],"dataX":[15,20,25,30,35,40,45,50,55,60],"dataY":[3,3,3,3,2.59,2.2,1.9,1.66,1.46,1.3]}'
|
||||
)
|
||||
);
|
||||
},
|
||||
created() {
|
||||
this.$api.dict('device_tower_warning').then((d) => {
|
||||
this.dicts = d || []
|
||||
console.log('---->', this.dicts)
|
||||
})
|
||||
this.$api.dict("device_tower_warning").then((d) => {
|
||||
this.dicts = d || [];
|
||||
console.log("---->", this.dicts);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
resize() {
|
||||
this.chart1Key++
|
||||
this.itemChartKey1++
|
||||
let is1K = this.$dpi() == '1K'
|
||||
let is2K = this.$dpi() == '2K'
|
||||
this.tbHeight = is1K ? 290 : is2K ? 410 : 770
|
||||
this.chart1Key++;
|
||||
this.itemChartKey1++;
|
||||
let is1K = this.$dpi() == "1K";
|
||||
let is2K = this.$dpi() == "2K";
|
||||
this.tbHeight = is1K ? 290 : is2K ? 410 : 770;
|
||||
},
|
||||
init() {
|
||||
if (!this.selProject) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
this.initTowerConfigView()
|
||||
this.initTowerConfigList()
|
||||
this.initTowerConfigView();
|
||||
this.initTowerConfigList();
|
||||
},
|
||||
getRoudValue(a, b) {
|
||||
if (a > 0) {
|
||||
return (parseFloat(a / b) * 100).toFixed(1) + '%'
|
||||
return (parseFloat(a / b) * 100).toFixed(1) + "%";
|
||||
} else {
|
||||
return '0%'
|
||||
return "0%";
|
||||
}
|
||||
},
|
||||
initTowerConfigView() {
|
||||
let postData = {
|
||||
comId: this.selProject.comId,
|
||||
projectId: this.selProject.id,
|
||||
}
|
||||
};
|
||||
this.$api.tower.findTowerConfigGroupOnline(postData).then((d) => {
|
||||
let list = []
|
||||
let total = 0
|
||||
let list = [];
|
||||
let total = 0;
|
||||
if (d.data && d.data.length > 0) {
|
||||
d.data.forEach((datum) => {
|
||||
total += datum.total
|
||||
total += datum.total;
|
||||
if (datum.online == 1) {
|
||||
list.push({ text: '在线数量', value: datum.total })
|
||||
list.push({ text: "在线数量", value: datum.total });
|
||||
if (d.data.length == 1) {
|
||||
list.push({ text: '离线数量', value: 0 })
|
||||
list.push({ text: "离线数量", value: 0 });
|
||||
}
|
||||
} else {
|
||||
list.push({ text: '离线数量', value: datum.total })
|
||||
list.push({ text: "离线数量", value: datum.total });
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
this.towerTotalNum = total
|
||||
this.towerConfigView = list
|
||||
})
|
||||
this.towerTotalNum = total;
|
||||
this.towerConfigView = list;
|
||||
});
|
||||
},
|
||||
initTowerConfigList() {
|
||||
let postData = {
|
||||
comdId: this.selProject.comId,
|
||||
projectId: this.selProject.id,
|
||||
}
|
||||
};
|
||||
this.$api.tower.findTowerConfigListByProjectId(postData).then((d) => {
|
||||
this.towerConfigList = d.data || []
|
||||
this.towerConfigList = d.data || [];
|
||||
if (d.data.length > 0) {
|
||||
this.initSelDev(this.index)
|
||||
this.initSelDev(this.index);
|
||||
} else {
|
||||
this.runData.height = '0'
|
||||
this.runData.range = '0'
|
||||
this.runData.rotation = '0'
|
||||
this.runData.load = '0'
|
||||
this.runData.windSpeed = '0'
|
||||
this.runData.leanAngleX = '0'
|
||||
this.runData.leanAngleY = '0'
|
||||
this.runData.loadPercent = '0'
|
||||
this.runData.momentPercent = '0'
|
||||
this.runData.windSpeedPercent = '0'
|
||||
this.runData.warnings = null
|
||||
this.devBottomInfo[0].data1 = 0
|
||||
this.devBottomInfo[1].data1 = 0
|
||||
this.devBottomInfo[2].data1 = 0
|
||||
this.devBottomInfo[3].data1 = 0
|
||||
this.devBottomInfo[4].data1 = 0
|
||||
this.devBottomInfo[5].data1 = 0
|
||||
this.devBottomInfo[0].data2 = 0
|
||||
this.devBottomInfo[1].data2 = 0
|
||||
this.devBottomInfo[2].data2 = 0
|
||||
this.devBottomInfo[3].data2 = 0
|
||||
this.devBottomInfo[4].data2 = 0
|
||||
this.devBottomInfo[5].data2 = 0
|
||||
this.towerConfigStat.a0 = 0
|
||||
this.towerConfigStat.b0 = 0
|
||||
this.towerConfigStat.c0 = 0
|
||||
this.towerConfigStat.a1 = 0
|
||||
this.towerConfigStat.b1 = 0
|
||||
this.towerConfigStat.c1 = 0
|
||||
this.warningData = []
|
||||
this.selDev = { deviceName: '未找到设备', frontBrachium: 0, afterBrachium: 0 }
|
||||
this.runData.height = "0";
|
||||
this.runData.range = "0";
|
||||
this.runData.rotation = "0";
|
||||
this.runData.load = "0";
|
||||
this.runData.windSpeed = "0";
|
||||
this.runData.leanAngleX = "0";
|
||||
this.runData.leanAngleY = "0";
|
||||
this.runData.loadPercent = "0";
|
||||
this.runData.momentPercent = "0";
|
||||
this.runData.windSpeedPercent = "0";
|
||||
this.runData.warnings = null;
|
||||
this.devBottomInfo[0].data1 = 0;
|
||||
this.devBottomInfo[1].data1 = 0;
|
||||
this.devBottomInfo[2].data1 = 0;
|
||||
this.devBottomInfo[3].data1 = 0;
|
||||
this.devBottomInfo[4].data1 = 0;
|
||||
this.devBottomInfo[5].data1 = 0;
|
||||
this.devBottomInfo[0].data2 = 0;
|
||||
this.devBottomInfo[1].data2 = 0;
|
||||
this.devBottomInfo[2].data2 = 0;
|
||||
this.devBottomInfo[3].data2 = 0;
|
||||
this.devBottomInfo[4].data2 = 0;
|
||||
this.devBottomInfo[5].data2 = 0;
|
||||
this.towerConfigStat.a0 = 0;
|
||||
this.towerConfigStat.b0 = 0;
|
||||
this.towerConfigStat.c0 = 0;
|
||||
this.towerConfigStat.a1 = 0;
|
||||
this.towerConfigStat.b1 = 0;
|
||||
this.towerConfigStat.c1 = 0;
|
||||
this.warningData = [];
|
||||
this.selDev = { deviceName: "未找到设备", frontBrachium: 0, afterBrachium: 0 };
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
dic(ds, value) {
|
||||
if (value.split(',').indexOf(ds) > -1) {
|
||||
return true
|
||||
if (value.split(",").indexOf(ds) > -1) {
|
||||
return true;
|
||||
} else {
|
||||
return false
|
||||
return false;
|
||||
}
|
||||
},
|
||||
initSelDev(n) {
|
||||
this.selDev = this.towerConfigList[this.index]
|
||||
this.initLimitData()
|
||||
this.initRunData()
|
||||
this.selDev = this.towerConfigList[this.index];
|
||||
this.initLimitData();
|
||||
this.initRunData();
|
||||
//正在发生 定时器
|
||||
clearInterval(this.warningInterval)
|
||||
this.warningInterval = setInterval(this.initRunData, 60000)
|
||||
this.initCountData()
|
||||
clearInterval(this.countvwInterval)
|
||||
this.countvwInterval = setInterval(this.initCountData, 60000)
|
||||
clearInterval(this.warningInterval);
|
||||
this.warningInterval = setInterval(this.initRunData, 30000);
|
||||
this.initCountData();
|
||||
clearInterval(this.countvwInterval);
|
||||
this.countvwInterval = setInterval(this.initCountData, 30000);
|
||||
},
|
||||
initCountData() {
|
||||
this.$api.tower.findTowerStatisticsView(this.selDev.deviceSn).then((d) => {
|
||||
this.towerConfigStat = d.data || []
|
||||
})
|
||||
this.$api.tower.findTowerStatisticsView(this.selProject.id, this.selDev.deviceSn).then((d) => {
|
||||
this.towerConfigStat = d.data || [];
|
||||
});
|
||||
},
|
||||
initLimitData() {
|
||||
this.$api.tower.selectDevTowerDataLimitList(this.selDev.deviceSn).then((d) => {
|
||||
this.$api.tower.selectDevTowerDataLimitList(this.selProject.id,this.selDev.deviceSn).then((d) => {
|
||||
if (d.length > 0) {
|
||||
this.devBottomInfo[0].data2 = d.data[0].rangeLimitStart
|
||||
this.devBottomInfo[1].data2 = d.data[0].windSpeedWarning
|
||||
this.devBottomInfo[2].data2 = d.data[0].loadWarning
|
||||
this.devBottomInfo[3].data2 = d.data[0].leanWarning
|
||||
this.devBottomInfo[4].data2 = d.data[0].rotationLimitStart
|
||||
this.devBottomInfo[5].data2 = d.data[0].highLimitWarning
|
||||
this.devBottomInfo[0].data2 = d.data[0].rangeLimitStart;
|
||||
this.devBottomInfo[1].data2 = d.data[0].windSpeedWarning;
|
||||
this.devBottomInfo[2].data2 = d.data[0].loadWarning;
|
||||
this.devBottomInfo[3].data2 = d.data[0].leanWarning;
|
||||
this.devBottomInfo[4].data2 = d.data[0].rotationLimitStart;
|
||||
this.devBottomInfo[5].data2 = d.data[0].highLimitWarning;
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
initRunData() {
|
||||
this.$api.tower.selectDevTowerDataRunList(this.selDev.deviceSn).then((d) => {
|
||||
this.$api.tower.selectDevTowerDataRunList(this.selProject.id,this.selDev.deviceSn).then((d) => {
|
||||
if (d.data.length > 0) {
|
||||
this.runData.height = d.data[0].height
|
||||
this.runData.range = d.data[0].range
|
||||
this.runData.rotation = d.data[0].rotation
|
||||
this.runData.load = d.data[0].load
|
||||
this.runData.windSpeed = d.data[0].windSpeed
|
||||
this.runData.leanAngleX = d.data[0].leanAngleX
|
||||
this.runData.leanAngleY = d.data[0].leanAngleY
|
||||
this.runData.loadPercent = d.data[0].loadPercent
|
||||
this.runData.momentPercent = d.data[0].momentPercent
|
||||
this.runData.windSpeedPercent = d.data[0].windSpeedPercent
|
||||
this.runData.warnings = d.data[0].warnings
|
||||
this.devBottomInfo[0].data1 = d.data[0].range
|
||||
this.devBottomInfo[1].data1 = d.data[0].windSpeed
|
||||
this.devBottomInfo[2].data1 = d.data[0].load
|
||||
this.devBottomInfo[3].data1 = d.data[0].leanAnglePercent ? d.data[0].leanAnglePercent : 0
|
||||
this.devBottomInfo[4].data1 = d.data[0].rotation
|
||||
this.devBottomInfo[5].data1 = d.data[0].height
|
||||
this.runData.height = d.data[0].height;
|
||||
this.runData.range = d.data[0].range;
|
||||
this.runData.rotation = d.data[0].rotation;
|
||||
this.runData.load = d.data[0].load;
|
||||
this.runData.windSpeed = d.data[0].windSpeed;
|
||||
this.runData.leanAngleX = d.data[0].leanAngleX;
|
||||
this.runData.leanAngleY = d.data[0].leanAngleY;
|
||||
this.runData.loadPercent = d.data[0].loadPercent;
|
||||
this.runData.momentPercent = d.data[0].momentPercent;
|
||||
this.runData.windSpeedPercent = d.data[0].windSpeedPercent;
|
||||
this.runData.warnings = d.data[0].warnings;
|
||||
this.devBottomInfo[0].data1 = d.data[0].range;
|
||||
this.devBottomInfo[1].data1 = d.data[0].windSpeed;
|
||||
this.devBottomInfo[2].data1 = d.data[0].load;
|
||||
this.devBottomInfo[3].data1 = d.data[0].leanAnglePercent
|
||||
? d.data[0].leanAnglePercent
|
||||
: 0;
|
||||
this.devBottomInfo[4].data1 = d.data[0].rotation;
|
||||
this.devBottomInfo[5].data1 = d.data[0].height;
|
||||
}
|
||||
this.warningData = d.data || []
|
||||
});
|
||||
// 查询塔机预警数据
|
||||
this.$api.tower
|
||||
.findDevTowerDataWarningDatas({
|
||||
projectId: this.selProject.id,
|
||||
deviceKey: this.selDev.deviceSn,
|
||||
})
|
||||
.then((d) => {
|
||||
this.warningData = d.data || [];
|
||||
});
|
||||
},
|
||||
calcTop(d) {
|
||||
let tmp = 100 - (d.data2 * 100.0) / d.data1
|
||||
return `top:calc(20px + ${tmp > 78 ? 78 : tmp}%)`
|
||||
let tmp = 100 - (d.data2 * 100.0) / d.data1;
|
||||
return `top:calc(20px + ${tmp > 78 ? 78 : tmp}%)`;
|
||||
},
|
||||
getRoudValue(a, b) {
|
||||
if (a > 0) {
|
||||
return (parseFloat(a / b) * 100).toFixed(1) + '%'
|
||||
return (parseFloat(a / b) * 100).toFixed(1) + "%";
|
||||
} else {
|
||||
return '0%'
|
||||
return "0%";
|
||||
}
|
||||
},
|
||||
safeTowerLeft() {
|
||||
this.direction = 'left'
|
||||
this.automaticRoll()
|
||||
this.direction = "left";
|
||||
this.automaticRoll();
|
||||
},
|
||||
safeTowerRight() {
|
||||
//切换动画
|
||||
this.direction = 'right'
|
||||
this.automaticRoll()
|
||||
this.direction = "right";
|
||||
this.automaticRoll();
|
||||
},
|
||||
automaticRoll() {
|
||||
//切换动画
|
||||
if (this.direction == 'right') {
|
||||
if (this.direction == "right") {
|
||||
if (this.index == this.towerConfigList.length - 1) {
|
||||
this.index = 0
|
||||
this.index = 0;
|
||||
} else {
|
||||
this.index = this.index + 1
|
||||
this.index = this.index + 1;
|
||||
}
|
||||
} else {
|
||||
if (this.index == 0) {
|
||||
this.index = this.towerConfigList.length - 1
|
||||
this.index = this.towerConfigList.length - 1;
|
||||
} else {
|
||||
this.index = this.index - 1
|
||||
this.index = this.index - 1;
|
||||
}
|
||||
}
|
||||
this.selDev = this.towerConfigList[this.index]
|
||||
var height = $('.list-for').innerHeight()
|
||||
$('#listMin').animate({ scrollTop: height * this.index + 'px' })
|
||||
this.selDev = this.towerConfigList[this.index];
|
||||
var height = $(".list-for").innerHeight();
|
||||
$("#listMin").animate({ scrollTop: height * this.index + "px" });
|
||||
},
|
||||
onTowerCraneList(n) {
|
||||
this.index = n
|
||||
this.selDev = this.towerConfigList[this.index]
|
||||
this.initLimitData()
|
||||
this.initCountData()
|
||||
this.index = n;
|
||||
this.selDev = this.towerConfigList[this.index];
|
||||
this.initLimitData();
|
||||
this.initCountData();
|
||||
//切换动画
|
||||
this.direction = 'right'
|
||||
this.direction = "right";
|
||||
},
|
||||
safeAutomaticRoll() {
|
||||
var height = $('.safe-afoot-overflow').innerHeight()
|
||||
console.log(height)
|
||||
var height = $(".safe-afoot-overflow").innerHeight();
|
||||
console.log(height);
|
||||
if (this.forIndex == this.warningData.length) {
|
||||
this.forIndex = 0
|
||||
this.forIndex = 0;
|
||||
} else {
|
||||
this.forIndex = this.forIndex + 1
|
||||
this.forIndex = this.forIndex + 1;
|
||||
}
|
||||
$('#afootOverflow').animate({ scrollTop: height * this.forIndex + 'px' })
|
||||
$("#afootOverflow").animate({ scrollTop: height * this.forIndex + "px" });
|
||||
},
|
||||
warningListMinMouseover() {
|
||||
clearInterval(this.warningInterval)
|
||||
clearInterval(this.warningInterval);
|
||||
},
|
||||
warningListMinMouseout() {
|
||||
this.warningInterval = setInterval(this.safeAutomaticRoll, 10000)
|
||||
this.warningInterval = setInterval(this.safeAutomaticRoll, 10000);
|
||||
},
|
||||
renderDataItem2(o) {
|
||||
let data = this.momentData
|
||||
var color = '#20bc00'
|
||||
var Xmax = Math.max.apply(null, data.dataX)
|
||||
var Ymax = Math.max.apply(null, data.dataY)
|
||||
let is1K = this.$dpi() == '1K'
|
||||
let is2K = this.$dpi() == '2K'
|
||||
let data = this.momentData;
|
||||
var color = "#20bc00";
|
||||
var Xmax = Math.max.apply(null, data.dataX);
|
||||
var Ymax = Math.max.apply(null, data.dataY);
|
||||
let is1K = this.$dpi() == "1K";
|
||||
let is2K = this.$dpi() == "2K";
|
||||
|
||||
let option = {
|
||||
tooltip: {
|
||||
position: 'top',
|
||||
position: "top",
|
||||
formatter: function (params) {
|
||||
var fd = params.data[0]
|
||||
var dz = params.data[1]
|
||||
var fd = params.data[0];
|
||||
var dz = params.data[1];
|
||||
res =
|
||||
'<div style="padding: 5px 10px;">' +
|
||||
'<div style="padding-bottom: 5px;">幅度:<span>' +
|
||||
fd +
|
||||
'</span> m</div>' +
|
||||
'<div>吊重:<span>' +
|
||||
"</span> m</div>" +
|
||||
"<div>吊重:<span>" +
|
||||
dz +
|
||||
'</span> t</div>' +
|
||||
'</div>'
|
||||
return res
|
||||
"</span> t</div>" +
|
||||
"</div>";
|
||||
return res;
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: '20%',
|
||||
right: '15%',
|
||||
left: '4%',
|
||||
bottom: '5%',
|
||||
top: "20%",
|
||||
right: "15%",
|
||||
left: "4%",
|
||||
bottom: "5%",
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: [
|
||||
{
|
||||
type: 'value',
|
||||
name: '幅度/m',
|
||||
type: "value",
|
||||
name: "幅度/m",
|
||||
max: 60,
|
||||
nameTextStyle: {
|
||||
color: '#c5d9fc',
|
||||
color: "#c5d9fc",
|
||||
fontSize: is1K ? 12 : is2K ? 14 : 24,
|
||||
},
|
||||
splitLine: {
|
||||
|
@ -631,29 +699,29 @@ export default {
|
|||
axisLabel: {
|
||||
//坐标轴刻度标签的相关设置
|
||||
textStyle: {
|
||||
color: '#c5d9fc',
|
||||
color: "#c5d9fc",
|
||||
margin: 20,
|
||||
fontSize: 30,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
type: 'category',
|
||||
type: "category",
|
||||
boundaryGap: false,
|
||||
position: 'bottom',
|
||||
position: "bottom",
|
||||
axisLine: {
|
||||
//坐标轴轴线相关设置。数学上的x轴
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#194e92',
|
||||
type: 'dashed',
|
||||
color: "#194e92",
|
||||
type: "dashed",
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
show: false,
|
||||
//坐标轴刻度标签的相关设置
|
||||
textStyle: {
|
||||
color: '#c5d9fc',
|
||||
color: "#c5d9fc",
|
||||
margin: 20,
|
||||
fontSize: 30,
|
||||
},
|
||||
|
@ -663,13 +731,13 @@ export default {
|
|||
],
|
||||
yAxis: [
|
||||
{
|
||||
name: '吊重/t',
|
||||
name: "吊重/t",
|
||||
nameTextStyle: {
|
||||
color: '#c5d9fc',
|
||||
color: "#c5d9fc",
|
||||
fontSize: is1K ? 12 : is2K ? 14 : 24,
|
||||
},
|
||||
max: Ymax + 1,
|
||||
type: 'value',
|
||||
type: "value",
|
||||
splitNumber: 7,
|
||||
splitLine: {
|
||||
show: false,
|
||||
|
@ -678,14 +746,14 @@ export default {
|
|||
//坐标轴轴线相关设置。数学上的x轴
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: '#194e92',
|
||||
type: 'dashed',
|
||||
color: "#194e92",
|
||||
type: "dashed",
|
||||
},
|
||||
},
|
||||
axisLabel: {
|
||||
margin: 20,
|
||||
textStyle: {
|
||||
color: '#c5d9fc',
|
||||
color: "#c5d9fc",
|
||||
fontSize: is1K ? 12 : is2K ? 14 : 18,
|
||||
},
|
||||
},
|
||||
|
@ -694,14 +762,14 @@ export default {
|
|||
],
|
||||
series: [
|
||||
{
|
||||
name: '吊重',
|
||||
type: 'effectScatter',
|
||||
name: "吊重",
|
||||
type: "effectScatter",
|
||||
rippleEffect: {
|
||||
// 设置涟漪动画样式
|
||||
color: 'purple', // 涟漪颜色,默认为散点自身颜色
|
||||
brushType: 'fill', // 动画方式,全填充或只有线条,'stroke' 'fill'
|
||||
color: "purple", // 涟漪颜色,默认为散点自身颜色
|
||||
brushType: "fill", // 动画方式,全填充或只有线条,'stroke' 'fill'
|
||||
period: 2, //动画周期
|
||||
scale: '3', //涟漪规模
|
||||
scale: "3", //涟漪规模
|
||||
},
|
||||
xAxisIndex: 0,
|
||||
yAxisIndex: 0,
|
||||
|
@ -712,15 +780,15 @@ export default {
|
|||
data: data.point,
|
||||
},
|
||||
{
|
||||
type: 'line',
|
||||
symbol: 'none',
|
||||
type: "line",
|
||||
symbol: "none",
|
||||
smooth: true,
|
||||
xAxisIndex: 1,
|
||||
yAxisIndex: 0,
|
||||
lineStyle: {
|
||||
normal: {
|
||||
width: 3,
|
||||
color: '#5968db', // 线条颜色
|
||||
color: "#5968db", // 线条颜色
|
||||
},
|
||||
},
|
||||
areaStyle: {
|
||||
|
@ -733,23 +801,23 @@ export default {
|
|||
0,
|
||||
1,
|
||||
[
|
||||
{ offset: 0, color: 'rgb(25,43,115,0.9)' },
|
||||
{ offset: 0.7, color: 'rgba(25,43,115, 0)' },
|
||||
{ offset: 0, color: "rgb(25,43,115,0.9)" },
|
||||
{ offset: 0.7, color: "rgba(25,43,115, 0)" },
|
||||
],
|
||||
false
|
||||
),
|
||||
|
||||
shadowColor: 'rgba(25,43,115, 1)', //阴影颜色
|
||||
shadowColor: "rgba(25,43,115, 1)", //阴影颜色
|
||||
},
|
||||
},
|
||||
data: data.dataY,
|
||||
},
|
||||
],
|
||||
}
|
||||
return option
|
||||
};
|
||||
return option;
|
||||
},
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
|
@ -830,7 +898,6 @@ export default {
|
|||
.dev-row1 {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.survey_content {
|
||||
.survey_content_img {
|
||||
.svg-icon {
|
||||
|
|
|
@ -16,7 +16,8 @@ module.exports = defineConfig({
|
|||
proxy: {
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
"/dev-api": {
|
||||
target: "http://localhost:8080",
|
||||
//target: "http://localhost:8080",
|
||||
target: 'http://62.234.3.186/prod-api/',
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/dev-api": "/",
|
||||
|
|
|
@ -78,12 +78,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||
return parseDateToStr(format, new Date());
|
||||
}
|
||||
|
||||
public static final String date(final Date date)
|
||||
public static final String dateStr(final Date date)
|
||||
{
|
||||
return parseDateToStr(YYYY_MM_DD, date);
|
||||
}
|
||||
|
||||
public static final String dateTime(final Date date)
|
||||
public static final String dateTimeStr(final Date date)
|
||||
{
|
||||
return parseDateToStr(YYYY_MM_DD_HH_MM_SS, date);
|
||||
}
|
||||
|
@ -114,6 +114,14 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
|
|||
return DateFormatUtils.format(now, "yyyy/MM/dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期路径 即年/月/日 如2018/08/08
|
||||
*/
|
||||
public static final String datePath(Date date)
|
||||
{
|
||||
return DateFormatUtils.format(date, "yyyy/MM/dd");
|
||||
}
|
||||
|
||||
/**
|
||||
* 日期格式字符串
|
||||
*/
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.yanzhu.device.mapper;
|
||||
|
||||
import com.yanzhu.device.domain.DevTowerDataRound;
|
||||
import com.yanzhu.device.domain.DevTowerDataWarning;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -59,4 +60,12 @@ public interface DevTowerDataWarningMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteDevTowerDataWarningByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 查询塔机预警数据
|
||||
*
|
||||
* @param devTowerDataWarning 设备预警信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int findWarningCountByDeviceKey(DevTowerDataWarning devTowerDataWarning);
|
||||
}
|
||||
|
|
|
@ -69,7 +69,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevTowerDataCollideList" parameterType="DevTowerDataCollide" resultMap="DevTowerDataCollideResult">
|
||||
<include refid="selectDevTowerDataCollideVo"/>
|
||||
<where>
|
||||
dtdc.is_del=0
|
||||
<if test="cfgId != null">and dtdc.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdc.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdc.com_id = #{comId}</if>
|
||||
|
@ -82,6 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceSource != null and deviceSource != ''"> and dtdc.device_source = #{deviceSource}</if>
|
||||
<if test="towerId != null and towerId != ''"> and dtdc.tower_id = #{towerId}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdc.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdc.is_del=0
|
||||
</where>
|
||||
order by dtdc.id desc
|
||||
</select>
|
||||
|
|
|
@ -70,7 +70,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevTowerDataLimitList" parameterType="DevTowerDataLimit" resultMap="DevTowerDataLimitResult">
|
||||
<include refid="selectDevTowerDataLimitVo"/>
|
||||
<where>
|
||||
dtdl.is_del=0
|
||||
<if test="cfgId != null">and dtdl.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdl.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdl.com_id = #{comId}</if>
|
||||
|
@ -83,6 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceSource != null and deviceSource != ''"> and dtdl.device_source = #{deviceSource}</if>
|
||||
<if test="towerId != null and towerId != ''"> and dtdl.tower_id = #{towerId}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdl.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdl.is_del=0
|
||||
</where>
|
||||
order by dtdl.id desc
|
||||
</select>
|
||||
|
|
|
@ -84,7 +84,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevTowerDataLocalList" parameterType="DevTowerDataLocal" resultMap="DevTowerDataLocalResult">
|
||||
<include refid="selectDevTowerDataLocalVo"/>
|
||||
<where>
|
||||
dtdl.is_del=0
|
||||
<if test="cfgId != null">and dtdl.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdl.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdl.com_id = #{comId}</if>
|
||||
|
@ -97,6 +96,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceSource != null and deviceSource != ''"> and dtdl.device_source = #{deviceSource}</if>
|
||||
<if test="towerId != null and towerId != ''"> and dtdl.tower_id = #{towerId}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdl.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdl.is_del=0
|
||||
</where>
|
||||
order by dtdl.id desc
|
||||
</select>
|
||||
|
|
|
@ -101,7 +101,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectDevTowerDataRoundList" parameterType="DevTowerDataRound" resultMap="DevTowerDataRoundResult">
|
||||
<include refid="selectDevTowerDataRoundVo"/>
|
||||
<where>
|
||||
dtdr.is_del=0
|
||||
<if test="cfgId != null">and dtdr.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdr.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdr.com_id = #{comId}</if>
|
||||
|
@ -114,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="deviceSource != null and deviceSource != ''"> and dtdr.device_source = #{deviceSource}</if>
|
||||
<if test="towerId != null and towerId != ''"> and dtdr.tower_id = #{towerId}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdr.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdr.is_del=0
|
||||
</where>
|
||||
order by dtdr.id desc
|
||||
</select>
|
||||
|
|
|
@ -242,10 +242,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="findRunCountByDeviceKey" parameterType="DevTowerDataRound" resultType="Int">
|
||||
select count(1) as total from dev_tower_data_run
|
||||
<where>
|
||||
is_del=0
|
||||
<if test="deviceKey != null and deviceKey != ''">and cfg_id in (select dc.id from dev_tower_project_config dc where dc.device_sn=#{deviceKey}) and device_key = #{deviceKey}</if>
|
||||
<if test='activeName == "gj"'> and is_alarm = 1 </if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and date(create_time) between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and is_del=0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
|
|
|
@ -43,13 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
dtdw.project_id,
|
||||
dtdw.com_id,
|
||||
sp.project_name as projectName,
|
||||
sd.dept_name as com_name, dtdw.dept_id,
|
||||
sd.dept_name as com_name,
|
||||
dtdw.dept_id,
|
||||
dtdw.device_key,
|
||||
dtdw.device_source,
|
||||
dtdw.tower_id,
|
||||
dtdw.warn_type,
|
||||
dtdw.warn_name,
|
||||
dtdw.warn_note,
|
||||
IFNULL(dtdw.warn_note,sdd.dict_label) as warn_note,
|
||||
dtdw.height,
|
||||
dtdw.range,
|
||||
dtdw.rotation,
|
||||
|
@ -67,14 +68,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
dtdw.update_time,
|
||||
dtdw.remark
|
||||
from dev_tower_data_warning dtdw
|
||||
left join sys_dept sp on sp.dept_id = dtdw.project_id
|
||||
left join pro_project_info sp on sp.id = dtdw.project_id
|
||||
left join sys_dept sd on sd.dept_id = dtdw.com_id
|
||||
left join sys_dict_data sdd on sdd.dict_value = dtdw.warn_type and sdd.dict_type = 'device_tower_warning'
|
||||
</sql>
|
||||
|
||||
<select id="selectDevTowerDataWarningList" parameterType="DevTowerDataWarning" resultMap="DevTowerDataWarningResult">
|
||||
<include refid="selectDevTowerDataWarningVo"/>
|
||||
<where>
|
||||
dtdw.is_del=0
|
||||
<if test="cfgId != null">and dtdw.cfg_id = #{cfgId}</if>
|
||||
<if test="projectId != null "> and dtdw.project_id = #{projectId}</if>
|
||||
<if test="comId != null "> and dtdw.com_id = #{comId}</if>
|
||||
|
@ -88,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="towerId != null and towerId != ''"> and dtdw.tower_id = #{towerId}</if>
|
||||
<if test="warnType != null "> and dtdw.warn_type = #{warnType}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and dtdw.create_time between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and dtdw.is_del=0
|
||||
</where>
|
||||
order by dtdw.id desc
|
||||
</select>
|
||||
|
@ -200,4 +202,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="findWarningCountByDeviceKey" parameterType="DevTowerDataWarning" resultType="Int">
|
||||
select count(1) as total from dev_tower_data_warning
|
||||
<where>
|
||||
<if test="deviceKey != null and deviceKey != ''">and device_key = #{deviceKey}</if>
|
||||
<if test="params.beginCreateTime != null and params.beginCreateTime != '' and params.endCreateTime != null and params.endCreateTime != ''"> and date(create_time) between #{params.beginCreateTime} and #{params.endCreateTime}</if>
|
||||
and is_del=0
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
|
@ -112,6 +112,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors))
|
||||
))
|
||||
</if>
|
||||
<if test="remark != null and remark != ''">
|
||||
AND u.remark like concat('%', #{remark}, '%')
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
${params.dataScope}
|
||||
</select>
|
||||
|
|
|
@ -100,7 +100,7 @@ public class SysFileController
|
|||
* 文件上传请求
|
||||
*/
|
||||
@PostMapping("/upload/{proPackage}/dirs/{dirs}")
|
||||
public R<SysFile> dirsUploadFile(@PathVariable("busKey") String proPackage, @PathVariable("dirs") String dirs, MultipartFile file)
|
||||
public R<SysFile> dirsUploadFile(@PathVariable("proPackage") String proPackage, @PathVariable("dirs") String dirs, MultipartFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -119,6 +119,29 @@ public class SysFileController
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传请求
|
||||
*/
|
||||
@PostMapping("/upload/{proPackage}/dirs/{dirs}/date/{datePath}")
|
||||
public R<SysFile> dirDatePathUploadFile(@PathVariable("proPackage") String proPackage, @PathVariable("dirs") String dirs, @PathVariable("datePath") String datePath, MultipartFile file)
|
||||
{
|
||||
try
|
||||
{
|
||||
String catalog = "/"+proPackage+"/"+dirs;
|
||||
// 上传并返回访问地址
|
||||
String url = sysFileService.dirsUploadFile(catalog,datePath,file);
|
||||
SysFile sysFile = new SysFile();
|
||||
sysFile.setName(FileUtils.getName(url));
|
||||
sysFile.setUrl(url);
|
||||
return R.ok(sysFile);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.error("上传文件失败", e);
|
||||
return R.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件通用下载...
|
||||
* @param fileName
|
||||
|
|
|
@ -53,6 +53,20 @@ public class FastDfsSysFileServiceImpl implements ISysFileService
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param dirs 文件目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 时间地址
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String dirsUploadFile(String dirs, String datePath, MultipartFile file) throws Exception{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 签名文件上传接口
|
||||
*
|
||||
|
|
|
@ -28,6 +28,17 @@ public interface ISysFileService
|
|||
*/
|
||||
public String dirsUploadFile(String dirs, MultipartFile file) throws Exception;
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param dirs 文件目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 时间地址
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
public String dirsUploadFile(String dirs, String datePath, MultipartFile file) throws Exception;
|
||||
|
||||
/**
|
||||
* 签名文件上传接口
|
||||
*
|
||||
|
|
|
@ -58,7 +58,22 @@ public class LocalSysFileServiceImpl implements ISysFileService
|
|||
@Override
|
||||
public String dirsUploadFile(String dirs, MultipartFile file) throws Exception{
|
||||
String name = FileUploadUtils.upload(localFilePath+dirs, file);
|
||||
return localFilePrefix + name;
|
||||
return localFilePrefix + dirs+ "/" + name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param dirs 文件目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 时间地址
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String dirsUploadFile(String dirs, String datePath, MultipartFile file) throws Exception{
|
||||
String name = FileUploadUtils.upload(localFilePath+dirs, datePath, file);
|
||||
return localFilePrefix + dirs+ "/" + name;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -56,6 +56,20 @@ public class MinioSysFileServiceImpl implements ISysFileService
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传接口
|
||||
*
|
||||
* @param dirs 文件目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 时间地址
|
||||
* @return 访问地址
|
||||
* @throws Exception
|
||||
*/
|
||||
@Override
|
||||
public String dirsUploadFile(String dirs, String datePath, MultipartFile file) throws Exception{
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 签名文件上传接口
|
||||
*
|
||||
|
|
|
@ -64,6 +64,27 @@ public class FileUploadUtils
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件路径上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param datePath 上传的时间目录
|
||||
* @return 文件名称
|
||||
* @throws IOException
|
||||
*/
|
||||
public static final String upload(String baseDir, String datePath, MultipartFile file) throws IOException
|
||||
{
|
||||
try
|
||||
{
|
||||
return upload(baseDir, datePath, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new IOException(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据文件路径上传
|
||||
*
|
||||
|
@ -117,6 +138,39 @@ public class FileUploadUtils
|
|||
return getPathFileName(fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
* @param baseDir 相对应用的基目录
|
||||
* @param file 上传的文件
|
||||
* @param allowedExtension 上传文件类型
|
||||
* @return 返回上传成功的文件名
|
||||
* @throws FileSizeLimitExceededException 如果超出最大大小
|
||||
* @throws FileNameLengthLimitExceededException 文件名太长
|
||||
* @throws IOException 比如读写文件出错时
|
||||
* @throws InvalidExtensionException 文件校验异常
|
||||
*/
|
||||
public static final String upload(String baseDir, String datePath, MultipartFile file, String[] allowedExtension)
|
||||
throws FileSizeLimitExceededException, IOException, FileNameLengthLimitExceededException,
|
||||
InvalidExtensionException
|
||||
{
|
||||
int fileNamelength = Objects.requireNonNull(file.getOriginalFilename()).length();
|
||||
if (fileNamelength > FileUploadUtils.DEFAULT_FILE_NAME_LENGTH)
|
||||
{
|
||||
throw new FileNameLengthLimitExceededException(FileUploadUtils.DEFAULT_FILE_NAME_LENGTH);
|
||||
}
|
||||
|
||||
assertAllowed(file, allowedExtension);
|
||||
|
||||
String fileName = extractFilename(datePath, file);
|
||||
|
||||
String absPath = getAbsoluteFile(baseDir, fileName).getAbsolutePath();
|
||||
file.transferTo(Paths.get(absPath));
|
||||
// 压缩图片
|
||||
makeMiniImage(absPath);
|
||||
return getPathFileName(fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文件上传
|
||||
*
|
||||
|
@ -266,6 +320,16 @@ public class FileUploadUtils
|
|||
MD5Utils.md5Hex(FilenameUtils.getBaseName(file.getOriginalFilename()),"utf-8"), Seq.getId(Seq.uploadSeqType), FileTypeUtils.getExtension(file));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码文件名
|
||||
*/
|
||||
public static final String extractFilename(String dateStr, MultipartFile file)
|
||||
{
|
||||
String datePath = DateUtils.datePath(DateUtils.parseDate(dateStr));
|
||||
return StringUtils.format("{}/{}_{}.{}", datePath,
|
||||
MD5Utils.md5Hex(FilenameUtils.getBaseName(file.getOriginalFilename()),"utf-8"), Seq.getId(Seq.uploadSeqType), FileTypeUtils.getExtension(file));
|
||||
}
|
||||
|
||||
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
|
||||
{
|
||||
File desc = new File(uploadDir + File.separator + fileName);
|
||||
|
|
|
@ -14,6 +14,7 @@ import com.yanzhu.common.core.utils.Md5Utils;
|
|||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.common.core.utils.file.FileUtils;
|
||||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.*;
|
||||
import com.yanzhu.job.service.*;
|
||||
import com.yanzhu.system.api.RemoteFileService;
|
||||
|
@ -32,7 +33,7 @@ import java.util.*;
|
|||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @Description: 济公网数据定时任务
|
||||
* @Description: 济工网数据定时任务
|
||||
* @Title: AttendanceJgwTask
|
||||
* @Package com.yanzhu.job.task
|
||||
* @Author: JiangYuQi
|
||||
|
@ -80,7 +81,7 @@ public class AttendanceJgwTask {
|
|||
* @return
|
||||
*/
|
||||
public static String getToken(String appid, String secret) {
|
||||
log.info("开始查询济公网TOKEN...{}::{}",appid,secret);
|
||||
log.info("开始查询济工网TOKEN...{}::{}",appid,secret);
|
||||
String grantType = "client_credential";
|
||||
String path = "/webapi/credential";
|
||||
Map<String, Object> params = new HashMap<>();
|
||||
|
@ -105,7 +106,7 @@ public class AttendanceJgwTask {
|
|||
* 同步单位及班组信息
|
||||
*/
|
||||
public void syncContractorAndGroupData() {
|
||||
log.info("开始同步济公网单位&班组信息...{}",DateUtils.dateTimeStr());
|
||||
log.info("开始同步济工网单位&班组信息...{}",DateUtils.dateTimeStr());
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
where.setEnabled(ShiFouEnums.SHI.getCode());
|
||||
where.setIsDel(ShiFouEnums.FOU.getCode());
|
||||
|
@ -139,7 +140,7 @@ public class AttendanceJgwTask {
|
|||
* @param it 配置信息
|
||||
*/
|
||||
private void doSyncProContractor(JSONObject jo, long startId, QuartzProAttendanceCfg it) {
|
||||
log.info("开始同步济公参建单位信息...rows::{}",startId);
|
||||
log.info("开始同步济工网参建单位信息...rows::{}",startId);
|
||||
String appId = jo.getString("appId");
|
||||
String token = jo.getString("token");
|
||||
String projectId = jo.getString("appProjectId");
|
||||
|
@ -207,6 +208,22 @@ public class AttendanceJgwTask {
|
|||
}else{
|
||||
redisService.setCacheObject("doSyncProContractor.contractorId::"+json.getString("contractorId"),list.get(0),2L,TimeUnit.HOURS);
|
||||
}
|
||||
}else{
|
||||
QuartzProSubdepts quartzProSubdepts = new QuartzProSubdepts();
|
||||
quartzProSubdepts.setComId(it.getComId());
|
||||
quartzProSubdepts.setProjectId(it.getProjectId());
|
||||
quartzProSubdepts.setSubDeptType(subDeptType);
|
||||
quartzProSubdepts.setSubDeptName(json.getString("corpName"));
|
||||
quartzProSubdepts.setSubDeptCode(json.getString("corpCode"));
|
||||
quartzProSubdepts.setSubDeptLeaderName(json.getString("pmName"));
|
||||
quartzProSubdepts.setSubDeptLeaderPhone(json.getString("pmPhone"));
|
||||
quartzProSubdepts.setUseStatus(UseStateEnums.IN.getCode());
|
||||
quartzProSubdepts.setUseDates(DateUtils.getNowDate());
|
||||
quartzProSubdepts.setApproveStatus(ApproveStatus.passed.getCode());
|
||||
quartzProSubdepts.setSource(code.toUpperCase()+"::"+json.getString("contractorId"));
|
||||
quartzProSubdepts.setCreateBy("JGW-TASK");
|
||||
quartzProSubdepts.setCreateTime(DateUtils.getNowDate());
|
||||
redisService.setCacheObject("doSyncProContractor.contractorId::"+json.getString("contractorId"),quartzProSubdepts,2L,TimeUnit.HOURS);
|
||||
}
|
||||
}
|
||||
if (arr.size()>=10 && rowId > 0) {
|
||||
|
@ -247,7 +264,7 @@ public class AttendanceJgwTask {
|
|||
* @param it 配置信息
|
||||
*/
|
||||
private void doSyncDirectlyUnderGroup(JSONObject jo, long startId, QuartzProAttendanceCfg it) {
|
||||
log.info("开始同步济公直属班组信息...rows::{}",startId);
|
||||
log.info("开始同步济工网直属班组信息...rows::{}",startId);
|
||||
String appId = jo.getString("appId");
|
||||
String token = jo.getString("token");
|
||||
String projectId = jo.getString("appProjectId");
|
||||
|
@ -278,6 +295,7 @@ public class AttendanceJgwTask {
|
|||
long rowId = 0;
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
//log.info("doSyncDirectlyUnderGroup...{}"+json);
|
||||
Map<String, String> dataMap = convertSubJobTypes(json.getString("corpType"));
|
||||
QuartzProSubdeptsGroup quartzProSubdeptsGroupQuery = new QuartzProSubdeptsGroup();
|
||||
quartzProSubdeptsGroupQuery.setProjectId(it.getProjectId());
|
||||
|
@ -330,6 +348,11 @@ public class AttendanceJgwTask {
|
|||
*/
|
||||
private Map<String, String> convertSubJobTypes(String jobTypes){
|
||||
Map<String, String> dataMap = new HashMap<>();
|
||||
if(StringUtils.isEmpty(jobTypes)){
|
||||
dataMap.put("type","3");
|
||||
dataMap.put("post","4037");
|
||||
return dataMap;
|
||||
}
|
||||
switch (jobTypes){
|
||||
case "3001" : dataMap.put("type","2");dataMap.put("post","1015"); break;
|
||||
case "3002" : dataMap.put("type","2");dataMap.put("post","1014"); break;
|
||||
|
@ -500,7 +523,7 @@ public class AttendanceJgwTask {
|
|||
* 同步人员信息
|
||||
*/
|
||||
public void syncProSubDeptWorker() {
|
||||
log.info("开始同步济公网人员信息...{}",DateUtils.dateTimeStr());
|
||||
log.info("开始同步济工网人员信息...{}",DateUtils.dateTimeStr());
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
|
@ -529,7 +552,7 @@ public class AttendanceJgwTask {
|
|||
* 同步人员信息
|
||||
*/
|
||||
private void doSyncProSubDeptWorker(JSONObject jo, long startId, QuartzProAttendanceCfg it) {
|
||||
log.info("开始同步济公网人员信息...rows::{}",startId);
|
||||
log.info("开始同步济工网人员信息...rows::{}",startId);
|
||||
String appId = jo.getString("appId");
|
||||
String token = jo.getString("token");
|
||||
String projectId = jo.getString("appProjectId");
|
||||
|
@ -557,6 +580,7 @@ public class AttendanceJgwTask {
|
|||
if (arr.size() > 0) {
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
//log.info("doSyncProSubDeptWorker...{}",json);
|
||||
QuartzProSubdeptsUsers quartzProSubdeptsUsersQuery = new QuartzProSubdeptsUsers();
|
||||
quartzProSubdeptsUsersQuery.setProjectId(it.getProjectId());
|
||||
quartzProSubdeptsUsersQuery.setUserPhone(json.getString("workPhone"));
|
||||
|
@ -593,7 +617,7 @@ public class AttendanceJgwTask {
|
|||
quartzProSubdeptsUsers.setUserSex(json.getString("sex"));
|
||||
Map<String, String> userInfos = new HashMap<>();
|
||||
userInfos.put("nation",json.getString("minor"));
|
||||
userInfos.put("birthDay",DateUtils.date(DateUtils.parseDate(json.getString("birthday"))));
|
||||
userInfos.put("birthDay",DateUtils.dateStr(DateUtils.parseDate(json.getString("birthday"))));
|
||||
long idStr = Long.parseLong(quartzProSubdeptsUsers.getCardCode().substring(0, 6));
|
||||
String natStr = getNative(idStr);
|
||||
userInfos.put("nativePlace",natStr);
|
||||
|
@ -605,7 +629,9 @@ public class AttendanceJgwTask {
|
|||
userInfos.put("bankOffice",json.getString("branchName"));
|
||||
userInfos.put("cardImgPos",cardImgPos);
|
||||
userInfos.put("cardImgInv",cardImgInv);
|
||||
quartzProSubdeptsUsers.setUserInfos(JSON.toJSONString(userInfos));
|
||||
quartzProSubdeptsUsers.setUserPicture(userPicture);
|
||||
quartzProSubdeptsUsers.setUserPhone(json.getString("workPhone"));
|
||||
String adminCraftPost = convertAdminType(json.getString("adminType"));
|
||||
if(StringUtils.isEmpty(adminCraftPost)){
|
||||
//判断是否有岗位2
|
||||
|
@ -640,6 +666,9 @@ public class AttendanceJgwTask {
|
|||
* @return
|
||||
*/
|
||||
private String convertAdminType(String adminType){
|
||||
if(StringUtils.isEmpty(adminType)){
|
||||
return "";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(adminType)){
|
||||
String craftPost = "";
|
||||
switch (adminType){
|
||||
|
@ -680,6 +709,9 @@ public class AttendanceJgwTask {
|
|||
* @return
|
||||
*/
|
||||
private String convertJobType2(String jobType2){
|
||||
if(StringUtils.isEmpty(jobType2)){
|
||||
return "";
|
||||
}
|
||||
if(StringUtils.isNotEmpty(jobType2)){
|
||||
String craftPost = "";
|
||||
switch (jobType2){
|
||||
|
@ -712,9 +744,11 @@ public class AttendanceJgwTask {
|
|||
sysUser.setUserName(quartzProSubdeptsUsers.getUserPhone());
|
||||
sysUser.setNickName(quartzProSubdeptsUsers.getUserName());
|
||||
sysUser.setPhonenumber(quartzProSubdeptsUsers.getUserPhone());
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(sysUser.getPhonenumber()+"@jgw"));
|
||||
sysUser.setUpdateBy("JGW-TASK");
|
||||
sysUser.setUpdateTime(DateUtils.getNowDate());
|
||||
sysUser.setUserInfos(quartzProSubdeptsUsers.getUserInfos());
|
||||
sysUser.setRemark(quartzProSubdeptsUsers.getSource());
|
||||
|
||||
String subDeptType = quartzProSubdeptsUsers.getSubDeptType();
|
||||
// 判断单位类型
|
||||
|
@ -854,7 +888,7 @@ public class AttendanceJgwTask {
|
|||
* 同步之前考勤数据
|
||||
*/
|
||||
public void syncBeforeAttendanceData(String dtStart, String dtEnd, Long cfgId) {
|
||||
log.info("开始同步济公网人员考勤信息...{}::{}::{}",dtStart,dtEnd,cfgId);
|
||||
log.info("开始同步济工网人员考勤信息...{}::{}::{}",dtStart,dtEnd,cfgId);
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
where.setEnabled(1l);
|
||||
where.setIsDel(0l);
|
||||
|
@ -873,10 +907,20 @@ public class AttendanceJgwTask {
|
|||
secret = Base64.encode(secret);
|
||||
jo.put("secret", secret);
|
||||
String token = getToken(appId, secret);
|
||||
|
||||
Calendar startCalendar = Calendar.getInstance();
|
||||
startCalendar.setTime(DateUtils.parseDate(dtStart));
|
||||
|
||||
Calendar endCalendar = Calendar.getInstance();
|
||||
endCalendar.setTime(DateUtils.parseDate(dtEnd));
|
||||
while (startCalendar.before(endCalendar)){
|
||||
String findTimes = DateUtils.dateStr(startCalendar.getTime());
|
||||
jo.put("token", token);
|
||||
jo.put("startTime", dtStart);
|
||||
jo.put("endTime", dtEnd);
|
||||
jo.put("startTime", findTimes);
|
||||
jo.put("endTime", findTimes);
|
||||
doSyncAttendanceData(jo, "0", it);
|
||||
startCalendar.add(Calendar.DAY_OF_MONTH, 1);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
|
@ -888,7 +932,7 @@ public class AttendanceJgwTask {
|
|||
* 同步当前考勤数据
|
||||
*/
|
||||
public void syncNowAttendanceData() {
|
||||
log.info("开始同步济公网人员考勤信息...{}",DateUtils.dateTimeStr());
|
||||
log.info("开始同步济工网人员考勤信息...{}",DateUtils.dateTimeStr());
|
||||
String dtStart = DateUtils.getDate();
|
||||
String dtEnd = DateUtils.getDate();
|
||||
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
|
||||
|
@ -924,7 +968,7 @@ public class AttendanceJgwTask {
|
|||
* @param it
|
||||
*/
|
||||
private void doSyncAttendanceData(JSONObject jo, String startId, QuartzProAttendanceCfg it) {
|
||||
log.info("开始同步济公网人员考勤数据...rows:{}",startId);
|
||||
log.info("开始同步济工网人员考勤数据...rows:{}",startId);
|
||||
String appId = jo.getString("appId");
|
||||
String token = jo.getString("token");
|
||||
String projectId = jo.getString("appProjectId");
|
||||
|
@ -955,6 +999,7 @@ public class AttendanceJgwTask {
|
|||
if (arr != null && arr.size() > 0) {
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject json = arr.getJSONObject(i);
|
||||
String datePath = json.getString("signDate");
|
||||
String machineType = Convert.toStr(json.getString("machineType"),"1");
|
||||
QuartzProSubdeptsUsers quartzProSubdeptsUsersQuery = new QuartzProSubdeptsUsers();
|
||||
quartzProSubdeptsUsersQuery.setProjectId(it.getProjectId());
|
||||
|
@ -974,23 +1019,23 @@ public class AttendanceJgwTask {
|
|||
//签进
|
||||
if(quartzProAttendanceData.getOutTime()==null && quartzProAttendanceData.getInData()==null){
|
||||
quartzProAttendanceData.setInTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
}
|
||||
}else if(machineType.equals("3")){
|
||||
//签出
|
||||
quartzProAttendanceData.setOutTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setOutPhoto(checkPhoto);
|
||||
}else{
|
||||
//默认
|
||||
if(quartzProAttendanceData.getInData()==null){
|
||||
quartzProAttendanceData.setInTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
}else{
|
||||
quartzProAttendanceData.setOutTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setOutPhoto(checkPhoto);
|
||||
}
|
||||
}
|
||||
|
@ -1015,17 +1060,17 @@ public class AttendanceJgwTask {
|
|||
if(machineType.equals("2")){
|
||||
//签进
|
||||
quartzProAttendanceData.setInTime(checkinTime);
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
}else if(machineType.equals("3")){
|
||||
//签出
|
||||
quartzProAttendanceData.setOutTime(checkinTime);
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setOutPhoto(checkPhoto);
|
||||
}else{
|
||||
//默认
|
||||
quartzProAttendanceData.setInTime(checkinTime);
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), json.getString("signimg"));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
}
|
||||
quartzProAttendanceData.setDeviceNo(json.getString("deviceSerialNo"));
|
||||
|
@ -1042,12 +1087,21 @@ public class AttendanceJgwTask {
|
|||
|
||||
/**
|
||||
* 查询照片
|
||||
* @param appId
|
||||
* @param token
|
||||
* @param photo
|
||||
* @param appId 应用
|
||||
* @param token 令牌
|
||||
* @param proPackage 项目目录
|
||||
* @param datePath 时间地址
|
||||
* @param photo 照片地址
|
||||
* @return
|
||||
*/
|
||||
private String getPhoto(String appId, String token, String proPackage, String photo) {
|
||||
private String getPhoto(String appId, String token, String proPackage, String datePath, String photo) {
|
||||
try {
|
||||
MultipartFile multipartFile = FileUtils.downloadFileToMultipart("https://gymspic1.oss-cn-shanghai.aliyuncs.com/"+photo);
|
||||
return remoteFileService.dirDatePathUploadFile(proPackage,"jgw",datePath, multipartFile).getData().getUrl();
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
/**try {
|
||||
String path = "/webapi/dictInfo/getPhoyoAllPaths";
|
||||
String time = System.currentTimeMillis() + "";
|
||||
String url = JGW_HOST + path + "?appId=" + appId + "&tokenSign=" + token + "×tamp=" + time;
|
||||
|
@ -1065,13 +1119,12 @@ public class AttendanceJgwTask {
|
|||
String data = getResult(request);
|
||||
JSONObject j = JSON.parseObject(data);
|
||||
JSONObject json = j.getJSONObject("data");
|
||||
try {
|
||||
MultipartFile multipartFile = FileUtils.downloadFileToMultipart(json.getString("result"));
|
||||
R<SysFile> result = remoteFileService.dirsUploadFile(proPackage,"jgw",multipartFile);
|
||||
R<SysFile> result = remoteFileService.dirDatePathUploadFile(proPackage, "jgw", datePath, multipartFile);
|
||||
return result.getData().getUrl();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}*/
|
||||
return "";
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
|
||||
<sql id="selectProAttendanceCfgVo">
|
||||
select pac.id, pac.com_id, pac.project_id, pac.vendors_code, pac.vendors_parameter, pac.enabled, pac.state, pac.remark, pac.is_del, pac.create_by, pac.create_time, pac.update_by
|
||||
, pac.update_time, dp.`dept_name` as comp_name, pp.`project_name`, pp.project_package as dic.`dict_label` as vendors_name, sd.sub_dept_name as dept_name, pac.dept_id
|
||||
, pac.update_time, dp.`dept_name` as comp_name, pp.`project_name`, pp.project_package, dic.`dict_label` as vendors_name, sd.sub_dept_name as dept_name, pac.dept_id
|
||||
from attendance_cfg pac
|
||||
left join sys_dept dp on pac.`com_id` = dp.`dept_id`
|
||||
left join pro_project_info pp on pac.`project_id` = pp.`id`
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.yanzhu.common.core.web.controller.BaseController;
|
|||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.device.domain.DevTowerDataLimit;
|
||||
import com.yanzhu.device.domain.DevTowerDataRun;
|
||||
import com.yanzhu.device.domain.DevTowerDataWarning;
|
||||
import com.yanzhu.device.domain.DevTowerProjectConfig;
|
||||
import com.yanzhu.manage.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -42,6 +43,9 @@ public class TowerCraneController extends BaseController {
|
|||
@Autowired
|
||||
private IDevTowerDataCollideService devTowerDataCollideService;
|
||||
|
||||
@Autowired
|
||||
private IDevTowerDataWarningService devTowerDataWarningService;
|
||||
|
||||
@Autowired
|
||||
private IDevTowerProjectConfigService devTowerProjectConfigService;
|
||||
|
||||
|
@ -87,7 +91,7 @@ public class TowerCraneController extends BaseController {
|
|||
@GetMapping("/selectDevTowerDataLimitList")
|
||||
public AjaxResult selectDevTowerDataLimitList(DevTowerDataLimit devTowerDataLimit)
|
||||
{
|
||||
startPage();
|
||||
startPage(1,1);
|
||||
devTowerDataLimit.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode()));
|
||||
List<DevTowerDataLimit> list = devTowerDataLimitService.selectDevTowerDataLimitList(devTowerDataLimit);
|
||||
return success(list);
|
||||
|
@ -99,9 +103,20 @@ public class TowerCraneController extends BaseController {
|
|||
@GetMapping("/selectDevTowerDataRunList")
|
||||
public AjaxResult selectDevTowerDataRunList(DevTowerDataRun devTowerDataRun)
|
||||
{
|
||||
startPage();
|
||||
startPage(1,1);
|
||||
devTowerDataRun.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode()));
|
||||
List<DevTowerDataRun> list = devTowerDataRunService.selectDevTowerDataRunList(devTowerDataRun);
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询塔基实时数据
|
||||
*/
|
||||
@GetMapping("/findDevTowerDataWarningDatas")
|
||||
public AjaxResult findDevTowerDataWarningDatas(DevTowerDataWarning devTowerDataWarning)
|
||||
{
|
||||
startPage(1,10);
|
||||
List<DevTowerDataWarning> list = devTowerDataWarningService.selectDevTowerDataWarningList(devTowerDataWarning);
|
||||
return success(list);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,9 +4,11 @@ import com.yanzhu.common.core.utils.DateUtils;
|
|||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.device.domain.DevTowerDataRound;
|
||||
import com.yanzhu.device.domain.DevTowerDataRun;
|
||||
import com.yanzhu.device.domain.DevTowerDataWarning;
|
||||
import com.yanzhu.device.mapper.DevTowerDataCollideMapper;
|
||||
import com.yanzhu.device.mapper.DevTowerDataRoundMapper;
|
||||
import com.yanzhu.device.mapper.DevTowerDataRunMapper;
|
||||
import com.yanzhu.device.mapper.DevTowerDataWarningMapper;
|
||||
import com.yanzhu.manage.service.IDevTowerDataRunService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
@ -32,6 +34,9 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
|
|||
@Autowired
|
||||
private DevTowerDataRoundMapper devTowerDataRoundMapper;
|
||||
|
||||
@Autowired
|
||||
private DevTowerDataWarningMapper devTowerDataWarningMapper;
|
||||
|
||||
@Autowired
|
||||
private DevTowerDataCollideMapper devTowerDataCollideMapper;
|
||||
|
||||
|
@ -129,8 +134,9 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
|
|||
devTowerDataRound.setActiveName("cz");
|
||||
int b0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("b0",b0);
|
||||
devTowerDataRound.setActiveName("gj");
|
||||
int c0 = devTowerDataRunMapper.findRunCountByDeviceKey(devTowerDataRound);
|
||||
DevTowerDataWarning devTowerDataWarning = new DevTowerDataWarning();
|
||||
devTowerDataWarning.setDeviceKey(deviceSn);
|
||||
int c0 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning);
|
||||
//int d0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
//int e0 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("c0",c0);
|
||||
|
@ -153,18 +159,17 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
|
|||
params.put("beginCreateTime",firstDay);
|
||||
params.put("endCreateTime",lastDay);
|
||||
devTowerDataRound.setParams(params);
|
||||
devTowerDataWarning.setParams(params);
|
||||
int a1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("a1",a1);
|
||||
devTowerDataRound.setActiveName("cz");
|
||||
int b1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("b1",b1);
|
||||
devTowerDataRound.setActiveName("gj");
|
||||
int c1 = devTowerDataRunMapper.findRunCountByDeviceKey(devTowerDataRound);
|
||||
int c1 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning);
|
||||
//int d1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
|
||||
//int e1 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound);
|
||||
dataMap.put("c1",c1);
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -421,6 +421,16 @@ public class SysUserController extends BaseController {
|
|||
return toAjax(userService.updataUserPassWord(vo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置密码
|
||||
*/
|
||||
@Log(title = "修改密码", businessType = BusinessType.UPDATE)
|
||||
@PostMapping("/updatePwd/specify/{type}")
|
||||
public AjaxResult updatePwd(@PathVariable(value = "type") String type) {
|
||||
userService.updataUserPassWordSpecify(type);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 状态修改
|
||||
*/
|
||||
|
|
|
@ -271,6 +271,13 @@ public interface ISysUserService
|
|||
*/
|
||||
public int updataUserPassWord(AlertUserPassVo alertUserPassVo);
|
||||
|
||||
/**
|
||||
* 修改指定用户类型密码
|
||||
* @param type 用户类型
|
||||
* @return
|
||||
*/
|
||||
public void updataUserPassWordSpecify(String type);
|
||||
|
||||
/**
|
||||
* 获取普通用户的租户信息
|
||||
* @param userId
|
||||
|
|
|
@ -539,6 +539,9 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
user.setCreateBy(user.getUpdateBy());
|
||||
user.setCreateTime(user.getUpdateTime());
|
||||
user.setWorkType(user.getWorkType());
|
||||
if(StringUtils.isEmpty(user.getPassword())){
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPhonenumber()+"@"+user.getUserType()));
|
||||
}
|
||||
userMapper.insertUser(user);
|
||||
try {
|
||||
String maOpenId = Convert.toStr(redisService.getCacheObject("SysUserUniopen::"+user.getPhonenumber()),null);
|
||||
|
@ -1101,6 +1104,26 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
return userMapper.updateUser(sysUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改指定用户类型密码
|
||||
* @param type 用户类型
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void updataUserPassWordSpecify(String type){
|
||||
SysUser userQuery = new SysUser();
|
||||
userQuery.setRemark(type.toUpperCase()+"::");
|
||||
List<SysUser> userList = selectUserList(userQuery);
|
||||
if(userList.size()>0){
|
||||
for (SysUser sysUser:userList){
|
||||
sysUser.setPassword(SecurityUtils.encryptPassword(sysUser.getPhonenumber()+"@"+type));
|
||||
sysUser.setUpdateBy(SecurityUtils.getUsername());
|
||||
sysUser.setUpdateTime(new Date());
|
||||
userMapper.updateUser(sysUser);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<SysUserCom> getUserComs(Long userId) {
|
||||
SysUserCom where=new SysUserCom();
|
||||
|
@ -1162,8 +1185,6 @@ public class SysUserServiceImpl implements ISysUserService
|
|||
return userComs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private SysUserExt findActiveUserExt(List<SysUserExt> userExts) {
|
||||
SysUserExt find=null;
|
||||
for(SysUserExt userExt:userExts){
|
||||
|
|
Loading…
Reference in New Issue