基础管理-线路工程管理

This commit is contained in:
lSun 2025-04-29 14:02:06 +08:00
parent 4130c81a57
commit 1a8cda96af
10 changed files with 120 additions and 74 deletions

View File

@ -0,0 +1,71 @@
package com.bonus.digitalSignage.basic.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.util.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ResourceLoader;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Objects;
@Api(tags = "下载")
@RestController
@RequestMapping("/download")
@Slf4j
public class DownloadController {
public static Logger logger = LoggerFactory.getLogger(DownloadController.class);
@Resource
private ResourceLoader resourceLoader;
@ApiOperation(value = "模板", httpMethod = "GET")
@GetMapping("download")
public void download(HttpServletRequest request, HttpServletResponse response, String filename) {
InputStream inputStream = null;
ServletOutputStream servletOutputStream = null;
try {
String path = "download/" + filename;
org.springframework.core.io.Resource resource = resourceLoader.getResource("classpath:" + path);
response.setContentType("application/vnd.ms-excel");
response.addHeader("Cache-Control", "no-cache, no-store, must-revalidate");
response.addHeader("charset", "utf-8");
response.addHeader("Pragma", "no-cache");
String encodeName = URLEncoder.encode(filename, StandardCharsets.UTF_8.toString());
response.setHeader("Content-Disposition", "attachment; filename=\"" + encodeName + "\"; filename*=utf-8''" + encodeName);
inputStream = resource.getInputStream();
servletOutputStream = response.getOutputStream();
IOUtils.copy(inputStream, servletOutputStream);
response.flushBuffer();
} catch (Exception e) {
e.printStackTrace();
} finally {
try {
if (servletOutputStream != null) {
servletOutputStream.close();
}
if (inputStream != null) {
inputStream.close();
}
// 召唤jvm的垃圾回收器
System.gc();
} catch (Exception e) {
e.printStackTrace();
}
}
}
}

View File

@ -15,14 +15,12 @@ public interface ProManagementDao {
List<ZNode> getAll(); List<ZNode> getAll();
ProManagementVo getProId(ProManagementVo bean);
int addPro(ProManagementVo bean); int addPro(ProManagementVo bean);
int updatePro(ProManagementVo bean); int updatePro(ProManagementVo bean);
int deletePro(ProManagementVo bean); int deletePro(ProManagementVo bean);
// int getProId(ProManagementVo bean); int getProId(ProManagementVo bean);
} }

View File

