update code

dev_xd
lijun 2024-12-05 00:17:06 +08:00
parent f3790e1b68
commit 685a6db03e
13 changed files with 1492 additions and 9 deletions

View File

@ -1,8 +1,10 @@
import {axios,download} from '@/utils/request'
import project from './project'
import weather from './weather'
export default {
http:axios,
downFile:download,
project
project,
weather
}

View File

@ -0,0 +1,28 @@
import request from "@/utils/request";
const getByCity = (id) => {
return request({
url: "/manage/weather/city/"+id,
method: "get",
});
};
const getCityInfo = () => {
return request({
url: "/manage/weather/getCityInfo",
method: "get",
});
};
const getCityNowInfo = (id) => {
return request({
url: "/manage/weather/getCityNowInfo/"+id,
method: "get",
});
};
export default {
getByCity,
getCityInfo,
getCityNowInfo
}

View File

@ -0,0 +1 @@
<svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4468"><path d="M539.008 96.512l-19.2-21.76-19.2 21.76c-12.672 14.336-309.12 352.896-309.12 527.744 0 180.992 147.328 328.32 328.32 328.32 180.992 0 328.32-147.328 328.32-328.32 0-174.848-296.448-513.408-309.12-527.744z m-19.2 56.064c92.288 108.8 277.12 351.488 277.12 471.68 0 5.504-0.256 10.88-0.512 16.384-94.208 55.552-137.472 32.768-276.608-54.144-94.208-58.88-188.288-94.464-246.016-72.832 56.576-123.776 177.152-279.808 246.016-361.088z" p-id="4469"></path></svg>

After

Width:  |  Height:  |  Size: 638 B

View File

@ -0,0 +1,5 @@
<svg style="width: 1em;height: 1em;vertical-align: middle;overflow: hidden;"
viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"
p-id="5096">
<path d="M124.963333 147.67565q3.62592 45.203132 7.211551 90.124248C141.803715 359.18763 151.15053 480.575363 161.021089 601.922808c9.105087 112.181925 18.935358 224.303419 27.939726 336.404768 1.571232 19.620254 7.473423 28.987213 30.215997 28.886493q292.611717-1.329504 585.223433 0c21.956958 0 29.208797-8.057599 30.739741-28.201597q13.879215-182.142031 28.866349-364.203486c10.071999-119.453909 21.292206-238.807098 31.263485-358.28115 1.893536-22.62171 0.282016-45.505292 0.282016-68.932762 38.857772 6.043199 55.436283 23.306606 53.744187 57.954283-3.12232 63.554314-8.057599 127.06834-13.113742 190.521934-6.425935 79.991817-13.899359 159.903057-20.667743 239.874729-9.407247 111.215014-18.230318 222.470315-28.060589 333.645041-2.71944 30.780029-28.342605 53.985915-60.230554 54.046347q-314.790258 0.664752-629.600661 0c-33.439037 0-58.256443-23.42747-61.056459-56.201755-9.709407-113.048117-18.552622-226.156667-28.201597-339.204784C97.869655 505.110753 86.8106 382.01078 76.396153 258.850376a528.941102 528.941102 0 0 1-1.61152-58.175867C75.529961 169.954912 90.517096 154.32317 124.963333 147.67565z"
p-id="5097"></path><path d="M675.478657 0.241728c25.381438 40.287996 53.059291 99.370343 75.479561 141.189283 20.285006 37.850572 7.412991 79.286777-26.630366 105.45383-30.800173 23.669198-80.575992 23.145454-110.530117-1.148208-32.854861-26.690797-45.364284-69.899673-25.200142-106.440886C611.078295 98.484007 648.485699 40.287996 673.726129 0.926624c0.423024-0.684896 1.349648-1.269072 1.752528-0.684896zM542.407405 207.362317c36.460637 47.35854 67.824842 91.574615 86.941496 134.058307 14.261951 31.706653-3.041744 74.311209-32.391549 95.180391-34.023213 24.172798-77.796121 23.407326-110.127237-2.0144-30.800173-24.172798-45.062124-62.72841-28.080734-95.482551 22.964158-44.256364 55.436283-85.672424 83.658024-131.741747zM357.545935 74.049337c26.187198 42.584412 57.148523 93.931463 80.072392 138.288547 17.041822 32.995869 2.0144 73.847897-27.718141 95.643703-34.788685 25.522446-77.695401 25.784318-112.987686 0.664752-28.040445-19.962702-44.316796-64.702522-28.201597-96.248023 22.883582-44.155644 51.407483-85.35012 77.534249-127.793524a13.174175 13.174175 0 0 1 0.966912-1.389936c5.499311-7.392847 8.319471-12.025967 10.333871-9.165519zM757.122281 776.873431c7.553999 45.666444-1.349648 48.728331-37.931148 53.603179-28.846205 3.847504-64.460794 0.543888-93.407719-18.250462-5.036-3.263328-15.893615-2.155408-21.695086 1.128064-47.418972 26.791517-101.203447 26.34835-148.823858 2.195696-16.115198-8.198607-24.011646-10.696463-40.489437-0.946768-28.060589 11.844671-72.840697 18.351182-110.791989 14.946846C263.473464 825.903923 258.3166 817.503875 267.985719 773.529527c54.932683 33.016013 109.019318 25.985758 162.985089-2.356847 5.660463-2.981312 16.115198-0.564032 22.762718 2.759727 50.359995 25.603022 100.035095 30.054845 150.29437-0.443168 5.076288-3.082032 15.349727-3.666208 19.942558-0.564031 43.611756 29.249085 87.928552 28.362749 133.151827 3.948223zM615.066807 685.379392c-44.43766 25.522446-104.74879 34.426093-159.741905 7.050399-9.608687-4.794272-25.703742-5.177008-34.929693-0.523744-33.680765 16.941102-96.127159 21.070622-129.042452 14.523823C262.909432 700.769406 259.585672 692.953535 267.703703 652.665539c53.844907 30.215997 107.085494 27.758429 160.285793-1.631664 6.264783-3.444624 18.129598-1.047488 25.502302 2.497856 50.521147 24.172798 100.296967 28.725341 150.556242-0.866192 5.056144-2.981312 14.785695-2.941024 19.942558 0 44.075068 24.73683 88.331432 29.349805 133.554707 2.578432 6.627375 46.915372-9.487823 62.003226-59.726954 56.725498-14.564111-1.5108-69.758665-20.426014-82.751544-26.590077zM757.102137 532.80875C765.542473 583.007593 761.513673 590.219145 714.437149 586.190345c-27.637565-2.457568-51.749931-11.683519-81.7242-21.131054-13.577055-4.794272-21.634654-4.592832-29.974269-0.946768-46.532636 20.325294-93.125703 22.158398-139.295747 1.71224-18.411614-8.158319-33.177165-6.647519-52.132667-0.846048-32.955581 10.071999-55.496715 17.58571-89.801944 19.559822-46.512492 2.679152-61.21761-2.941024-55.375851-53.039147 4.189952 0.846048 8.621631 0.80576 12.086399 2.578432 48.486603 23.870638 96.086871 17.08211 144.170595-2.135264 9.729551-3.887792 23.62891-4.451824 33.177165-0.564032 49.231931 20.00299 97.456663 25.723886 146.225282-1.0072 5.640319-3.082032 19.49939-4.713696 24.454814-1.873392 44.33694 25.300862 85.229256 23.910926 130.855411 4.310816z" p-id="5098"></path></svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -0,0 +1 @@
<svg class="icon" style="width: 1em;height: 1em;vertical-align: middle;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3385"><path d="M512 512a90.784478 90.784478 0 0 0-39.431642 9.017313L324.852537 373.37791l-43.176119 43.17612 147.639403 147.715821A91.701493 91.701493 0 1 0 512 512zM878.80597 512a366.80597 366.80597 0 0 0-733.61194 0h61.134328a305.671642 305.671642 0 0 1 611.343284 0zM512 0a512 512 0 0 0-296.195821 929.547463l46.767761-70.151642a427.940299 427.940299 0 1 1 465.690747 21.702686l61.134328 61.134329A512 512 0 0 0 512 0z" p-id="3386"></path></svg>

