修改文件

master
jyang_jun 2023-10-18 16:07:57 +08:00
parent 410ebb365c
commit aa5843438e
7 changed files with 53 additions and 308 deletions

View File

@ -94,53 +94,54 @@ public class IndexVController extends BaseController {
@GetMapping("/sum")
public String sum(ModelMap mmap, String platformId, String projectId, Integer year, Long index) {
if (ShiroUtils.getSysUser() == null && getSession().getAttribute("loginName") == null) {
return "redirect:/";
}
String plats = (String) getSession().getAttribute("plats");
if (ShiroUtils.getSysUser() == null && StringUtils.isEmpty(plats)) {
return prefix + "/noauth";
}
platformId = reset(platformId);
projectId = reset(projectId);
// String psql = "select * from dim_platform order by platform_name";
String psql = "select * from R1917GroupPlatform order by Sequence desc";
if (ShiroUtils.getSysUser() == null) {
psql = "select * from R1917GroupPlatform where id in ('" + plats.replaceAll(",", "','") + "')";
if (("," + plats + ",").indexOf("," + platformId + ",") < 0) {
platformId = plats.split(",")[0];
}
} else {
if (ShiroUtils.getSysUser().getDept().getParentId() != 0) {
platformId = ShiroUtils.getSysUser().getDeptId().toString();
// psql = "select * from dim_platform where id='" + platformId + "'";
psql = "select * from R1917GroupPlatform where id='" + platformId + "'";
}
}
mmap.put("indexs", indexVService.selectIndexVList(null));
mmap.put("indexId", index);
List<LinkedHashMap<String, Object>> platforms = ssMapper.selectDetail(psql);
mmap.put("platforms", platforms);
if (StringUtils.isEmpty(platformId)) {
platformId = platforms.get(0).get("ID").toString();
}
mmap.put("platformId", platformId);
mmap.put("projects", listProject(platformId));
mmap.put("projectId", projectId);
mmap.put("year", year);
if (index != null) {
IndexV v = indexVService.selectIndexVById(index);
mmap.put("v", v);
Map<String, String> summap = new HashMap<>();
mmap.put("sList", getSList(summap, platformId, projectId, year, v));
String valueString = new StrSubstitutor(summap).replace(v.getFormula());
mmap.put("value", getValue(valueString));
}
// if (ShiroUtils.getSysUser() == null && getSession().getAttribute("loginName") == null) {
// return "redirect:/";
// }
// String plats = (String) getSession().getAttribute("plats");
// if (ShiroUtils.getSysUser() == null && StringUtils.isEmpty(plats)) {
// return prefix + "/noauth";
// }
// platformId = reset(platformId);
// projectId = reset(projectId);
// // String psql = "select * from dim_platform order by platform_name";
// String psql = "select * from R1917GroupPlatform order by Sequence desc";
// if (ShiroUtils.getSysUser() == null) {
// psql = "select * from R1917GroupPlatform where id in ('" + plats.replaceAll(",", "','") + "')";
// if (("," + plats + ",").indexOf("," + platformId + ",") < 0) {
// platformId = plats.split(",")[0];
// }
// } else {
// if (ShiroUtils.getSysUser().getDept().getParentId() != 0) {
// platformId = ShiroUtils.getSysUser().getDeptId().toString();
// // psql = "select * from dim_platform where id='" + platformId + "'";
// psql = "select * from R1917GroupPlatform where id='" + platformId + "'";
//
// }
// }
// mmap.put("indexs", indexVService.selectIndexVList(null));
// mmap.put("indexId", index);
//// List<LinkedHashMap<String, Object>> platforms = ssMapper.selectDetail(psql);
// List<LinkedHashMap<String, Object>> platforms = new ArrayList<>();
// mmap.put("platforms", platforms);
// if (StringUtils.isEmpty(platformId)) {
// platformId = platforms.get(0).get("ID").toString();
// }
// mmap.put("platformId", "1");
// mmap.put("projects", "");
// mmap.put("projectId", "");
// mmap.put("year", year);
//
// if (index != null) {
//// IndexV v = indexVService.selectIndexVById(index);
// mmap.put("v", "1");
//
// // Map<String, String> summap = new HashMap<>();
// mmap.put("sList", "");
//
// // String valueString = new StrSubstitutor(summap).replace(v.getFormula());
// mmap.put("value", "");
//
// }
return prefix + "/sum";
}
@ -346,11 +347,8 @@ public class IndexVController extends BaseController {
@PostMapping("/listProject")
@ResponseBody
public List<LinkedHashMap<String, Object>> listProject(String platformId) {
return ssMapper.selectDetail(
// "select * from dwd_asset_project where platform_id='" + reset(platformId) +
// "' order by project_name");
"SELECT p.ID as ID,p.ProjectAbbr as ProjectName from R1917BIRoomProject p where p.IsDelete=0 and p.GroupPlatformId='"
+ reset(platformId) + "' order by p.Sequence");
List<LinkedHashMap<String, Object>> list = new ArrayList<>();
return list;
}
private String getValue(String valueString) {

View File

@ -26,7 +26,7 @@
<div class="col-sm-7">
<div class="signin-info">
<div class="logopanel m-b">
<h1><img th:src="@{/logo.jpg}" style="width:250px;border-radius:100%"></h1>
<h1><img th:src="@{/logo.jpg}" style="width:250px;border-radius:100%"></h1>
</div>
<div class="m-b"></div>
<h4></h4>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -26,7 +26,7 @@
</div>
<a th:href="@{/index}">
<li class="logo hidden-xs">
<span class="logo-lg">临港集团</span>
<span class="logo-lg">核数工具</span>
</li>
</a>
<div class="sidebar-collapse">

View File

@ -9,132 +9,6 @@
<div class="row">
<div class="col-sm-12 search-collapse">
<p class="select-title"><B>展示指标查询</B></p>
<form id="form0">
<div class="select-list">
<ul>
<li>
公司:<select name="platformId" id="platform">
<option th:value="${p.ID}" th:each="p:${platforms}" th:text="${p.PlatformName}" th:selected="${platformId == (p.ID+'')}"></option>
</select>
</li>
<li>
项目:<select name="projectId" id="project">
<option value="">全部</option>
<option th:value="${p.ID}" th:each="p:${projects}" th:text="${p.ProjectName}" th:selected="${projectId == (p.ID+'')}"></option>
</select>
</li>
<li>
指标:<select name="index" id="ii">
<option value=""></option>
<option th:value="${i.id}" th:each="i : ${indexs}" th:selected="${i.id==indexId}" th:year="${i.year}">[[${i.name}]]</option>
</select>
</li>
<li id="year" th:style="${v!=null&&v.year==1?'':'display:none'}">
年度:<select name="year" th:with="type=${@dict.getType('sys_year')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${(year+'')==dict.dictValue}"></option>
</select>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="dosum();"><i class="fa fa-search"></i>&nbsp;查看</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="col-sm-12 search-collapse" th:if="${v!= null}">
<p class="select-title"><B>[[${v.name}]][[${value}]]&nbsp;[[${v.unit}]]</B></p>
<div class="panel panel-primary">
<div class="panel-heading">
指标说明
</div>
<div class="panel-body">
<p th:text="${v.illustration}"></p>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
指标公式
</div>
<div class="panel-body">
<p th:text="${v.formula0}"></p>
</div>
</div>
<div class="panel panel-primary">
<div class="panel-heading">
备注
</div>
<div class="panel-body">
<p th:text="${v.remark}"></p>
</div>
</div>
<p class="select-title"><B>基础指标:</B></p>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>基础指标名称</th>
<th>
说明
</th>
<th style="text-align:right">
基础指标值
</th>
<th>
举例
</th>
</tr>
</thead>
<tbody>
<tr th:each="s:${sList}">
<th class="text-nowrap" th:text="${s.name}" th:style="${s.delFlag=='1'?'color:#C88':''}"></th>
<td th:text="${s.remark}" th:style="${s.delFlag=='1'?'color:#C88':''}"></td>
<td th:text="${s.sum+' '+s.unit}" th:style="${s.delFlag=='1'?'color:#C88;text-align:right':'text-align:right'}"></td>
<td><a href="#" data-toggle="modal" th:data-target="${'#myModal'+s.id}" th:if="${!#strings.isEmpty(s.sample)}">查看</a></td>
</tr>
</tbody>
</table>
</div>
<p class="select-title"><B>底层数据:</B><a class="btn btn-primary btn-sm" onclick="exportsum();"><i class="fa fa-download"></i>&nbsp;导出</a></p>
<div class="col-sm-12">
<div class="tabs-container">
<ul class="nav nav-tabs">
<li th:each="s:${sList}" th:class="${sList[0].id==s.id?'active':''}"><a data-toggle="tab" th:href="${'#tab-'+s.id}" th:aria-expanded="${sList[0].id==s.id}" th:text="${s.name}" th:style="${s.delFlag=='1'?'color:#C88':''}"></a>
</li>
</ul>
<div class="tab-content">
<div th:each="s:${sList}" th:id="${'tab-'+s.id}" th:class="${sList[0].id==s.id?'tab-pane active':'tab-pane'}">
<div class="panel-body">
<div class="table-responsive">
<div class="pull-right">
[[${s.detail.size()}]]条
</div>
<table class="table table-bordered table-striped" th:id="${'table'+s.id}">
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@ -142,140 +16,13 @@
</div>
<div class="modal inmodal fade" th:id="${'myModal'+s.id}" tabindex="-1" role="dialog" aria-hidden="true" th:each="s:${sList}">
<div class="modal-dialog modal-lg" style="width:1400px">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
</button>
<h4 class="modal-title" th:text="${s.name}"></h4>
</div>
<div class="modal-body" th:utext="${s.sample}">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: bootstrap-select-js" />
<th:block th:include="include :: jquery-cxselect-js" />
<script th:inline="javascript">
var prefix = ctx + "index/v";
function loadProject() {
var p =document.getElementById("project");
p.options.length=0;
if ($('#platform').val()!='' && $('#platform').val()!=null) {
$.post(prefix+"/listProject",
{
platformId:$('#platform').val()
},
function(result){
p.options.add(new Option("全部",""));
for (var project of result) {
p.options.add(new Option(project.ProjectName,project.ID));
}
});
}
}
function showYear() {
if ($("option:selected[year]").attr("year")==1) {
$("#year").show();
} else {
$("#year").hide();
}
}
$("#platform").change(function(){
loadProject();
});
$("#ii").change(function(){
showYear();
});
function dosum() {
if ($('#ii').val()!='' && $('#ii').val()!=null) {
$('#form0').submit();
} else {
$.modal.alertError("请选择指标");
}
}
function exportsum() {
$.modal.confirm("确定导出所有吗?", function() {
$.modal.loading("正在导出数据,请稍候...");
$.post(prefix+"/exportSum",
{
platformId:[[${platformId}]],
projectId:[[${projectId}]],
year:[[${year}]],
index:[[${v!=null?v.id:null}]],
},
function(result) {
if (result.code == web_status.SUCCESS) {
window.location.href = ctx + "common/download?fileName=" + encodeURI(result.msg) + "&delete=" + true;
} else if (result.code == web_status.WARNING) {
$.modal.alertWarning(result.msg);
} else {
$.modal.alertError(result.msg);
}
$.modal.closeLoading();
});
});
}
showYear();
</script>
<script th:inline="javascript" th:each="s:${sList}">
$([['#table'+${s.id}]]).bootstrapTable({
striped: true, //是否显示行间隔色
cache: false,
search: true,
searchAlign:"left",
data:[[${s.detail}]],
columns: [
{
title:'序号',
formatter: function (value, row, index) {
return index+1;
}
},
[# th:each="n:${s.keySet}"]
{
field : [[${n}]],
title : [[${n}]],
align : [[${s.getIsNum[n+'']?'right':'left'}]],
formatter: function (value, row, index) {
if (value != null) {
[# th:if="${s.getIsNum[n+'']}"]
var s=value.toString().split('.');
return s[0].replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g,'$&,')+(s.length>1?'.'+s[1]:'');
[/]
[# th:if="${!s.getIsNum[n+'']}"]
return "<span style='word-break:break-all'>"+value+"</span>";
[/]
} return null;
},
sortable: true
},
[/]
]
});
</script>
</body>

View File

@ -26,7 +26,7 @@
<div class="col-sm-7">
<div class="signin-info">
<div class="logopanel m-b">
<h1><img th:src="@{/logo.jpg}" style="width:250px;border-radius:100%"></h1>
<h1><img th:src="@{/logo.jpg}" style="width:250px;"></h1>
</div>
<div class="m-b"></div>
<h4></h4>