@ -48,8 +48,7 @@ public class ProManagementServiceImpl implements ProManagementService {
@Override @Override
public int getProId(ProManagementVo bean) { public int getProId(ProManagementVo bean) {
return 0; return dao.getProId(bean);
// return dao.getProId(bean);
} }

View File

@ -54,7 +54,7 @@ public class BnsSecurityConfig extends WebSecurityConfigurerAdapter {
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS); http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
http.authorizeRequests() http.authorizeRequests()
.antMatchers("/", "/*.html", "/favicon.ico", "/css/**", "/js/**", "/fonts/**", "/layui/**", "/img/**" .antMatchers("/", "/*.html", "/favicon.ico", "/css/**", "/js/**", "/fonts/**", "/layui/**", "/img/**"
, "/webjars/**", "/pages/**","/login","/loginApp/**", , "/webjars/**", "/pages/**","/login","/loginApp/**","/download/**",
"/statics/**","/websocketServer/**","/api/download/**") "/statics/**","/websocketServer/**","/api/download/**")
.permitAll().anyRequest().authenticated(); .permitAll().anyRequest().authenticated();
http.formLogin().loginProcessingUrl("/login") http.formLogin().loginProcessingUrl("/login")

View File

@ -15,9 +15,9 @@
po.is_active = '1' po.is_active = '1'
</select> </select>
<select id="getProId" resultType="com.bonus.digitalSignage.basic.vo.ProManagementVo"> <select id="getProId" resultType="java.lang.Integer">
SELECT parent_id as parentId FROM `tb_depart` SELECT count(1) FROM `tb_project`
WHERE id = #{parentId} WHERE depart_id = #{id}
</select> </select>
<insert id="addPro"> <insert id="addPro">

View File

@ -1,4 +1,10 @@
let form, layer, util,laydate, idParam, phoneParam,proId;
let arr = ['background', 'web', 'mobile', 'wx'];
let background, web, mobile, wx;
function setParams(params) { function setParams(params) {
console.log(params)
idParam = JSON.parse(params).id;
proId = JSON.parse(params).proId;
layui.use(['upload', 'layer'], function(){ layui.use(['upload', 'layer'], function(){
var upload = layui.upload; var upload = layui.upload;
var layer = layui.layer; var layer = layui.layer;
@ -27,26 +33,45 @@ function setParams(params) {
document.getElementById('downloadTemplateWGS84').addEventListener('click', function() { document.getElementById('downloadTemplateWGS84').addEventListener('click', function() {
layer.msg('开始下载WGS-84坐标系模板'); layer.msg('开始下载WGS-84坐标系模板');
// 实际项目中替换为真实的下载链接 // 实际项目中替换为真实的下载链接
// window.location.href = 'path/to/wgs84_template.xlsx'; window.location.href =ctxPath + '/download/download?filename=杆塔管理-WGS-84地心坐标系导入模版.xlsx';
}); });
// 2000国家大地坐标系模板下载 // 2000国家大地坐标系模板下载
document.getElementById('downloadTemplate2000').addEventListener('click', function() { document.getElementById('downloadTemplate2000').addEventListener('click', function() {
layer.msg('开始下载2000国家大地坐标系模板'); layer.msg('开始下载2000国家大地坐标系模板');
// 实际项目中替换为真实的下载链接 // 实际项目中替换为真实的下载链接
// window.location.href = 'path/to/2000_template.xlsx'; window.location.href = ctxPath +'/download/download?filename=杆塔管理-2000国家大地坐标系导入模版.xlsx';
}); });
let WG = {
uploadType: '1',
proId:proId
}
console.log("WG",WG)
let paramsWG = {
encryptedData: encryptCBC(JSON.stringify(WG))
}
let WG2 = {
uploadType: '2',
proId:proId
}
console.log("WG2",WG2)
let paramsWG2 = {
encryptedData: encryptCBC(JSON.stringify(WG2))
}
// WGS-84坐标系文件上传 // WGS-84坐标系文件上传
upload.render({ upload.render({
elem: '#uploadFileWGS84', elem: '#uploadFileWGS84',
url: '', // 上传接口 url: ctxPath + '/tbTower/tbTowerImport', // 上传接口
headers: {
"token": tokens
},
accept: 'file', accept: 'file',
exts: 'xls|xlsx', exts: 'xls|xlsx',
size: 10240, // 限制文件大小10MB size: 10240, // 限制文件大小10MB
data: { data: paramsWG,
system: 'wgs84'
},
before: function(obj) { before: function(obj) {
layer.load(); // 上传loading layer.load(); // 上传loading
}, },
@ -67,13 +92,14 @@ function setParams(params) {
// 2000国家大地坐标系文件上传 // 2000国家大地坐标系文件上传
upload.render({ upload.render({
elem: '#uploadFile2000', elem: '#uploadFile2000',
url: '', // 上传接口 url: ctxPath + '/tbTower/tbTowerImport', // 上传接口
headers: {
"token": tokens
},
accept: 'file', accept: 'file',
exts: 'xls|xlsx', exts: 'xls|xlsx',
size: 10240, // 限制文件大小10MB size: 10240, // 限制文件大小10MB
data: { data: paramsWG2,
system: '2000'
},
before: function(obj) { before: function(obj) {
layer.load(); // 上传loading layer.load(); // 上传loading
}, },

View File

@ -70,7 +70,11 @@ function initTable(dataList, limit, page) {
return (page - 1) * limit + d.LAY_INDEX; return (page - 1) * limit + d.LAY_INDEX;
} }
}, },
{field: "towerName", title: "杆塔号", unresize: true, align: "center"}, {field: "towerName", title: "杆塔号", unresize: true, align: "center",
templet: function (d) {
return d.towerName+"-"+d.nextTowerName;
}
},
{field: "", title: "跨越类型", unresize: true, align: "center", {field: "", title: "跨越类型", unresize: true, align: "center",
templet: function (d) { templet: function (d) {
if(d.spanType == 1){ if(d.spanType == 1){

View File

@ -182,59 +182,6 @@ function delData(id) {
}) })
} }
// 启用/停用/解除锁定
function editUserAccountStatus(id, status, type) {
let url = dataUrl + "/sys/user/editUserAccountStatus?token=" + token;
let params = {
'id': id,
'accountStatus': status,
'type': type
}
ajaxRequest(url, "POST", params, true, function () {
}, function (result) {
if (result.code === 200) {
if (type) {
reloadData();
}
parent.layer.msg(result.msg, {icon: 1})
} else if (result.code === 500) {
layer.alert(result.msg, {icon: 2})
}
}, function (xhr) {
error(xhr)
});
}
// 管理员修改密码
function resetPwd(id) {
let param = {
'id': id,
'type': '1'
}
openIframe2("addOrEditUnifyUser", '修改密码', "password.html", '770px', '400px', param);
}
function addTower(id){
let param = {
'id': id
}
openIframe2("tower", '杆塔管理', "child/towerList.html", '1200px', '625px', param);
}
function addThreeSpan(id){
let param = {
'id': id
}
openIframe2("threeSpan", '“三跨”管理', "child/threeSpanList.html", '1200px', '625px', param);
}
function addRopeway(id){
let param = {
'id': id
}
openIframe2("ropeway", '索道运输', "child/ropewayList.html", '1200px', '625px', param);
}
function exportTower(){ function exportTower(){
let obj = { let obj = {
towerName: $('#towerName').val(), towerName: $('#towerName').val(),
@ -269,7 +216,8 @@ function exportTower(){
function importTower(){ function importTower(){
let param = { let param = {
'id': '' 'id': '',
'proId':idParam
} }
openIframe2("ropeway", '数据导入', "importTower.html", '1000px', '625px', param); openIframe2("ropeway", '数据导入', "importTower.html", '1000px', '625px', param);
} }