After

Width:  |  Height:  |  Size: 618 B

View File

@ -0,0 +1 @@
<svg style="width: 1em;height: 1em;vertical-align: middle;overflow: hidden;" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7027"><path d="M519.723387 534.475706a19.438636 19.438636 0 0 0-19.438636 19.438636v450.559809a19.438636 19.438636 0 0 0 5.640675 13.79796 19.178297 19.178297 0 0 0 13.797961 5.727455h133.640621a19.525415 19.525415 0 0 0 13.79796-5.727455 19.091517 19.091517 0 0 0 5.640676-13.79796V553.827562a19.438636 19.438636 0 0 0-19.438636-19.438636h-34.104392V232.482613H798.37276v64.477261a19.351856 19.351856 0 0 0 29.244733 16.835247l164.187049-95.457586a19.525415 19.525415 0 0 0 0-33.757274l-164.187049-95.457587-3.210846-1.735592a18.39728 18.39728 0 0 0-6.508472-1.214915A19.525415 19.525415 0 0 0 798.37276 105.697582V173.559248H393.719372L99.710005 2.690168A19.265077 19.265077 0 0 0 89.990687 0H41.741216a19.438636 19.438636 0 0 0-19.438636 19.525415A21.087449 21.087449 0 0 0 23.430715 26.033887l60.745737 168.69959a19.351856 19.351856 0 0 1 0 13.277282l-60.745737 168.69959a19.351856 19.351856 0 0 0 18.223722 26.033887h48.33625a19.265077 19.265077 0 0 0 9.806098-2.603389l287.934793-167.658234h166.182981v301.906313z" p-id="7028"></path></svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -1,7 +1,7 @@
<template>
<div style="display: flex;align-items: center" class="people-number">
<div class="people-number-con">
<div v-for="item in people" v-html="item" :class="item==','?'is-split':''"></div>
<div v-for="(item,idx) in people" :key="idx" v-html="item" :class="item==','?'is-split':''"></div>
</div>
<div v-if="unit" class="number-unit" style="">{{unit}}</div>
</div>

