提交代码

dev_xd
姜玉琦 2025-06-03 01:11:27 +08:00
parent 482a7322bf
commit 78325d3fbd
27 changed files with 1845 additions and 1467 deletions

View File

@ -37,4 +37,14 @@ public interface RemoteFileService
*/ */
@PostMapping(value = "/upload/{proPackage}/dirs/{dirs}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @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); 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);
} }

View File

@ -36,6 +36,12 @@ public class RemoteFileFallbackFactory implements FallbackFactory<RemoteFileServ
{ {
return R.fail("上传文件失败:" + throwable.getMessage()); return R.fail("上传文件失败:" + throwable.getMessage());
} }
@Override
public R<SysFile> dirDatePathUploadFile(String proPackage, String dirs, String datePath, MultipartFile file)
{
return R.fail("上传文件失败:" + throwable.getMessage());
}
}; };
} }
} }

View File

@ -18,33 +18,43 @@ const findTowerConfigListByProjectId = (data) => {
}; };
// 查询塔基运行统计 // 查询塔基运行统计
const findTowerStatisticsView = (deviceSn) => { const findTowerStatisticsView = (proId,deviceSn) => {
return request({ return request({
url: `/manage/bgscreen/tower/findTowerStatisticsView?deviceKey=${deviceSn}`, url: `/manage/bgscreen/tower/findTowerStatisticsView?projectId=${proId}&deviceSn=${deviceSn}`,
method: "get", method: "get",
}); });
}; };
// 查询塔基限位数据 // 查询塔基限位数据
const selectDevTowerDataLimitList = (deviceSn) => { const selectDevTowerDataLimitList = (proId,deviceSn) => {
return request({ return request({
url: `/manage/bgscreen/tower/selectDevTowerDataLimitList?deviceKey=${deviceSn}&pageNum=1&pageSize=10`, url: `/manage/bgscreen/tower/selectDevTowerDataLimitList?projectId=${proId}&deviceKey=${deviceSn}`,
method: "get", method: "get",
}); });
}; };
// 查询塔基实时数据 // 查询塔基实时数据
const selectDevTowerDataRunList = (deviceSn) => { const selectDevTowerDataRunList = (proId,deviceSn) => {
return request({ return request({
url: `manage/bgscreen/tower/selectDevTowerDataRunList?deviceKey=${deviceSn}&pageNum=1&pageSize=10`, url: `manage/bgscreen/tower/selectDevTowerDataRunList?projectId=${proId}&deviceKey=${deviceSn}`,
method: "get", method: "get",
}); });
}; };
// 查询塔基实时数据
const findDevTowerDataWarningDatas = (query) => {
return request({
url: `manage/bgscreen/tower/findDevTowerDataWarningDatas`,
method: "get",
params: query,
});
};
export default { export default {
findTowerConfigGroupOnline, findTowerConfigGroupOnline,
findTowerConfigListByProjectId, findTowerConfigListByProjectId,
findTowerStatisticsView, findTowerStatisticsView,
selectDevTowerDataLimitList, selectDevTowerDataLimitList,
selectDevTowerDataRunList, selectDevTowerDataRunList,
findDevTowerDataWarningDatas
}; };

View File