View File

@ -12,6 +12,7 @@ import moduleOne13 from '../components/module/module-one-1-3.vue'
import moduleOne21 from '../components/module/module-one-2-1.vue'
import moduleOne22 from '../components/module/module-one-2-2.vue'
import moduleOne23 from '../components/module/module-one-2-3.vue'
import peopleNumber from '@/components/people-number.vue'
import MyDialog from '@/components/MyDialog.vue'
//import projectOverviewChart from '../components/project-overview-chart.vue'
//import peopleNumber from '../components/people-number.vue'
@ -27,6 +28,7 @@ Vue.component("module-one-1-3",moduleOne13)
Vue.component("module-one-2-1",moduleOne21)
Vue.component("module-one-2-2",moduleOne22)
Vue.component("module-one-2-3",moduleOne23)
Vue.component("people-number",peopleNumber)
Vue.component("MyDialog",MyDialog)
Vue.prototype.$bus=new Vue();
//Vue.component("people-number",peopleNumber)

View File

@ -359,17 +359,139 @@
</el-carousel>
</div>
</module-one-2-2>
<module-one-1-2 label="项目概况">
<module-one-1-2 label="项目节点计划预警">
<div class="dangerous-max">
<div class="dangerous-timeline-max">
<div class="dangerous-timeline-min" :style="{ width: maxWidth + 'px' }">
<template v-if="projectBuildNode && projectBuildNode.length > 0">
<div class="dangerous-timeline-con" v-for="item in projectBuildNode">
<div class="dangerous-text" v-html="item.nodeText"></div>
<div class="dangerous-dot">
<div class="dangerous-dot-item"></div>
</div>
<div class="dangerous-time-max">
<div class="dangerous-time-min">
计划{{ item.planEndDate || "---" }}
</div>
<div class="dangerous-time-min">
实际{{ item.endDate || "--" }}
</div>
<div v-if="item.finishState > 0"
class="project-expect-state dangerous-time-nav" :class="(item.finishState == 1 ? 'active' : '') +
' state-' +
item.finishState
">
{{ item.finish }}
</div>
</div>
</div>
</template>
</div>
<div class="strip-max" :style="{ width: maxWidth + 'px' }">
<div class="strip-min" :style="{ width: minWidth + 'px' }"></div>
</div>
</div>
</div>
</module-one-1-2>
</el-col>
<el-col :span="6" class="h100">
<module-one-1-1 label="项目概况">
<module-one-2-1 label="" class="no-title no-border work-info">
<div class="analyse-map">
<div class="analyse-title analyse_title_blue">
<div class="analyse-text">安全生产</div>
</div>
</div>
<div class="work-days" style="display: flex;align-items: center;justify-content: center;">
<div style="margin-right: 10px;"></div> <people-number :number="startDays"
unit=""></people-number>
<div style="margin-left:10px;"></div>
</div>
<div class="analyse-map">
<div class="analyse-title analyse_title_blue">
<div class="analyse-text">环境监测</div>
</div>
</div>
<div v-if="weathers" class="weather-list">
<div v-if="weathers.length > 0" class="weather-item">
<span class="weather-day">今天</span>
<span class="weather-info">{{ weathers[0].weather }}</span>
<img class="weather-img" :src="weathers[0].img" />
<span class="weather-temp">{{ weathers[0].highTemp }} {{ weathers[0].lowTemp }}</span>
</div>
<div v-if="weathers.length > 1" class="weather-item">
<span class="weather-day">明天</span>
<span class="weather-info">{{ weathers[1].weather }}</span>
<img class="weather-img" :src="weathers[1].img" />
<span class="weather-temp">{{ weathers[1].highTemp }} {{ weathers[1].lowTemp }}</span>
</div>
<div v-if="weathers.length > 2" class="weather-item">
<span class="weather-day">后天</span>
<span class="weather-info">{{ weathers[2].weather }}</span>
<img class="weather-img" :src="weathers[2].img" />
<span class="weather-temp">{{ weathers[2].highTemp }} {{ weathers[2].lowTemp }}</span>
</div>
</div>
<div class="weather-info">
<el-row>
<el-col :span="12" class="weather-info-item">
<div class="current-value-img">
<svg-icon icon-class="pressure"></svg-icon>
</div>
<div class="wi-data">
<div class="wi-label">当前气压</div>
<div class="wi-data-unit">
<span class="wi-txt">{{ weatherInfo.pressure }}</span>
<span class="wi-unit">hPa</span>
</div>
</div>
</el-col>
<el-col :span="12" class="weather-info-item">
<div class="current-value-img">
<svg-icon icon-class="humidity"></svg-icon>
</div>
<div class="wi-data">
<div class="wi-label">当前湿度</div>
<div class="wi-data-unit">
<span class="wi-txt">{{ weatherInfo.humidity }}</span>
<span class="wi-unit">%</span>
</div>
</div>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="weather-info-item">
<div class="current-value-img">
<svg-icon icon-class="precipitation"></svg-icon>
</div>
<div class="wi-data">
<div class="wi-label">当前降雨量</div>
<div class="wi-data-unit">
<span class="wi-txt">{{ weatherInfo.precipitation }}</span>
<span class="wi-unit">mm</span>
</div>
</div>
</el-col>
<el-col :span="12" class="weather-info-item">
<div class="current-value-img">
<svg-icon icon-class="wind"></svg-icon>
</div>
<div class="wi-data">
<div class="wi-label">当前风向</div>
<div class="wi-data-unit">
<span class="wi-txt">{{ weatherInfo.windDirection }}{{ weatherInfo.windScale
}}</span>
</div>
</div>
</el-col>
</el-row>
</div>
</module-one-2-1>
<module-one-1-1 label="项目监测预警">
</module-one-1-1>
<module-one-2-1 label="项目概况">
</module-one-2-1>
</el-col>
<project-info-dialog ref="infoDlg"></project-info-dialog>
</div>
@ -378,6 +500,7 @@
<script>
import projectInfoDialog from './detail/projectInfoDialog.vue';
import staffSurveyChart from '@/components/staffSurveyChart.vue';
import testData from './test/detail'
import debounce from 'lodash.debounce'
export default {
components: {
@ -413,9 +536,18 @@ export default {
costIndex: 0,
direction: "right",
costInterval: undefined,
cityInfo: [],
cityId: '',
startDays: 0,
weathers: [],
weatherInfo: {},
projectBuildNode: [],
maxWidth: 0,
minWidth: 100,
}
},
mounted() {
window.detailApp = this;
this.$store.dispatch('ChangeNav', 2);
this.$bus.$on('projectChange', debounce(prj => {
this.selProject = prj;
@ -431,6 +563,18 @@ export default {
}
});
this.costInterval = setInterval(this.manufacturingCostRoll, 5000);
this.$api.weather.getCityInfo().then(d => {
this.cityInfo = d.data?.city || [];
});
this.projectBuildNode = testData.projectBuildNode;
this.maxWidth = 200 * this.projectBuildNode.length;
let n = 0;
for (let i = 0; i < this.projectBuildNode.length; i++) {
if (this.projectBuildNode[i].finish == "进行中") {
n = i;
}
}
this.minWidth = n * 200 + 100;
},
methods: {
showDetailDlg() {
@ -457,6 +601,26 @@ export default {
this.deptType4 = func("监理单位");
this.deptType5 = func("检测单位");
this.deptType6 = func("勘察单位");
let tmp = this.cityInfo.map(d => { d[18] = Math.abs(d[4] - this.prjInfo.latitude) + Math.abs(d[5] - this.prjInfo.longitude); return d; });
tmp = tmp.sort((a, b) => a[18] - b[18]);
this.cityId = tmp.length > 0 && tmp[0].length > 0 ? tmp[0][0] : "";
if (this.prjInfo.actualOperatingTime) {
this.startDays = this.$dt(this.prjInfo.actualOperatingTime).diff(new Date(), "day") * -1;
} else {
this.startDays = 0;
}
if (this.cityId) {
this.$api.weather.getByCity(this.cityId).then(w => {
this.weathers = w.data || [];
})
this.getWeatherNowInfo();
}
});
},
getWeatherNowInfo() {
this.$api.weather.getCityNowInfo(this.cityId).then(cn => {
this.weatherInfo = cn?.data?.now || {};
setTimeout(this.getWeatherNowInfo, 1000 * 60 * 5);//5
});
},
doAttendanceNav(n) {
@ -639,6 +803,81 @@ export default {
}
}
}
.work-days {
margin: 20px 0px;
}
.weather-list {
margin-top: 30px;
.weather-item {
line-height: 40px;
.weather-day {
display: inline-block;
width: 30%;
}
.weather-temp {
display: inline-block;
margin-left: 30%;
}
.weather-img {
width: 20px;
}
}
}
.weather-info {
margin-top: 60px;
.el-row {
margin-top: 30px;
}
.weather-info-item {
display: flex;
align-items: center;
.current-value-img {
width: 60px;
height: 60px;
display: flex;
align-items: center;
justify-content: center;
.svg-icon {
width: 30px;
height: 30px;
fill: #63c8ff;
}
}
.wi-data {
margin-left: 10px;
line-height: 30px;
.wi-label {
font-size: 14px;
}
.wi-data-unit {
.wi-txt {
color: #fff;
font-weight: bold;
font-size: 16px;
}
.wi-unit {
margin-left: 4px;
font-size: 10px;
}
}
}
}
}
}
@media (min-width: 1921px) and (max-width: 2560px) {
@ -798,6 +1037,83 @@ export default {
}
}
}
.work-info {
.analyse-text {
font-size: 24px;
}
.analyse-title {
height: 60px;
}
.work-days {
margin: 20px 0px;
font-size: 24px;
.people-number-con {
div {
width: 40px;
height: 60px;
line-height: 60px;
font-size: 40px;
}
}
}
.weather-list {
margin-top: 50px;
.weather-item {
line-height: 60px;
font-size: 24px;
.weather-img {
width: 30px;
}
}
}
.weather-info {
margin-top: 80px;
.el-row {
margin-top: 60px;
}
.weather-info-item {
.current-value-img {
width: 80px;
height: 80px;
.svg-icon {
width: 40px;
height: 40px;
}
}
.wi-data {
margin-left: 10px;
line-height: 40px;
.wi-label {
font-size: 20px;
}
.wi-data-unit {
.wi-txt {
font-size: 24px;
}
.wi-unit {
margin-left: 4px;
font-size: 14px;
}
}
}
}
}
}
}
}
@ -973,6 +1289,83 @@ export default {
}
}
}
.work-info {
.analyse-text {
font-size: 30px;
}
.analyse-title {
height: 80px;
}
.work-days {
margin: 20px 0px;
font-size: 32px;
.people-number-con {
div {
width: 60px;
height: 90px;
line-height: 90px;
font-size: 50px;
}
}
}
.weather-list {
margin-top: 120px;
.weather-item {
line-height: 100px;
font-size: 40px;
.weather-img {
width: 40px;
}
}
}
.weather-info {
margin-top: 140px;
.el-row {
margin-top: 120px;
}
.weather-info-item {
.current-value-img {
width: 100px;
height: 100px;
.svg-icon {
width: 50px;
height: 50px;
}
}
.wi-data {
margin-left: 10px;
line-height: 50px;
.wi-label {
font-size: 30px;
}
.wi-data-unit {
.wi-txt {
font-size: 36px;
}
.wi-unit {
margin-left: 4px;
font-size: 20px;
}
}
}
}
}
}
}
}
</style>

View File

@ -0,0 +1,910 @@
const nodes = [
{
prjIds: null,
proType: "",
createBy: null,
createTime: "2023-08-19 23:55:15",
updateBy: "13289855903",
updateTime: "2024-04-09 17:19:11",
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 3018,
nodeId: 69,
projectId: 678,
startDate: "2023-01-28",
planStartDate: "2023-02-05",
endDate: "2023-04-02",
planEndDate: "2023-04-02",
status: null,
files: null,
isDel: 0,
baseBuildNode: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 69,
buildType: null,
nodeText: "项目启动",
nodeLvl: "01",
nodeType: 0,
isDel: null,
},
project: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 678,
deptId: null,
deptName: null,
projectName: "崇文佳苑棚户区改造项目10期",
projectCode: null,
paretProjectName: null,
paretProjectCode: null,
simpleName: null,
projectType: null,
projiectLevel: null,
projectRegional: null,
projectAddress: null,
projectNature: null,
licenceNumber: null,
projectApproval: null,
projectPerson: null,
projectPhone: null,
longitude: null,
latitude: null,
projectTimeLimit: null,
totalInvestment: null,
floorArea: null,
totalOutputValue: null,
plannedCompletionTime: null,
scheduledStartTime: null,
actualOperatingTime: null,
actualCompletionTime: null,
contractAmount: null,
paidAmount: null,
onAccountAmount: null,
projectSchedule: null,
projectSummarize: null,
isDel: null,
projectStatus: null,
servicePersonnel: null,
supervisorPersonnel: null,
generalContractor: null,
weightType: null,
projectSort: null,
progressVisible: null,
projectRegionalName: null,
prjPlanUrl: null,
prjRenderingUrl: null,
},
lvl: "01",
parentLvl: "",
nodeText: "项目启动",
file: [],
finish: "正常完成",
finishState: 3,
},
{
prjIds: null,
proType: "",
createBy: null,
createTime: "2023-08-19 23:55:15",
updateBy: "13289855903",
updateTime: "2024-04-09 17:19:11",
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 3022,
nodeId: 73,
projectId: 678,
startDate: "2023-09-01",
planStartDate: "2023-07-01",
endDate: "2023-12-17",
planEndDate: "2023-10-11",
status: null,
files: null,
isDel: 0,
baseBuildNode: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 73,
buildType: null,
nodeText: "土地获取",
nodeLvl: "02",
nodeType: 0,
isDel: null,
},
project: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 678,
deptId: null,
deptName: null,
projectName: "崇文佳苑棚户区改造项目10期",
projectCode: null,
paretProjectName: null,
paretProjectCode: null,
simpleName: null,
projectType: null,
projiectLevel: null,
projectRegional: null,
projectAddress: null,
projectNature: null,
licenceNumber: null,
projectApproval: null,
projectPerson: null,
projectPhone: null,
longitude: null,
latitude: null,
projectTimeLimit: null,
totalInvestment: null,
floorArea: null,
totalOutputValue: null,
plannedCompletionTime: null,
scheduledStartTime: null,
actualOperatingTime: null,
actualCompletionTime: null,
contractAmount: null,
paidAmount: null,
onAccountAmount: null,
projectSchedule: null,
projectSummarize: null,
isDel: null,
projectStatus: null,
servicePersonnel: null,
supervisorPersonnel: null,
generalContractor: null,
weightType: null,
projectSort: null,
progressVisible: null,
projectRegionalName: null,
prjPlanUrl: null,
prjRenderingUrl: null,
},
lvl: "02",
parentLvl: "",
nodeText: "土地获取",
file: [],
finish: "逾期完成",
finishState: 1,
},
{
prjIds: null,
proType: "",
createBy: null,
createTime: "2023-08-19 23:55:16",
updateBy: "13289855903",
updateTime: "2024-04-09 17:19:11",
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 3030,
nodeId: 81,
projectId: 678,
startDate: "2023-06-15",
planStartDate: "2023-06-15",
endDate: null,
planEndDate: "2025-12-31",
status: null,
files: null,
isDel: 0,
baseBuildNode: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 81,
buildType: null,
nodeText: "方案设计",
nodeLvl: "03",
nodeType: 0,
isDel: null,
},
project: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 678,
deptId: null,
deptName: null,
projectName: "崇文佳苑棚户区改造项目10期",
projectCode: null,
paretProjectName: null,
paretProjectCode: null,
simpleName: null,
projectType: null,
projiectLevel: null,
projectRegional: null,
projectAddress: null,
projectNature: null,
licenceNumber: null,
projectApproval: null,
projectPerson: null,
projectPhone: null,
longitude: null,
latitude: null,
projectTimeLimit: null,
totalInvestment: null,
floorArea: null,
totalOutputValue: null,
plannedCompletionTime: null,
scheduledStartTime: null,
actualOperatingTime: null,
actualCompletionTime: null,
contractAmount: null,
paidAmount: null,
onAccountAmount: null,
projectSchedule: null,
projectSummarize: null,
isDel: null,
projectStatus: null,
servicePersonnel: null,
supervisorPersonnel: null,
generalContractor: null,
weightType: null,
projectSort: null,
progressVisible: null,
projectRegionalName: null,
prjPlanUrl: null,
prjRenderingUrl: null,
},
lvl: "03",
parentLvl: "",
nodeText: "方案设计",
file: [],
finish: "进行中",
finishState: 2,
},
{
prjIds: null,
proType: "",
createBy: null,
createTime: "2023-08-19 23:55:17",
updateBy: "15991811421",
updateTime: "2024-06-05 19:54:12",
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 3039,
nodeId: 90,
projectId: 678,
startDate: "2023-06-15",
planStartDate: "2023-06-15",
endDate: "2024-01-09",
planEndDate: "2024-02-15",
status: null,
files: "[]",
isDel: 0,
baseBuildNode: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 90,
buildType: null,
nodeText: "报建",
nodeLvl: "04",
nodeType: 0,
isDel: null,
},
project: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 678,
deptId: null,
deptName: null,
projectName: "崇文佳苑棚户区改造项目10期",
projectCode: null,
paretProjectName: null,
paretProjectCode: null,
simpleName: null,
projectType: null,
projiectLevel: null,
projectRegional: null,
projectAddress: null,
projectNature: null,
licenceNumber: null,
projectApproval: null,
projectPerson: null,
projectPhone: null,
longitude: null,
latitude: null,
projectTimeLimit: null,
totalInvestment: null,
floorArea: null,
totalOutputValue: null,
plannedCompletionTime: null,
scheduledStartTime: null,
actualOperatingTime: null,
actualCompletionTime: null,
contractAmount: null,
paidAmount: null,
onAccountAmount: null,
projectSchedule: null,
projectSummarize: null,
isDel: null,
projectStatus: null,
servicePersonnel: null,
supervisorPersonnel: null,
generalContractor: null,
weightType: null,
projectSort: null,
progressVisible: null,
projectRegionalName: null,
prjPlanUrl: null,
prjRenderingUrl: null,
},
lvl: "04",
parentLvl: "",
nodeText: "报建",
file: [],
finish: "正常完成",
finishState: 3,
},
{
prjIds: null,
proType: "",
createBy: null,
createTime: "2023-08-19 23:55:18",
updateBy: "13289855903",
updateTime: "2024-04-09 17:19:11",
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 3055,
nodeId: 106,
projectId: 678,
startDate: "2023-12-01",
planStartDate: "2023-12-01",
endDate: "2024-01-30",
planEndDate: "2024-01-30",
status: null,
files: null,
isDel: 0,
baseBuildNode: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 106,
buildType: null,
nodeText: "招采",
nodeLvl: "05",
nodeType: 0,
isDel: null,
},
project: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 678,
deptId: null,
deptName: null,
projectName: "崇文佳苑棚户区改造项目10期",
projectCode: null,
paretProjectName: null,
paretProjectCode: null,
simpleName: null,
projectType: null,
projiectLevel: null,
projectRegional: null,
projectAddress: null,
projectNature: null,
licenceNumber: null,
projectApproval: null,
projectPerson: null,
projectPhone: null,
longitude: null,
latitude: null,
projectTimeLimit: null,
totalInvestment: null,
floorArea: null,
totalOutputValue: null,
plannedCompletionTime: null,
scheduledStartTime: null,
actualOperatingTime: null,
actualCompletionTime: null,
contractAmount: null,
paidAmount: null,
onAccountAmount: null,
projectSchedule: null,
projectSummarize: null,
isDel: null,
projectStatus: null,
servicePersonnel: null,
supervisorPersonnel: null,
generalContractor: null,
weightType: null,
projectSort: null,
progressVisible: null,
projectRegionalName: null,
prjPlanUrl: null,
prjRenderingUrl: null,
},
lvl: "05",
parentLvl: "",
nodeText: "招采",
file: [],
finish: "正常完成",
finishState: 3,
},
{
prjIds: null,
proType: "",
createBy: null,
createTime: "2023-08-19 23:55:19",
updateBy: "13289855903",
updateTime: "2024-04-09 17:19:11",
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 3066,
nodeId: 117,
projectId: 678,
startDate: "2024-01-31",
planStartDate: "2024-01-31",
endDate: null,
planEndDate: "2025-09-17",
status: null,
files: null,
isDel: 0,
baseBuildNode: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 117,
buildType: null,
nodeText: "施工阶段",
nodeLvl: "06",
nodeType: 1,
isDel: null,
},
project: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 678,
deptId: null,
deptName: null,
projectName: "崇文佳苑棚户区改造项目10期",
projectCode: null,
paretProjectName: null,
paretProjectCode: null,
simpleName: null,
projectType: null,
projiectLevel: null,
projectRegional: null,
projectAddress: null,
projectNature: null,
licenceNumber: null,
projectApproval: null,
projectPerson: null,
projectPhone: null,
longitude: null,
latitude: null,
projectTimeLimit: null,
totalInvestment: null,
floorArea: null,
totalOutputValue: null,
plannedCompletionTime: null,
scheduledStartTime: null,
actualOperatingTime: null,
actualCompletionTime: null,
contractAmount: null,
paidAmount: null,
onAccountAmount: null,
projectSchedule: null,
projectSummarize: null,
isDel: null,
projectStatus: null,
servicePersonnel: null,
supervisorPersonnel: null,
generalContractor: null,
weightType: null,
projectSort: null,
progressVisible: null,
projectRegionalName: null,
prjPlanUrl: null,
prjRenderingUrl: null,
},
lvl: "06",
parentLvl: "",
nodeText: "施工阶段",
file: [],
finish: "进行中",
finishState: 2,
},
{
prjIds: null,
proType: "",
createBy: null,
createTime: "2023-08-19 23:55:20",
updateBy: "13289855903",
updateTime: "2024-04-09 17:19:11",
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 3077,
nodeId: 128,
projectId: 678,
startDate: null,
planStartDate: "2025-09-18",
endDate: null,
planEndDate: "2025-12-31",
status: null,
files: null,
isDel: 0,
baseBuildNode: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 128,
buildType: null,
nodeText: "验收阶段",
nodeLvl: "07",
nodeType: 0,
isDel: null,
},
project: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 678,
deptId: null,
deptName: null,
projectName: "崇文佳苑棚户区改造项目10期",
projectCode: null,
paretProjectName: null,
paretProjectCode: null,
simpleName: null,
projectType: null,
projiectLevel: null,
projectRegional: null,
projectAddress: null,
projectNature: null,
licenceNumber: null,
projectApproval: null,
projectPerson: null,
projectPhone: null,
longitude: null,
latitude: null,
projectTimeLimit: null,
totalInvestment: null,
floorArea: null,
totalOutputValue: null,
plannedCompletionTime: null,
scheduledStartTime: null,
actualOperatingTime: null,
actualCompletionTime: null,
contractAmount: null,
paidAmount: null,
onAccountAmount: null,
projectSchedule: null,
projectSummarize: null,
isDel: null,
projectStatus: null,
servicePersonnel: null,
supervisorPersonnel: null,
generalContractor: null,
weightType: null,
projectSort: null,
progressVisible: null,
projectRegionalName: null,
prjPlanUrl: null,
prjRenderingUrl: null,
},
lvl: "07",
parentLvl: "",
nodeText: "验收阶段",
file: [],
finish: "未开始",
finishState: 4,
},
{
prjIds: null,
proType: "",
createBy: null,
createTime: "2023-08-19 23:55:21",
updateBy: "13289855903",
updateTime: "2024-04-09 17:19:11",
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 3087,
nodeId: 138,
projectId: 678,
startDate: null,
planStartDate: "2025-12-31",
endDate: null,
planEndDate: "2025-12-31",
status: null,
files: null,
isDel: 0,
baseBuildNode: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 138,
buildType: null,
nodeText: "交付阶段",
nodeLvl: "08",
nodeType: 1,
isDel: null,
},
project: {
prjIds: null,
proType: "",
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
activeName: null,
nowRole: null,
nowDept: null,
nowUser: null,
nowUserName: null,
projectDeptId: null,
comment: null,
id: 678,
deptId: null,
deptName: null,
projectName: "崇文佳苑棚户区改造项目10期",
projectCode: null,
paretProjectName: null,
paretProjectCode: null,
simpleName: null,
projectType: null,
projiectLevel: null,
projectRegional: null,
projectAddress: null,
projectNature: null,
licenceNumber: null,
projectApproval: null,
projectPerson: null,
projectPhone: null,
longitude: null,
latitude: null,
projectTimeLimit: null,
totalInvestment: null,
floorArea: null,
totalOutputValue: null,
plannedCompletionTime: null,
scheduledStartTime: null,
actualOperatingTime: null,
actualCompletionTime: null,
contractAmount: null,
paidAmount: null,
onAccountAmount: null,
projectSchedule: null,
projectSummarize: null,
isDel: null,
projectStatus: null,
servicePersonnel: null,
supervisorPersonnel: null,
generalContractor: null,
weightType: null,
projectSort: null,
progressVisible: null,
projectRegionalName: null,
prjPlanUrl: null,
prjRenderingUrl: null,
},
lvl: "08",
parentLvl: "",
nodeText: "交付阶段",
file: [],
finish: "未开始",
finishState: 4,
},
];
export default {
projectBuildNode:nodes
}