@ -34,15 +34,29 @@
</el-row> </el-row>
<el-row style="height: 160px; overflow: hidden" :key="chart1Key"> <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>
<el-row class="left-data-list"> <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 :class="'active'">监控列表</div>
</div> </div>
<div class="drv-list scroll" id="listMin"> <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="item-content">
<div class="dev-row1"> <div class="dev-row1">
<div class="survey_content"> <div class="survey_content">
@ -62,10 +76,11 @@
</div> </div>
<div class="data-row"> <div class="data-row">
<span class="sp-label">设备状态:</span> <span class="sp-label">设备状态:</span>
<span class="sp-value" :class="it.online == 2 ? 'is-offline' : 'is-online'"> <span
{{ class="sp-value"
it.online == 2 ? "离线" : "在线" :class="it.online == 2 ? 'is-offline' : 'is-online'"
}} >
{{ it.online == 2 ? "离线" : "在线" }}
</span> </span>
</div> </div>
</div> </div>
@ -111,7 +126,10 @@
<el-col :span="16" class="h100"> <el-col :span="16" class="h100">
<el-row class="total-data"> <el-row class="total-data">
<el-col :span="6"> <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="'active'">吊重次数({{ towerConfigStat.a0 }})</div>
<div class="title-bg"></div> <div class="title-bg"></div>
</div> </div>
@ -128,7 +146,10 @@
</el-col> </el-col>
<el-col :span="6"> <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="'active'">超载次数({{ towerConfigStat.b0 }})</div>
<div class="title-bg"></div> <div class="title-bg"></div>
</div> </div>
@ -145,24 +166,36 @@
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<div class="warning-info-title" style="padding-left: 20px; position: relative; z-index: 9"> <div
<div :class="'active'">超载率({{ getRoudValue(towerConfigStat.b0, towerConfigStat.a0) }})</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 class="title-bg"></div>
</div> </div>
<div class="data-row2"> <div class="data-row2">
<div class="data-row2-col"> <div class="data-row2-col">
<div class="s-text">本月</div> <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>
<div class="data-row2-col"> <div class="data-row2-col">
<div class="s-text">累计</div> <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>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <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="'active'">告警次数(10)</div>
<div class="title-bg"></div> <div class="title-bg"></div>
</div> </div>
@ -183,7 +216,11 @@
<div class="safe-tower-crane-min" style="position: relative"> <div class="safe-tower-crane-min" style="position: relative">
<el-row class="row-crane-min"> <el-row class="row-crane-min">
<el-col :span="2"> <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>
<el-col :span="20"> <el-col :span="20">
<div class="safe-tower-content-max"> <div class="safe-tower-content-max">
@ -208,7 +245,11 @@
</div> </div>
</el-col> </el-col>
<el-col :span="2"> <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-col>
</el-row> </el-row>
</div> </div>
@ -226,18 +267,21 @@
<div class="afoot-overflow safe-afoot-overflow" id="afootOverflow"> <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="not-data"></div>
<div v-if="warningData.length > 0" class="quality-table special-table scroll" style="padding:0px;" :key="tbHeight"> <div
<el-table :data="warningData" class="mytable" style="width: 100%;background: transparent;" :height="tbHeight" ref="fbsubordinateUnit"> v-if="warningData.length > 0"
<el-table-column prop="createTime" label="发送时间"></el-table-column> class="quality-table special-table scroll"
<el-table-column label="预警类型"> style="padding: 0px"
<template slot-scope="scope"> :key="tbHeight"
<div class="tag-group"> >
<template v-for="(item, idx) in dicts"> <el-table
<el-tag :key="idx" v-if="dic(item.value, scope.row.warnings)" type="danger" effect="dark">{{ item.label }}</el-tag> :data="warningData"
</template> class="mytable"
</div> style="width: 100%; background: transparent"
</template> :height="tbHeight"
</el-table-column> ref="fbsubordinateUnit"
>
<el-table-column prop="createTime" label="发生时间" />
<el-table-column prop="warnNote" label="预警内容" />
</el-table> </el-table>
</div> </div>
</div> </div>
@ -248,7 +292,13 @@
<div class="analyse-text">力矩曲线</div> <div class="analyse-text">力矩曲线</div>
</div> </div>
<div class="safe-moment"> <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> </div>
</div> </div>
@ -256,7 +306,12 @@
</el-row> </el-row>
<el-row class="dev-info-list"> <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="info-item-content">
<div class="row-1"> <div class="row-1">
<span class="sp-title">{{ it.title }}</span> <span class="sp-title">{{ it.title }}</span>
@ -272,9 +327,12 @@
<div v-for="i in 10" :key="i" class="scale-item"></div> <div v-for="i in 10" :key="i" class="scale-item"></div>
</div> </div>
<span class="sp-data1 sp-data sp-sc">报警:{{ it.data1 }}</span> <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)"> <span
报警:{{ class="sp-data2 sp-data sp-sc"
it.data2 }} v-if="it.data2 >= 5"
:style="calcTop(it)"
>
报警:{{ it.data2 }}
</span> </span>
<span class="sp-sc2 sp-sc">{{ it.scale2 }}</span> <span class="sp-sc2 sp-sc">{{ it.scale2 }}</span>
</div> </div>
@ -286,46 +344,46 @@
</template> </template>
<script> <script>
import debounce from 'lodash.debounce' import debounce from "lodash.debounce";
import '@/components/tower-crane-value-1' import "@/components/tower-crane-value-1";
import '@/components/tower-crane-value-2' import "@/components/tower-crane-value-2";
export default { export default {
data() { data() {
return { return {
tbHeight: 290, tbHeight: 290,
itemChartKey1: 0, itemChartKey1: 0,
chart1Key: 0, chart1Key: 0,
chart1Height: '200px', chart1Height: "200px",
dpi: '', dpi: "",
selProject: null, selProject: null,
index: 0, index: 0,
towerConfigView: [], towerConfigView: [],
towerConfigList: [], towerConfigList: [],
towerConfigStat: { a0: 0, b0: 0, c0: 0, a1: 0, b1: 0, c1: 0 }, towerConfigStat: { a0: 0, b0: 0, c0: 0, a1: 0, b1: 0, c1: 0 },
runData: { runData: {
height: '0', height: "0",
range: '0', range: "0",
rotation: '0', rotation: "0",
load: '0', load: "0",
windSpeed: '0', windSpeed: "0",
leanAngleX: '0', leanAngleX: "0",
leanAngleY: '0', leanAngleY: "0",
loadPercent: '0', loadPercent: "0",
momentPercent: '0', momentPercent: "0",
windSpeedPercent: '0', windSpeedPercent: "0",
warnings: null, warnings: null,
}, },
selDev: {}, selDev: {},
devBottomInfo: [ 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', direction: "right",
comName: 'tower-crane-value-1', comName: "tower-crane-value-1",
warningData: [], warningData: [],
momentData: {}, momentData: {},
forIndex: 0, forIndex: 0,
@ -336,291 +394,301 @@ export default {
prjs: [], prjs: [],
project: null, project: null,
dicts: [], dicts: [],
} };
}, },
mounted() { mounted() {
window.safetyApp = this window.safetyApp = this;
this.$store.dispatch('ChangeNav', 304) this.$store.dispatch("ChangeNav", 304);
this.$bus.$on('projectChange', (prj) => { this.$bus.$on("projectChange", (prj) => {
this.selProject = prj this.selProject = prj;
this.init() this.init();
}) });
this.selProject = this.$store.getters.selProject this.selProject = this.$store.getters.selProject;
this.init() this.init();
this.dpi = this.$dpi() this.dpi = this.$dpi();
this.resize() this.resize();
window.addEventListener('resize', () => { window.addEventListener("resize", () => {
if (this.dpi != this.$dpi()) { if (this.dpi != this.$dpi()) {
this.dpi = this.$dpi() this.dpi = this.$dpi();
this.resize() this.resize();
} }
}) });
this.$api.dict('ssp_proble_sub_type').then((d) => { this.$api.dict("ssp_proble_sub_type").then((d) => {
this.dangerTypeDict = d || [] this.dangerTypeDict = d || [];
}) });
this.momentData = JSON.parse( 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]}' '{"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() { created() {
this.$api.dict('device_tower_warning').then((d) => { this.$api.dict("device_tower_warning").then((d) => {
this.dicts = d || [] this.dicts = d || [];
console.log('---->', this.dicts) console.log("---->", this.dicts);
}) });
}, },
methods: { methods: {
resize() { resize() {
this.chart1Key++ this.chart1Key++;
this.itemChartKey1++ this.itemChartKey1++;
let is1K = this.$dpi() == '1K' let is1K = this.$dpi() == "1K";
let is2K = this.$dpi() == '2K' let is2K = this.$dpi() == "2K";
this.tbHeight = is1K ? 290 : is2K ? 410 : 770 this.tbHeight = is1K ? 290 : is2K ? 410 : 770;
}, },
init() { init() {
if (!this.selProject) { if (!this.selProject) {
return return;
} }
this.initTowerConfigView() this.initTowerConfigView();
this.initTowerConfigList() this.initTowerConfigList();
}, },
getRoudValue(a, b) { getRoudValue(a, b) {
if (a > 0) { if (a > 0) {
return (parseFloat(a / b) * 100).toFixed(1) + '%' return (parseFloat(a / b) * 100).toFixed(1) + "%";
} else { } else {
return '0%' return "0%";
} }
}, },
initTowerConfigView() { initTowerConfigView() {
let postData = { let postData = {
comId: this.selProject.comId, comId: this.selProject.comId,
projectId: this.selProject.id, projectId: this.selProject.id,
} };
this.$api.tower.findTowerConfigGroupOnline(postData).then((d) => { this.$api.tower.findTowerConfigGroupOnline(postData).then((d) => {
let list = [] let list = [];
let total = 0 let total = 0;
if (d.data && d.data.length > 0) { if (d.data && d.data.length > 0) {
d.data.forEach((datum) => { d.data.forEach((datum) => {
total += datum.total total += datum.total;
if (datum.online == 1) { if (datum.online == 1) {
list.push({ text: '在线数量', value: datum.total }) list.push({ text: "在线数量", value: datum.total });
if (d.data.length == 1) { if (d.data.length == 1) {
list.push({ text: '离线数量', value: 0 }) list.push({ text: "离线数量", value: 0 });
} }
} else { } else {
list.push({ text: '离线数量', value: datum.total }) list.push({ text: "离线数量", value: datum.total });
} }
}) });
} }
this.towerTotalNum = total this.towerTotalNum = total;
this.towerConfigView = list this.towerConfigView = list;
}) });
}, },
initTowerConfigList() { initTowerConfigList() {
let postData = { let postData = {
comdId: this.selProject.comId, comdId: this.selProject.comId,
projectId: this.selProject.id, projectId: this.selProject.id,
} };
this.$api.tower.findTowerConfigListByProjectId(postData).then((d) => { this.$api.tower.findTowerConfigListByProjectId(postData).then((d) => {
this.towerConfigList = d.data || [] this.towerConfigList = d.data || [];
if (d.data.length > 0) { if (d.data.length > 0) {
this.initSelDev(this.index) this.initSelDev(this.index);
} else { } else {
this.runData.height = '0' this.runData.height = "0";
this.runData.range = '0' this.runData.range = "0";
this.runData.rotation = '0' this.runData.rotation = "0";
this.runData.load = '0' this.runData.load = "0";
this.runData.windSpeed = '0' this.runData.windSpeed = "0";
this.runData.leanAngleX = '0' this.runData.leanAngleX = "0";
this.runData.leanAngleY = '0' this.runData.leanAngleY = "0";
this.runData.loadPercent = '0' this.runData.loadPercent = "0";
this.runData.momentPercent = '0' this.runData.momentPercent = "0";
this.runData.windSpeedPercent = '0' this.runData.windSpeedPercent = "0";
this.runData.warnings = null this.runData.warnings = null;
this.devBottomInfo[0].data1 = 0 this.devBottomInfo[0].data1 = 0;
this.devBottomInfo[1].data1 = 0 this.devBottomInfo[1].data1 = 0;
this.devBottomInfo[2].data1 = 0 this.devBottomInfo[2].data1 = 0;
this.devBottomInfo[3].data1 = 0 this.devBottomInfo[3].data1 = 0;
this.devBottomInfo[4].data1 = 0 this.devBottomInfo[4].data1 = 0;
this.devBottomInfo[5].data1 = 0 this.devBottomInfo[5].data1 = 0;
this.devBottomInfo[0].data2 = 0 this.devBottomInfo[0].data2 = 0;
this.devBottomInfo[1].data2 = 0 this.devBottomInfo[1].data2 = 0;
this.devBottomInfo[2].data2 = 0 this.devBottomInfo[2].data2 = 0;
this.devBottomInfo[3].data2 = 0 this.devBottomInfo[3].data2 = 0;
this.devBottomInfo[4].data2 = 0 this.devBottomInfo[4].data2 = 0;
this.devBottomInfo[5].data2 = 0 this.devBottomInfo[5].data2 = 0;
this.towerConfigStat.a0 = 0 this.towerConfigStat.a0 = 0;
this.towerConfigStat.b0 = 0 this.towerConfigStat.b0 = 0;
this.towerConfigStat.c0 = 0 this.towerConfigStat.c0 = 0;
this.towerConfigStat.a1 = 0 this.towerConfigStat.a1 = 0;
this.towerConfigStat.b1 = 0 this.towerConfigStat.b1 = 0;
this.towerConfigStat.c1 = 0 this.towerConfigStat.c1 = 0;
this.warningData = [] this.warningData = [];
this.selDev = { deviceName: '未找到设备', frontBrachium: 0, afterBrachium: 0 } this.selDev = { deviceName: "未找到设备", frontBrachium: 0, afterBrachium: 0 };
} }
}) });
}, },
dic(ds, value) { dic(ds, value) {
if (value.split(',').indexOf(ds) > -1) { if (value.split(",").indexOf(ds) > -1) {
return true return true;
} else { } else {
return false return false;
} }
}, },
initSelDev(n) { initSelDev(n) {
this.selDev = this.towerConfigList[this.index] this.selDev = this.towerConfigList[this.index];
this.initLimitData() this.initLimitData();
this.initRunData() this.initRunData();
// //
clearInterval(this.warningInterval) clearInterval(this.warningInterval);
this.warningInterval = setInterval(this.initRunData, 60000) this.warningInterval = setInterval(this.initRunData, 30000);
this.initCountData() this.initCountData();
clearInterval(this.countvwInterval) clearInterval(this.countvwInterval);
this.countvwInterval = setInterval(this.initCountData, 60000) this.countvwInterval = setInterval(this.initCountData, 30000);
}, },
initCountData() { initCountData() {
this.$api.tower.findTowerStatisticsView(this.selDev.deviceSn).then((d) => { this.$api.tower.findTowerStatisticsView(this.selProject.id, this.selDev.deviceSn).then((d) => {
this.towerConfigStat = d.data || [] this.towerConfigStat = d.data || [];
}) });
}, },
initLimitData() { 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) { if (d.length > 0) {
this.devBottomInfo[0].data2 = d.data[0].rangeLimitStart this.devBottomInfo[0].data2 = d.data[0].rangeLimitStart;
this.devBottomInfo[1].data2 = d.data[0].windSpeedWarning this.devBottomInfo[1].data2 = d.data[0].windSpeedWarning;
this.devBottomInfo[2].data2 = d.data[0].loadWarning this.devBottomInfo[2].data2 = d.data[0].loadWarning;
this.devBottomInfo[3].data2 = d.data[0].leanWarning this.devBottomInfo[3].data2 = d.data[0].leanWarning;
this.devBottomInfo[4].data2 = d.data[0].rotationLimitStart this.devBottomInfo[4].data2 = d.data[0].rotationLimitStart;
this.devBottomInfo[5].data2 = d.data[0].highLimitWarning this.devBottomInfo[5].data2 = d.data[0].highLimitWarning;
} }
}) });
}, },
initRunData() { 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) { if (d.data.length > 0) {
this.runData.height = d.data[0].height this.runData.height = d.data[0].height;
this.runData.range = d.data[0].range this.runData.range = d.data[0].range;
this.runData.rotation = d.data[0].rotation this.runData.rotation = d.data[0].rotation;
this.runData.load = d.data[0].load this.runData.load = d.data[0].load;
this.runData.windSpeed = d.data[0].windSpeed this.runData.windSpeed = d.data[0].windSpeed;
this.runData.leanAngleX = d.data[0].leanAngleX this.runData.leanAngleX = d.data[0].leanAngleX;
this.runData.leanAngleY = d.data[0].leanAngleY this.runData.leanAngleY = d.data[0].leanAngleY;
this.runData.loadPercent = d.data[0].loadPercent this.runData.loadPercent = d.data[0].loadPercent;
this.runData.momentPercent = d.data[0].momentPercent this.runData.momentPercent = d.data[0].momentPercent;
this.runData.windSpeedPercent = d.data[0].windSpeedPercent this.runData.windSpeedPercent = d.data[0].windSpeedPercent;
this.runData.warnings = d.data[0].warnings this.runData.warnings = d.data[0].warnings;
this.devBottomInfo[0].data1 = d.data[0].range this.devBottomInfo[0].data1 = d.data[0].range;
this.devBottomInfo[1].data1 = d.data[0].windSpeed this.devBottomInfo[1].data1 = d.data[0].windSpeed;
this.devBottomInfo[2].data1 = d.data[0].load this.devBottomInfo[2].data1 = d.data[0].load;
this.devBottomInfo[3].data1 = d.data[0].leanAnglePercent ? d.data[0].leanAnglePercent : 0 this.devBottomInfo[3].data1 = d.data[0].leanAnglePercent
this.devBottomInfo[4].data1 = d.data[0].rotation ? d.data[0].leanAnglePercent
this.devBottomInfo[5].data1 = d.data[0].height : 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) { calcTop(d) {
let tmp = 100 - (d.data2 * 100.0) / d.data1 let tmp = 100 - (d.data2 * 100.0) / d.data1;
return `top:calc(20px + ${tmp > 78 ? 78 : tmp}%)` return `top:calc(20px + ${tmp > 78 ? 78 : tmp}%)`;
}, },
getRoudValue(a, b) { getRoudValue(a, b) {
if (a > 0) { if (a > 0) {
return (parseFloat(a / b) * 100).toFixed(1) + '%' return (parseFloat(a / b) * 100).toFixed(1) + "%";
} else { } else {
return '0%' return "0%";
} }
}, },
safeTowerLeft() { safeTowerLeft() {
this.direction = 'left' this.direction = "left";
this.automaticRoll() this.automaticRoll();
}, },
safeTowerRight() { safeTowerRight() {
// //
this.direction = 'right' this.direction = "right";
this.automaticRoll() this.automaticRoll();
}, },
automaticRoll() { automaticRoll() {
// //
if (this.direction == 'right') { if (this.direction == "right") {
if (this.index == this.towerConfigList.length - 1) { if (this.index == this.towerConfigList.length - 1) {
this.index = 0 this.index = 0;
} else { } else {
this.index = this.index + 1 this.index = this.index + 1;
} }
} else { } else {
if (this.index == 0) { if (this.index == 0) {
this.index = this.towerConfigList.length - 1 this.index = this.towerConfigList.length - 1;
} else { } else {
this.index = this.index - 1 this.index = this.index - 1;
} }
} }
this.selDev = this.towerConfigList[this.index] this.selDev = this.towerConfigList[this.index];
var height = $('.list-for').innerHeight() var height = $(".list-for").innerHeight();
$('#listMin').animate({ scrollTop: height * this.index + 'px' }) $("#listMin").animate({ scrollTop: height * this.index + "px" });
}, },
onTowerCraneList(n) { onTowerCraneList(n) {
this.index = n this.index = n;
this.selDev = this.towerConfigList[this.index] this.selDev = this.towerConfigList[this.index];
this.initLimitData() this.initLimitData();
this.initCountData() this.initCountData();
// //
this.direction = 'right' this.direction = "right";
}, },
safeAutomaticRoll() { safeAutomaticRoll() {
var height = $('.safe-afoot-overflow').innerHeight() var height = $(".safe-afoot-overflow").innerHeight();
console.log(height) console.log(height);
if (this.forIndex == this.warningData.length) { if (this.forIndex == this.warningData.length) {
this.forIndex = 0 this.forIndex = 0;
} else { } 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() { warningListMinMouseover() {
clearInterval(this.warningInterval) clearInterval(this.warningInterval);
}, },
warningListMinMouseout() { warningListMinMouseout() {
this.warningInterval = setInterval(this.safeAutomaticRoll, 10000) this.warningInterval = setInterval(this.safeAutomaticRoll, 10000);
}, },
renderDataItem2(o) { renderDataItem2(o) {
let data = this.momentData let data = this.momentData;
var color = '#20bc00' var color = "#20bc00";
var Xmax = Math.max.apply(null, data.dataX) var Xmax = Math.max.apply(null, data.dataX);
var Ymax = Math.max.apply(null, data.dataY) var Ymax = Math.max.apply(null, data.dataY);
let is1K = this.$dpi() == '1K' let is1K = this.$dpi() == "1K";
let is2K = this.$dpi() == '2K' let is2K = this.$dpi() == "2K";
let option = { let option = {
tooltip: { tooltip: {
position: 'top', position: "top",
formatter: function (params) { formatter: function (params) {
var fd = params.data[0] var fd = params.data[0];
var dz = params.data[1] var dz = params.data[1];
res = res =
'<div style="padding: 5px 10px;">' + '<div style="padding: 5px 10px;">' +
'<div style="padding-bottom: 5px;">幅度:<span>' + '<div style="padding-bottom: 5px;">幅度:<span>' +
fd + fd +
'</span> m</div>' + "</span> m</div>" +
'<div>吊重:<span>' + "<div>吊重:<span>" +
dz + dz +
'</span> t</div>' + "</span> t</div>" +
'</div>' "</div>";
return res return res;
}, },
}, },
grid: { grid: {
top: '20%', top: "20%",
right: '15%', right: "15%",
left: '4%', left: "4%",
bottom: '5%', bottom: "5%",
containLabel: true, containLabel: true,
}, },
xAxis: [ xAxis: [
{ {
type: 'value', type: "value",
name: '幅度/m', name: "幅度/m",
max: 60, max: 60,
nameTextStyle: { nameTextStyle: {
color: '#c5d9fc', color: "#c5d9fc",
fontSize: is1K ? 12 : is2K ? 14 : 24, fontSize: is1K ? 12 : is2K ? 14 : 24,
}, },
splitLine: { splitLine: {
@ -631,29 +699,29 @@ export default {
axisLabel: { axisLabel: {
// //
textStyle: { textStyle: {
color: '#c5d9fc', color: "#c5d9fc",
margin: 20, margin: 20,
fontSize: 30, fontSize: 30,
}, },
}, },
}, },
{ {
type: 'category', type: "category",
boundaryGap: false, boundaryGap: false,
position: 'bottom', position: "bottom",
axisLine: { axisLine: {
//线x //线x
show: true, show: true,
lineStyle: { lineStyle: {
color: '#194e92', color: "#194e92",
type: 'dashed', type: "dashed",
}, },
}, },
axisLabel: { axisLabel: {
show: false, show: false,
// //
textStyle: { textStyle: {
color: '#c5d9fc', color: "#c5d9fc",
margin: 20, margin: 20,
fontSize: 30, fontSize: 30,
}, },
@ -663,13 +731,13 @@ export default {
], ],
yAxis: [ yAxis: [
{ {
name: '吊重/t', name: "吊重/t",
nameTextStyle: { nameTextStyle: {
color: '#c5d9fc', color: "#c5d9fc",
fontSize: is1K ? 12 : is2K ? 14 : 24, fontSize: is1K ? 12 : is2K ? 14 : 24,
}, },
max: Ymax + 1, max: Ymax + 1,
type: 'value', type: "value",
splitNumber: 7, splitNumber: 7,
splitLine: { splitLine: {
show: false, show: false,
@ -678,14 +746,14 @@ export default {
//线x //线x
show: true, show: true,
lineStyle: { lineStyle: {
color: '#194e92', color: "#194e92",
type: 'dashed', type: "dashed",
}, },
}, },
axisLabel: { axisLabel: {
margin: 20, margin: 20,
textStyle: { textStyle: {
color: '#c5d9fc', color: "#c5d9fc",
fontSize: is1K ? 12 : is2K ? 14 : 18, fontSize: is1K ? 12 : is2K ? 14 : 18,
}, },
}, },
@ -694,14 +762,14 @@ export default {
], ],
series: [ series: [
{ {
name: '吊重', name: "吊重",
type: 'effectScatter', type: "effectScatter",
rippleEffect: { rippleEffect: {
// //
color: 'purple', // , color: "purple", // ,
brushType: 'fill', // ,线,'stroke' 'fill' brushType: "fill", // ,线,'stroke' 'fill'
period: 2, // period: 2, //
scale: '3', // scale: "3", //
}, },
xAxisIndex: 0, xAxisIndex: 0,
yAxisIndex: 0, yAxisIndex: 0,
@ -712,15 +780,15 @@ export default {
data: data.point, data: data.point,
}, },
{ {
type: 'line', type: "line",
symbol: 'none', symbol: "none",
smooth: true, smooth: true,
xAxisIndex: 1, xAxisIndex: 1,
yAxisIndex: 0, yAxisIndex: 0,
lineStyle: { lineStyle: {
normal: { normal: {
width: 3, width: 3,
color: '#5968db', // 线 color: "#5968db", // 线
}, },
}, },
areaStyle: { areaStyle: {
@ -733,23 +801,23 @@ export default {
0, 0,
1, 1,
[ [
{ offset: 0, color: 'rgb(25,43,115,0.9)' }, { offset: 0, color: "rgb(25,43,115,0.9)" },
{ offset: 0.7, color: 'rgba(25,43,115, 0)' }, { offset: 0.7, color: "rgba(25,43,115, 0)" },
], ],
false false
), ),
shadowColor: 'rgba(25,43,115, 1)', // shadowColor: "rgba(25,43,115, 1)", //
}, },
}, },
data: data.dataY, data: data.dataY,
}, },
], ],
} };
return option return option;
}, },
}, },
} };
</script> </script>
<style lang="less"> <style lang="less">
@ -830,7 +898,6 @@ export default {
.dev-row1 { .dev-row1 {
display: flex; display: flex;
align-items: center; align-items: center;
.survey_content { .survey_content {
.survey_content_img { .survey_content_img {
.svg-icon { .svg-icon {

View File

@ -16,7 +16,8 @@ module.exports = defineConfig({
proxy: { proxy: {
// https://cn.vitejs.dev/config/#server-proxy // https://cn.vitejs.dev/config/#server-proxy
"/dev-api": { "/dev-api": {
target: "http://localhost:8080", //target: "http://localhost:8080",
target: 'http://62.234.3.186/prod-api/',
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
"^/dev-api": "/", "^/dev-api": "/",

View File

@ -78,12 +78,12 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
return parseDateToStr(format, new Date()); 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); 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); 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"); return DateFormatUtils.format(now, "yyyy/MM/dd");
} }
/**
* // 2018/08/08
*/
public static final String datePath(Date date)
{
return DateFormatUtils.format(date, "yyyy/MM/dd");
}
/** /**
* *
*/ */

View File

@ -1,5 +1,6 @@
package com.yanzhu.device.mapper; package com.yanzhu.device.mapper;
import com.yanzhu.device.domain.DevTowerDataRound;
import com.yanzhu.device.domain.DevTowerDataWarning; import com.yanzhu.device.domain.DevTowerDataWarning;
import java.util.List; import java.util.List;
@ -59,4 +60,12 @@ public interface DevTowerDataWarningMapper
* @return * @return
*/ */
public int deleteDevTowerDataWarningByIds(Long[] ids); public int deleteDevTowerDataWarningByIds(Long[] ids);
/**
*
*
* @param devTowerDataWarning
* @return
*/
public int findWarningCountByDeviceKey(DevTowerDataWarning devTowerDataWarning);
} }

View File

@ -69,7 +69,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDevTowerDataCollideList" parameterType="DevTowerDataCollide" resultMap="DevTowerDataCollideResult"> <select id="selectDevTowerDataCollideList" parameterType="DevTowerDataCollide" resultMap="DevTowerDataCollideResult">
<include refid="selectDevTowerDataCollideVo"/> <include refid="selectDevTowerDataCollideVo"/>
<where> <where>
dtdc.is_del=0
<if test="cfgId != null">and dtdc.cfg_id = #{cfgId}</if> <if test="cfgId != null">and dtdc.cfg_id = #{cfgId}</if>
<if test="projectId != null "> and dtdc.project_id = #{projectId}</if> <if test="projectId != null "> and dtdc.project_id = #{projectId}</if>
<if test="comId != null "> and dtdc.com_id = #{comId}</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="deviceSource != null and deviceSource != ''"> and dtdc.device_source = #{deviceSource}</if>
<if test="towerId != null and towerId != ''"> and dtdc.tower_id = #{towerId}</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> <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> </where>
order by dtdc.id desc order by dtdc.id desc
</select> </select>

View File

@ -70,7 +70,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDevTowerDataLimitList" parameterType="DevTowerDataLimit" resultMap="DevTowerDataLimitResult"> <select id="selectDevTowerDataLimitList" parameterType="DevTowerDataLimit" resultMap="DevTowerDataLimitResult">
<include refid="selectDevTowerDataLimitVo"/> <include refid="selectDevTowerDataLimitVo"/>
<where> <where>
dtdl.is_del=0
<if test="cfgId != null">and dtdl.cfg_id = #{cfgId}</if> <if test="cfgId != null">and dtdl.cfg_id = #{cfgId}</if>
<if test="projectId != null "> and dtdl.project_id = #{projectId}</if> <if test="projectId != null "> and dtdl.project_id = #{projectId}</if>
<if test="comId != null "> and dtdl.com_id = #{comId}</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="deviceSource != null and deviceSource != ''"> and dtdl.device_source = #{deviceSource}</if>
<if test="towerId != null and towerId != ''"> and dtdl.tower_id = #{towerId}</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> <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> </where>
order by dtdl.id desc order by dtdl.id desc
</select> </select>

View File

@ -84,7 +84,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDevTowerDataLocalList" parameterType="DevTowerDataLocal" resultMap="DevTowerDataLocalResult"> <select id="selectDevTowerDataLocalList" parameterType="DevTowerDataLocal" resultMap="DevTowerDataLocalResult">
<include refid="selectDevTowerDataLocalVo"/> <include refid="selectDevTowerDataLocalVo"/>
<where> <where>
dtdl.is_del=0
<if test="cfgId != null">and dtdl.cfg_id = #{cfgId}</if> <if test="cfgId != null">and dtdl.cfg_id = #{cfgId}</if>
<if test="projectId != null "> and dtdl.project_id = #{projectId}</if> <if test="projectId != null "> and dtdl.project_id = #{projectId}</if>
<if test="comId != null "> and dtdl.com_id = #{comId}</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="deviceSource != null and deviceSource != ''"> and dtdl.device_source = #{deviceSource}</if>
<if test="towerId != null and towerId != ''"> and dtdl.tower_id = #{towerId}</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> <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> </where>
order by dtdl.id desc order by dtdl.id desc
</select> </select>

View File

@ -101,7 +101,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectDevTowerDataRoundList" parameterType="DevTowerDataRound" resultMap="DevTowerDataRoundResult"> <select id="selectDevTowerDataRoundList" parameterType="DevTowerDataRound" resultMap="DevTowerDataRoundResult">
<include refid="selectDevTowerDataRoundVo"/> <include refid="selectDevTowerDataRoundVo"/>
<where> <where>
dtdr.is_del=0
<if test="cfgId != null">and dtdr.cfg_id = #{cfgId}</if> <if test="cfgId != null">and dtdr.cfg_id = #{cfgId}</if>
<if test="projectId != null "> and dtdr.project_id = #{projectId}</if> <if test="projectId != null "> and dtdr.project_id = #{projectId}</if>
<if test="comId != null "> and dtdr.com_id = #{comId}</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="deviceSource != null and deviceSource != ''"> and dtdr.device_source = #{deviceSource}</if>
<if test="towerId != null and towerId != ''"> and dtdr.tower_id = #{towerId}</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> <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> </where>
order by dtdr.id desc order by dtdr.id desc
</select> </select>

View File

@ -242,10 +242,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="findRunCountByDeviceKey" parameterType="DevTowerDataRound" resultType="Int"> <select id="findRunCountByDeviceKey" parameterType="DevTowerDataRound" resultType="Int">
select count(1) as total from dev_tower_data_run select count(1) as total from dev_tower_data_run
<where> <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="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='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> <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> </where>
</select> </select>

View File

@ -43,13 +43,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dtdw.project_id, dtdw.project_id,
dtdw.com_id, dtdw.com_id,
sp.project_name as projectName, 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_key,
dtdw.device_source, dtdw.device_source,
dtdw.tower_id, dtdw.tower_id,
dtdw.warn_type, dtdw.warn_type,
dtdw.warn_name, dtdw.warn_name,
dtdw.warn_note, IFNULL(dtdw.warn_note,sdd.dict_label) as warn_note,
dtdw.height, dtdw.height,
dtdw.range, dtdw.range,
dtdw.rotation, dtdw.rotation,
@ -67,14 +68,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
dtdw.update_time, dtdw.update_time,
dtdw.remark dtdw.remark
from dev_tower_data_warning dtdw 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_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> </sql>
<select id="selectDevTowerDataWarningList" parameterType="DevTowerDataWarning" resultMap="DevTowerDataWarningResult"> <select id="selectDevTowerDataWarningList" parameterType="DevTowerDataWarning" resultMap="DevTowerDataWarningResult">
<include refid="selectDevTowerDataWarningVo"/> <include refid="selectDevTowerDataWarningVo"/>
<where> <where>
dtdw.is_del=0
<if test="cfgId != null">and dtdw.cfg_id = #{cfgId}</if> <if test="cfgId != null">and dtdw.cfg_id = #{cfgId}</if>
<if test="projectId != null "> and dtdw.project_id = #{projectId}</if> <if test="projectId != null "> and dtdw.project_id = #{projectId}</if>
<if test="comId != null "> and dtdw.com_id = #{comId}</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="towerId != null and towerId != ''"> and dtdw.tower_id = #{towerId}</if>
<if test="warnType != null "> and dtdw.warn_type = #{warnType}</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> <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> </where>
order by dtdw.id desc order by dtdw.id desc
</select> </select>
@ -200,4 +202,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id} #{id}
</foreach> </foreach>
</delete> </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> </mapper>

View File

@ -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)) SELECT t.dept_id FROM sys_dept t WHERE find_in_set(#{deptId}, ancestors))
)) ))
</if> </if>
<if test="remark != null and remark != ''">
AND u.remark like concat('%', #{remark}, '%')
</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
</select> </select>

View File

@ -100,7 +100,7 @@ public class SysFileController
* *
*/ */
@PostMapping("/upload/{proPackage}/dirs/{dirs}") @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 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 * @param fileName

View File

@ -53,6 +53,20 @@ public class FastDfsSysFileServiceImpl implements ISysFileService
return null; 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;
}
/** /**
* *
* *

View File

@ -28,6 +28,17 @@ public interface ISysFileService
*/ */
public String dirsUploadFile(String dirs, MultipartFile file) throws Exception; 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;
/** /**
* *
* *

View File

@ -58,7 +58,22 @@ public class LocalSysFileServiceImpl implements ISysFileService
@Override @Override
public String dirsUploadFile(String dirs, MultipartFile file) throws Exception{ public String dirsUploadFile(String dirs, MultipartFile file) throws Exception{
String name = FileUploadUtils.upload(localFilePath+dirs, file); 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;
} }
/** /**

View File

@ -56,6 +56,20 @@ public class MinioSysFileServiceImpl implements ISysFileService
return null; 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;
}
/** /**
* *
* *

View File

@ -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); 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)); 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 private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
{ {
File desc = new File(uploadDir + File.separator + fileName); File desc = new File(uploadDir + File.separator + fileName);

View File

@ -14,6 +14,7 @@ import com.yanzhu.common.core.utils.Md5Utils;
import com.yanzhu.common.core.utils.StringUtils; import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.common.core.utils.file.FileUtils; import com.yanzhu.common.core.utils.file.FileUtils;
import com.yanzhu.common.redis.service.RedisService; import com.yanzhu.common.redis.service.RedisService;
import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.job.domain.*; import com.yanzhu.job.domain.*;
import com.yanzhu.job.service.*; import com.yanzhu.job.service.*;
import com.yanzhu.system.api.RemoteFileService; import com.yanzhu.system.api.RemoteFileService;
@ -32,7 +33,7 @@ import java.util.*;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
/** /**
* @Description: * @Description:
* @Title: AttendanceJgwTask * @Title: AttendanceJgwTask
* @Package com.yanzhu.job.task * @Package com.yanzhu.job.task
* @Author: JiangYuQi * @Author: JiangYuQi
@ -80,7 +81,7 @@ public class AttendanceJgwTask {
* @return * @return
*/ */
public static String getToken(String appid, String secret) { public static String getToken(String appid, String secret) {
log.info("开始查询济网TOKEN...{}::{}",appid,secret); log.info("开始查询济网TOKEN...{}::{}",appid,secret);
String grantType = "client_credential"; String grantType = "client_credential";
String path = "/webapi/credential"; String path = "/webapi/credential";
Map<String, Object> params = new HashMap<>(); Map<String, Object> params = new HashMap<>();
@ -105,7 +106,7 @@ public class AttendanceJgwTask {
* *
*/ */
public void syncContractorAndGroupData() { public void syncContractorAndGroupData() {
log.info("开始同步济网单位&班组信息...{}",DateUtils.dateTimeStr()); log.info("开始同步济网单位&班组信息...{}",DateUtils.dateTimeStr());
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg(); QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
where.setEnabled(ShiFouEnums.SHI.getCode()); where.setEnabled(ShiFouEnums.SHI.getCode());
where.setIsDel(ShiFouEnums.FOU.getCode()); where.setIsDel(ShiFouEnums.FOU.getCode());
@ -139,7 +140,7 @@ public class AttendanceJgwTask {
* @param it * @param it
*/ */
private void doSyncProContractor(JSONObject jo, long startId, QuartzProAttendanceCfg it) { private void doSyncProContractor(JSONObject jo, long startId, QuartzProAttendanceCfg it) {
log.info("开始同步济参建单位信息...rows::{}",startId); log.info("开始同步济工网参建单位信息...rows::{}",startId);
String appId = jo.getString("appId"); String appId = jo.getString("appId");
String token = jo.getString("token"); String token = jo.getString("token");
String projectId = jo.getString("appProjectId"); String projectId = jo.getString("appProjectId");
@ -207,6 +208,22 @@ public class AttendanceJgwTask {
}else{ }else{
redisService.setCacheObject("doSyncProContractor.contractorId::"+json.getString("contractorId"),list.get(0),2L,TimeUnit.HOURS); 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) { if (arr.size()>=10 && rowId > 0) {
@ -247,7 +264,7 @@ public class AttendanceJgwTask {
* @param it * @param it
*/ */
private void doSyncDirectlyUnderGroup(JSONObject jo, long startId, QuartzProAttendanceCfg it) { private void doSyncDirectlyUnderGroup(JSONObject jo, long startId, QuartzProAttendanceCfg it) {
log.info("开始同步济直属班组信息...rows::{}",startId); log.info("开始同步济工网直属班组信息...rows::{}",startId);
String appId = jo.getString("appId"); String appId = jo.getString("appId");
String token = jo.getString("token"); String token = jo.getString("token");
String projectId = jo.getString("appProjectId"); String projectId = jo.getString("appProjectId");
@ -278,6 +295,7 @@ public class AttendanceJgwTask {
long rowId = 0; long rowId = 0;
for (int i = 0; i < arr.size(); i++) { for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i); JSONObject json = arr.getJSONObject(i);
//log.info("doSyncDirectlyUnderGroup...{}"+json);
Map<String, String> dataMap = convertSubJobTypes(json.getString("corpType")); Map<String, String> dataMap = convertSubJobTypes(json.getString("corpType"));
QuartzProSubdeptsGroup quartzProSubdeptsGroupQuery = new QuartzProSubdeptsGroup(); QuartzProSubdeptsGroup quartzProSubdeptsGroupQuery = new QuartzProSubdeptsGroup();
quartzProSubdeptsGroupQuery.setProjectId(it.getProjectId()); quartzProSubdeptsGroupQuery.setProjectId(it.getProjectId());
@ -330,6 +348,11 @@ public class AttendanceJgwTask {
*/ */
private Map<String, String> convertSubJobTypes(String jobTypes){ private Map<String, String> convertSubJobTypes(String jobTypes){
Map<String, String> dataMap = new HashMap<>(); Map<String, String> dataMap = new HashMap<>();
if(StringUtils.isEmpty(jobTypes)){
dataMap.put("type","3");
dataMap.put("post","4037");
return dataMap;
}
switch (jobTypes){ switch (jobTypes){
case "3001" : dataMap.put("type","2");dataMap.put("post","1015"); break; case "3001" : dataMap.put("type","2");dataMap.put("post","1015"); break;
case "3002" : dataMap.put("type","2");dataMap.put("post","1014"); break; case "3002" : dataMap.put("type","2");dataMap.put("post","1014"); break;
@ -500,7 +523,7 @@ public class AttendanceJgwTask {
* *
*/ */
public void syncProSubDeptWorker() { public void syncProSubDeptWorker() {
log.info("开始同步济网人员信息...{}",DateUtils.dateTimeStr()); log.info("开始同步济网人员信息...{}",DateUtils.dateTimeStr());
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg(); QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
@ -529,7 +552,7 @@ public class AttendanceJgwTask {
* *
*/ */
private void doSyncProSubDeptWorker(JSONObject jo, long startId, QuartzProAttendanceCfg it) { private void doSyncProSubDeptWorker(JSONObject jo, long startId, QuartzProAttendanceCfg it) {
log.info("开始同步济网人员信息...rows::{}",startId); log.info("开始同步济网人员信息...rows::{}",startId);
String appId = jo.getString("appId"); String appId = jo.getString("appId");
String token = jo.getString("token"); String token = jo.getString("token");
String projectId = jo.getString("appProjectId"); String projectId = jo.getString("appProjectId");
@ -557,6 +580,7 @@ public class AttendanceJgwTask {
if (arr.size() > 0) { if (arr.size() > 0) {
for (int i = 0; i < arr.size(); i++) { for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i); JSONObject json = arr.getJSONObject(i);
//log.info("doSyncProSubDeptWorker...{}",json);
QuartzProSubdeptsUsers quartzProSubdeptsUsersQuery = new QuartzProSubdeptsUsers(); QuartzProSubdeptsUsers quartzProSubdeptsUsersQuery = new QuartzProSubdeptsUsers();
quartzProSubdeptsUsersQuery.setProjectId(it.getProjectId()); quartzProSubdeptsUsersQuery.setProjectId(it.getProjectId());
quartzProSubdeptsUsersQuery.setUserPhone(json.getString("workPhone")); quartzProSubdeptsUsersQuery.setUserPhone(json.getString("workPhone"));
@ -593,7 +617,7 @@ public class AttendanceJgwTask {
quartzProSubdeptsUsers.setUserSex(json.getString("sex")); quartzProSubdeptsUsers.setUserSex(json.getString("sex"));
Map<String, String> userInfos = new HashMap<>(); Map<String, String> userInfos = new HashMap<>();
userInfos.put("nation",json.getString("minor")); 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)); long idStr = Long.parseLong(quartzProSubdeptsUsers.getCardCode().substring(0, 6));
String natStr = getNative(idStr); String natStr = getNative(idStr);
userInfos.put("nativePlace",natStr); userInfos.put("nativePlace",natStr);
@ -605,7 +629,9 @@ public class AttendanceJgwTask {
userInfos.put("bankOffice",json.getString("branchName")); userInfos.put("bankOffice",json.getString("branchName"));
userInfos.put("cardImgPos",cardImgPos); userInfos.put("cardImgPos",cardImgPos);
userInfos.put("cardImgInv",cardImgInv); userInfos.put("cardImgInv",cardImgInv);
quartzProSubdeptsUsers.setUserInfos(JSON.toJSONString(userInfos));
quartzProSubdeptsUsers.setUserPicture(userPicture); quartzProSubdeptsUsers.setUserPicture(userPicture);
quartzProSubdeptsUsers.setUserPhone(json.getString("workPhone"));
String adminCraftPost = convertAdminType(json.getString("adminType")); String adminCraftPost = convertAdminType(json.getString("adminType"));
if(StringUtils.isEmpty(adminCraftPost)){ if(StringUtils.isEmpty(adminCraftPost)){
//判断是否有岗位2 //判断是否有岗位2
@ -640,6 +666,9 @@ public class AttendanceJgwTask {
* @return * @return
*/ */
private String convertAdminType(String adminType){ private String convertAdminType(String adminType){
if(StringUtils.isEmpty(adminType)){
return "";
}
if(StringUtils.isNotEmpty(adminType)){ if(StringUtils.isNotEmpty(adminType)){
String craftPost = ""; String craftPost = "";
switch (adminType){ switch (adminType){
@ -680,6 +709,9 @@ public class AttendanceJgwTask {
* @return * @return
*/ */
private String convertJobType2(String jobType2){ private String convertJobType2(String jobType2){
if(StringUtils.isEmpty(jobType2)){
return "";
}
if(StringUtils.isNotEmpty(jobType2)){ if(StringUtils.isNotEmpty(jobType2)){
String craftPost = ""; String craftPost = "";
switch (jobType2){ switch (jobType2){
@ -712,9 +744,11 @@ public class AttendanceJgwTask {
sysUser.setUserName(quartzProSubdeptsUsers.getUserPhone()); sysUser.setUserName(quartzProSubdeptsUsers.getUserPhone());
sysUser.setNickName(quartzProSubdeptsUsers.getUserName()); sysUser.setNickName(quartzProSubdeptsUsers.getUserName());
sysUser.setPhonenumber(quartzProSubdeptsUsers.getUserPhone()); sysUser.setPhonenumber(quartzProSubdeptsUsers.getUserPhone());
sysUser.setPassword(SecurityUtils.encryptPassword(sysUser.getPhonenumber()+"@jgw"));
sysUser.setUpdateBy("JGW-TASK"); sysUser.setUpdateBy("JGW-TASK");
sysUser.setUpdateTime(DateUtils.getNowDate()); sysUser.setUpdateTime(DateUtils.getNowDate());
sysUser.setUserInfos(quartzProSubdeptsUsers.getUserInfos()); sysUser.setUserInfos(quartzProSubdeptsUsers.getUserInfos());
sysUser.setRemark(quartzProSubdeptsUsers.getSource());
String subDeptType = quartzProSubdeptsUsers.getSubDeptType(); String subDeptType = quartzProSubdeptsUsers.getSubDeptType();
// 判断单位类型 // 判断单位类型
@ -854,7 +888,7 @@ public class AttendanceJgwTask {
* *
*/ */
public void syncBeforeAttendanceData(String dtStart, String dtEnd, Long cfgId) { public void syncBeforeAttendanceData(String dtStart, String dtEnd, Long cfgId) {
log.info("开始同步济网人员考勤信息...{}::{}::{}",dtStart,dtEnd,cfgId); log.info("开始同步济网人员考勤信息...{}::{}::{}",dtStart,dtEnd,cfgId);
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg(); QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
where.setEnabled(1l); where.setEnabled(1l);
where.setIsDel(0l); where.setIsDel(0l);
@ -873,10 +907,20 @@ public class AttendanceJgwTask {
secret = Base64.encode(secret); secret = Base64.encode(secret);
jo.put("secret", secret); jo.put("secret", secret);
String token = getToken(appId, 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("token", token);
jo.put("startTime", dtStart); jo.put("startTime", findTimes);
jo.put("endTime", dtEnd); jo.put("endTime", findTimes);
doSyncAttendanceData(jo, "0", it); doSyncAttendanceData(jo, "0", it);
startCalendar.add(Calendar.DAY_OF_MONTH, 1);
}
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} }
@ -888,7 +932,7 @@ public class AttendanceJgwTask {
* *
*/ */
public void syncNowAttendanceData() { public void syncNowAttendanceData() {
log.info("开始同步济网人员考勤信息...{}",DateUtils.dateTimeStr()); log.info("开始同步济网人员考勤信息...{}",DateUtils.dateTimeStr());
String dtStart = DateUtils.getDate(); String dtStart = DateUtils.getDate();
String dtEnd = DateUtils.getDate(); String dtEnd = DateUtils.getDate();
QuartzProAttendanceCfg where = new QuartzProAttendanceCfg(); QuartzProAttendanceCfg where = new QuartzProAttendanceCfg();
@ -924,7 +968,7 @@ public class AttendanceJgwTask {
* @param it * @param it
*/ */
private void doSyncAttendanceData(JSONObject jo, String startId, QuartzProAttendanceCfg it) { private void doSyncAttendanceData(JSONObject jo, String startId, QuartzProAttendanceCfg it) {
log.info("开始同步济网人员考勤数据...rows:{}",startId); log.info("开始同步济网人员考勤数据...rows:{}",startId);
String appId = jo.getString("appId"); String appId = jo.getString("appId");
String token = jo.getString("token"); String token = jo.getString("token");
String projectId = jo.getString("appProjectId"); String projectId = jo.getString("appProjectId");
@ -955,6 +999,7 @@ public class AttendanceJgwTask {
if (arr != null && arr.size() > 0) { if (arr != null && arr.size() > 0) {
for (int i = 0; i < arr.size(); i++) { for (int i = 0; i < arr.size(); i++) {
JSONObject json = arr.getJSONObject(i); JSONObject json = arr.getJSONObject(i);
String datePath = json.getString("signDate");
String machineType = Convert.toStr(json.getString("machineType"),"1"); String machineType = Convert.toStr(json.getString("machineType"),"1");
QuartzProSubdeptsUsers quartzProSubdeptsUsersQuery = new QuartzProSubdeptsUsers(); QuartzProSubdeptsUsers quartzProSubdeptsUsersQuery = new QuartzProSubdeptsUsers();
quartzProSubdeptsUsersQuery.setProjectId(it.getProjectId()); quartzProSubdeptsUsersQuery.setProjectId(it.getProjectId());
@ -974,23 +1019,23 @@ public class AttendanceJgwTask {
//签进 //签进
if(quartzProAttendanceData.getOutTime()==null && quartzProAttendanceData.getInData()==null){ if(quartzProAttendanceData.getOutTime()==null && quartzProAttendanceData.getInData()==null){
quartzProAttendanceData.setInTime(DateUtils.parseDate(json.getString("checkinTime"))); 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); quartzProAttendanceData.setInPhoto(checkPhoto);
} }
}else if(machineType.equals("3")){ }else if(machineType.equals("3")){
//签出 //签出
quartzProAttendanceData.setOutTime(DateUtils.parseDate(json.getString("checkinTime"))); 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); quartzProAttendanceData.setOutPhoto(checkPhoto);
}else{ }else{
//默认 //默认
if(quartzProAttendanceData.getInData()==null){ if(quartzProAttendanceData.getInData()==null){
quartzProAttendanceData.setInTime(DateUtils.parseDate(json.getString("checkinTime"))); 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); quartzProAttendanceData.setInPhoto(checkPhoto);
}else{ }else{
quartzProAttendanceData.setOutTime(DateUtils.parseDate(json.getString("checkinTime"))); 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); quartzProAttendanceData.setOutPhoto(checkPhoto);
} }
} }
@ -1015,17 +1060,17 @@ public class AttendanceJgwTask {
if(machineType.equals("2")){ if(machineType.equals("2")){
//签进 //签进
quartzProAttendanceData.setInTime(checkinTime); 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.setInPhoto(checkPhoto);
}else if(machineType.equals("3")){ }else if(machineType.equals("3")){
//签出 //签出
quartzProAttendanceData.setOutTime(checkinTime); 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); quartzProAttendanceData.setOutPhoto(checkPhoto);
}else{ }else{
//默认 //默认
quartzProAttendanceData.setInTime(checkinTime); 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.setInPhoto(checkPhoto);
} }
quartzProAttendanceData.setDeviceNo(json.getString("deviceSerialNo")); quartzProAttendanceData.setDeviceNo(json.getString("deviceSerialNo"));
@ -1042,12 +1087,21 @@ public class AttendanceJgwTask {
/** /**
* *
* @param appId * @param appId
* @param token * @param token
* @param photo * @param proPackage
* @param datePath
* @param photo
* @return * @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 path = "/webapi/dictInfo/getPhoyoAllPaths";
String time = System.currentTimeMillis() + ""; String time = System.currentTimeMillis() + "";
String url = JGW_HOST + path + "?appId=" + appId + "&tokenSign=" + token + "&timestamp=" + time; String url = JGW_HOST + path + "?appId=" + appId + "&tokenSign=" + token + "&timestamp=" + time;
@ -1065,13 +1119,12 @@ public class AttendanceJgwTask {
String data = getResult(request); String data = getResult(request);
JSONObject j = JSON.parseObject(data); JSONObject j = JSON.parseObject(data);
JSONObject json = j.getJSONObject("data"); JSONObject json = j.getJSONObject("data");
try {
MultipartFile multipartFile = FileUtils.downloadFileToMultipart(json.getString("result")); 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(); return result.getData().getUrl();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }*/
return ""; return "";
} }

View File

@ -28,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<sql id="selectProAttendanceCfgVo"> <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 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 from attendance_cfg pac
left join sys_dept dp on pac.`com_id` = dp.`dept_id` left join sys_dept dp on pac.`com_id` = dp.`dept_id`
left join pro_project_info pp on pac.`project_id` = pp.`id` left join pro_project_info pp on pac.`project_id` = pp.`id`

View File

@ -6,6 +6,7 @@ import com.yanzhu.common.core.web.controller.BaseController;
import com.yanzhu.common.core.web.domain.AjaxResult; import com.yanzhu.common.core.web.domain.AjaxResult;
import com.yanzhu.device.domain.DevTowerDataLimit; import com.yanzhu.device.domain.DevTowerDataLimit;
import com.yanzhu.device.domain.DevTowerDataRun; import com.yanzhu.device.domain.DevTowerDataRun;
import com.yanzhu.device.domain.DevTowerDataWarning;
import com.yanzhu.device.domain.DevTowerProjectConfig; import com.yanzhu.device.domain.DevTowerProjectConfig;
import com.yanzhu.manage.service.*; import com.yanzhu.manage.service.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -42,6 +43,9 @@ public class TowerCraneController extends BaseController {
@Autowired @Autowired
private IDevTowerDataCollideService devTowerDataCollideService; private IDevTowerDataCollideService devTowerDataCollideService;
@Autowired
private IDevTowerDataWarningService devTowerDataWarningService;
@Autowired @Autowired
private IDevTowerProjectConfigService devTowerProjectConfigService; private IDevTowerProjectConfigService devTowerProjectConfigService;
@ -87,7 +91,7 @@ public class TowerCraneController extends BaseController {
@GetMapping("/selectDevTowerDataLimitList") @GetMapping("/selectDevTowerDataLimitList")
public AjaxResult selectDevTowerDataLimitList(DevTowerDataLimit devTowerDataLimit) public AjaxResult selectDevTowerDataLimitList(DevTowerDataLimit devTowerDataLimit)
{ {
startPage(); startPage(1,1);
devTowerDataLimit.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode())); devTowerDataLimit.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode()));
List<DevTowerDataLimit> list = devTowerDataLimitService.selectDevTowerDataLimitList(devTowerDataLimit); List<DevTowerDataLimit> list = devTowerDataLimitService.selectDevTowerDataLimitList(devTowerDataLimit);
return success(list); return success(list);
@ -99,9 +103,20 @@ public class TowerCraneController extends BaseController {
@GetMapping("/selectDevTowerDataRunList") @GetMapping("/selectDevTowerDataRunList")
public AjaxResult selectDevTowerDataRunList(DevTowerDataRun devTowerDataRun) public AjaxResult selectDevTowerDataRunList(DevTowerDataRun devTowerDataRun)
{ {
startPage(); startPage(1,1);
devTowerDataRun.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode())); devTowerDataRun.setIsDel(Convert.toLong(PublicStateEnum.OK.getCode()));
List<DevTowerDataRun> list = devTowerDataRunService.selectDevTowerDataRunList(devTowerDataRun); List<DevTowerDataRun> list = devTowerDataRunService.selectDevTowerDataRunList(devTowerDataRun);
return success(list); return success(list);
} }
/**
*
*/
@GetMapping("/findDevTowerDataWarningDatas")
public AjaxResult findDevTowerDataWarningDatas(DevTowerDataWarning devTowerDataWarning)
{
startPage(1,10);
List<DevTowerDataWarning> list = devTowerDataWarningService.selectDevTowerDataWarningList(devTowerDataWarning);
return success(list);
}
} }

View File

@ -4,9 +4,11 @@ import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.security.utils.SecurityUtils; import com.yanzhu.common.security.utils.SecurityUtils;
import com.yanzhu.device.domain.DevTowerDataRound; import com.yanzhu.device.domain.DevTowerDataRound;
import com.yanzhu.device.domain.DevTowerDataRun; import com.yanzhu.device.domain.DevTowerDataRun;
import com.yanzhu.device.domain.DevTowerDataWarning;
import com.yanzhu.device.mapper.DevTowerDataCollideMapper; import com.yanzhu.device.mapper.DevTowerDataCollideMapper;
import com.yanzhu.device.mapper.DevTowerDataRoundMapper; import com.yanzhu.device.mapper.DevTowerDataRoundMapper;
import com.yanzhu.device.mapper.DevTowerDataRunMapper; import com.yanzhu.device.mapper.DevTowerDataRunMapper;
import com.yanzhu.device.mapper.DevTowerDataWarningMapper;
import com.yanzhu.manage.service.IDevTowerDataRunService; import com.yanzhu.manage.service.IDevTowerDataRunService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -32,6 +34,9 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
@Autowired @Autowired
private DevTowerDataRoundMapper devTowerDataRoundMapper; private DevTowerDataRoundMapper devTowerDataRoundMapper;
@Autowired
private DevTowerDataWarningMapper devTowerDataWarningMapper;
@Autowired @Autowired
private DevTowerDataCollideMapper devTowerDataCollideMapper; private DevTowerDataCollideMapper devTowerDataCollideMapper;
@ -129,8 +134,9 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
devTowerDataRound.setActiveName("cz"); devTowerDataRound.setActiveName("cz");
int b0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); int b0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
dataMap.put("b0",b0); dataMap.put("b0",b0);
devTowerDataRound.setActiveName("gj"); DevTowerDataWarning devTowerDataWarning = new DevTowerDataWarning();
int c0 = devTowerDataRunMapper.findRunCountByDeviceKey(devTowerDataRound); devTowerDataWarning.setDeviceKey(deviceSn);
int c0 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning);
//int d0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); //int d0 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
//int e0 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound); //int e0 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound);
dataMap.put("c0",c0); dataMap.put("c0",c0);
@ -153,18 +159,17 @@ public class DevTowerDataRunServiceImpl implements IDevTowerDataRunService
params.put("beginCreateTime",firstDay); params.put("beginCreateTime",firstDay);
params.put("endCreateTime",lastDay); params.put("endCreateTime",lastDay);
devTowerDataRound.setParams(params); devTowerDataRound.setParams(params);
devTowerDataWarning.setParams(params);
int a1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); int a1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
dataMap.put("a1",a1); dataMap.put("a1",a1);
devTowerDataRound.setActiveName("cz"); devTowerDataRound.setActiveName("cz");
int b1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); int b1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
dataMap.put("b1",b1); dataMap.put("b1",b1);
devTowerDataRound.setActiveName("gj"); int c1 = devTowerDataWarningMapper.findWarningCountByDeviceKey(devTowerDataWarning);
int c1 = devTowerDataRunMapper.findRunCountByDeviceKey(devTowerDataRound);
//int d1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound); //int d1 = devTowerDataRoundMapper.findRoundCountByDeviceKey(devTowerDataRound);
//int e1 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound); //int e1 = devTowerDataCollideMapper.findCollideCountByDeviceKey(devTowerDataRound);
dataMap.put("c1",c1); dataMap.put("c1",c1);
return dataMap; return dataMap;
} }
} }

View File

@ -421,6 +421,16 @@ public class SysUserController extends BaseController {
return toAjax(userService.updataUserPassWord(vo)); 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();
}
/** /**
* *
*/ */

View File

@ -271,6 +271,13 @@ public interface ISysUserService
*/ */
public int updataUserPassWord(AlertUserPassVo alertUserPassVo); public int updataUserPassWord(AlertUserPassVo alertUserPassVo);
/**
*
* @param type
* @return
*/
public void updataUserPassWordSpecify(String type);
/** /**
* *
* @param userId * @param userId

View File

@ -539,6 +539,9 @@ public class SysUserServiceImpl implements ISysUserService
user.setCreateBy(user.getUpdateBy()); user.setCreateBy(user.getUpdateBy());
user.setCreateTime(user.getUpdateTime()); user.setCreateTime(user.getUpdateTime());
user.setWorkType(user.getWorkType()); user.setWorkType(user.getWorkType());
if(StringUtils.isEmpty(user.getPassword())){
user.setPassword(SecurityUtils.encryptPassword(user.getPhonenumber()+"@"+user.getUserType()));
}
userMapper.insertUser(user); userMapper.insertUser(user);
try { try {
String maOpenId = Convert.toStr(redisService.getCacheObject("SysUserUniopen::"+user.getPhonenumber()),null); String maOpenId = Convert.toStr(redisService.getCacheObject("SysUserUniopen::"+user.getPhonenumber()),null);
@ -1101,6 +1104,26 @@ public class SysUserServiceImpl implements ISysUserService
return userMapper.updateUser(sysUser); 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 @Override
public List<SysUserCom> getUserComs(Long userId) { public List<SysUserCom> getUserComs(Long userId) {
SysUserCom where=new SysUserCom(); SysUserCom where=new SysUserCom();
@ -1162,8 +1185,6 @@ public class SysUserServiceImpl implements ISysUserService
return userComs; return userComs;
} }
private SysUserExt findActiveUserExt(List<SysUserExt> userExts) { private SysUserExt findActiveUserExt(List<SysUserExt> userExts) {
SysUserExt find=null; SysUserExt find=null;
for(SysUserExt userExt:userExts){ for(SysUserExt userExt:userExts){