View File

@ -8,6 +8,7 @@ import java.time.LocalDateTime;
import java.time.LocalTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.lang3.time.DateFormatUtils;
@ -57,6 +58,18 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
{
return dateTimeNow(YYYY_MM_DD_HH_MM_SS);
}
public static long getSecondsUntilEndOfDay() {
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.HOUR_OF_DAY, 23);
calendar.set(Calendar.MINUTE, 59);
calendar.set(Calendar.SECOND, 59);
calendar.set(Calendar.MILLISECOND, 999);
long endOfDay = calendar.getTimeInMillis(); // 今天的结束时间(毫秒)
long currentTime = System.currentTimeMillis(); // 当前时间(毫秒)
return (long) ((endOfDay - currentTime) / 1000); // 转换为秒并计算差值
}
public static final String dateTimeNow()
{

View File

@ -98,7 +98,11 @@
<scope>system</scope>
<systemPath>${pom.basedir}\libs\aspose-tasks-24.10-jdk17.jar</systemPath>
</dependency>
<dependency>
<groupId>org.jsoup</groupId>
<artifactId>jsoup</artifactId>
<version>1.17.2</version>
</dependency>
</dependencies>
<build>

View File

@ -0,0 +1,123 @@
package com.yanzhu.manage.controller;
import com.yanzhu.common.core.utils.DateUtils;
import com.yanzhu.common.core.utils.StringUtils;
import com.yanzhu.common.core.web.domain.AjaxResult;
import com.yanzhu.common.redis.service.RedisService;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
@RestController
@RequestMapping("/weather")
public class WeatherController {
@Autowired
private RedisService redisService;
@GetMapping("/city/{id}")
public AjaxResult getWeather(@PathVariable("id") String id) {
if(StringUtils.isEmpty(id)){
id="V8870";
}
String cachKey="API_Weather_City2_"+id;
List<Map<String,String>> list=null;
if(redisService.hasKey(cachKey)){
list=redisService.getCacheObject(cachKey);
if(list!=null&&list.size()>0){
return AjaxResult.success(list);
}
}
list=new ArrayList<>();
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url("https://weather.cma.cn/web/weather/"+id+".html").build();
try {
Response res = client.newCall(request).execute();
String html = res.body().string();
Document doc = Jsoup.parse(html);
Elements els = doc.select("#dayList .pull-left");
for (Element el : els) {
Elements nodes = el.select(".day-item");
if (nodes.size() > 4) {
Map<String,String> item=new HashMap<>();
String date = nodes.get(0).text();
Elements imgs = nodes.get(1).select("img");
String img = imgs.size() > 0 ? imgs.get(0).attr("src") : "";
String wtxt = nodes.get(2).text();
Elements temperature = nodes.get(5).select(".high");
String wh = temperature.size() > 0 ? temperature.get(0).text() : "";
temperature = nodes.get(5).select(".low");
String lh = temperature.size() > 0 ? temperature.get(0).text() : "";
item.put("date", date);
item.put("img", "https://weather.cma.cn" + img );
item.put("weather", wtxt);
item.put("highTemp", wh);
item.put("lowTemp", lh);
list.add(item);
}
}
}catch (Exception ex){
ex.printStackTrace();
}
if(list!=null&&list.size()>0){
long time=DateUtils.getSecondsUntilEndOfDay();
redisService.setCacheObject(cachKey,list,time, TimeUnit.SECONDS);
}
return AjaxResult.success(list);
}
@GetMapping("/getCityInfo")
public String getCityInfo(){
String key="API_Weather_getCityInfo";
if(redisService.hasKey(key)){
return redisService.getCacheObject(key);
}
try {
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url("https://weather.cma.cn/api/map/weather/1?t=" + DateUtils.getTime()).build();
Response res = client.newCall(request).execute();
String html = res.body().string();
if(StringUtils.isNotEmpty(html)){
redisService.setCacheObject(key, html,1l, TimeUnit.DAYS);
}
return html;
}catch (Exception ex){
return "";
}
}
@GetMapping("/getCityNowInfo/{id}")
public String getCityNowInfo(@PathVariable("id") String id){
String key="API_Weather_getCityNowInfo";
if(redisService.hasKey(key)){
return redisService.getCacheObject(key);
}
try {
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder().url("https://weather.cma.cn/api/now/"+id+"?t=" + DateUtils.getTime()).build();
Response res = client.newCall(request).execute();
String html = res.body().string();
if(StringUtils.isNotEmpty(html)){
redisService.setCacheObject(key, html,1l, TimeUnit.HOURS);
}
return html;
}catch (Exception ex){
return "";
}
}
}