修改文件
							parent
							
								
									410ebb365c
								
							
						
					
					
						commit
						aa5843438e
					
				|  | @ -94,53 +94,54 @@ public class IndexVController extends BaseController { | ||||||
| 	@GetMapping("/sum") | 	@GetMapping("/sum") | ||||||
| 	public String sum(ModelMap mmap, String platformId, String projectId, Integer year, Long index) { | 	public String sum(ModelMap mmap, String platformId, String projectId, Integer year, Long index) { | ||||||
| 
 | 
 | ||||||
| 		if (ShiroUtils.getSysUser() == null && getSession().getAttribute("loginName") == null) { | //		if (ShiroUtils.getSysUser() == null && getSession().getAttribute("loginName") == null) {
 | ||||||
| 			return "redirect:/"; | //			return "redirect:/";
 | ||||||
| 		} | //		}
 | ||||||
| 		String plats = (String) getSession().getAttribute("plats"); | //		String plats = (String) getSession().getAttribute("plats");
 | ||||||
| 		if (ShiroUtils.getSysUser() == null && StringUtils.isEmpty(plats)) { | //		if (ShiroUtils.getSysUser() == null && StringUtils.isEmpty(plats)) {
 | ||||||
| 			return prefix + "/noauth"; | //			return prefix + "/noauth";
 | ||||||
| 		} | //		}
 | ||||||
| 		platformId = reset(platformId); | //		platformId = reset(platformId);
 | ||||||
| 		projectId = reset(projectId); | //		projectId = reset(projectId);
 | ||||||
| 		// String psql = "select * from dim_platform order by platform_name";
 | //		// String psql = "select * from dim_platform order by platform_name";
 | ||||||
| 		String psql = "select * from R1917GroupPlatform order by Sequence desc"; | //		String psql = "select * from R1917GroupPlatform order by Sequence desc";
 | ||||||
| 		if (ShiroUtils.getSysUser() == null) { | //		if (ShiroUtils.getSysUser() == null) {
 | ||||||
| 			psql = "select * from R1917GroupPlatform where id in ('" + plats.replaceAll(",", "','") + "')"; | //			psql = "select * from R1917GroupPlatform where id in ('" + plats.replaceAll(",", "','") + "')";
 | ||||||
| 			if (("," + plats + ",").indexOf("," + platformId + ",") < 0) { | //			if (("," + plats + ",").indexOf("," + platformId + ",") < 0) {
 | ||||||
| 				platformId = plats.split(",")[0]; | //				platformId = plats.split(",")[0];
 | ||||||
| 			} | //			}
 | ||||||
| 		} else { | //		} else {
 | ||||||
| 			if (ShiroUtils.getSysUser().getDept().getParentId() != 0) { | //			if (ShiroUtils.getSysUser().getDept().getParentId() != 0) {
 | ||||||
| 				platformId = ShiroUtils.getSysUser().getDeptId().toString(); | //				platformId = ShiroUtils.getSysUser().getDeptId().toString();
 | ||||||
| 				// psql = "select * from dim_platform where id='" + platformId + "'";
 | //				// psql = "select * from dim_platform where id='" + platformId + "'";
 | ||||||
| 				psql = "select * from R1917GroupPlatform where id='" + platformId + "'"; | //				psql = "select * from R1917GroupPlatform where id='" + platformId + "'";
 | ||||||
| 
 | //
 | ||||||
| 			} | //			}
 | ||||||
| 		} | //		}
 | ||||||
| 		mmap.put("indexs", indexVService.selectIndexVList(null)); | //		mmap.put("indexs", indexVService.selectIndexVList(null));
 | ||||||
| 		mmap.put("indexId", index); | //		mmap.put("indexId", index);
 | ||||||
| 		List<LinkedHashMap<String, Object>> platforms = ssMapper.selectDetail(psql); | ////		List<LinkedHashMap<String, Object>> platforms = ssMapper.selectDetail(psql);
 | ||||||
| 		mmap.put("platforms", platforms); | //		List<LinkedHashMap<String, Object>> platforms = new ArrayList<>();
 | ||||||
| 		if (StringUtils.isEmpty(platformId)) { | //		mmap.put("platforms", platforms);
 | ||||||
| 			platformId = platforms.get(0).get("ID").toString(); | //		if (StringUtils.isEmpty(platformId)) {
 | ||||||
| 		} | //			platformId = platforms.get(0).get("ID").toString();
 | ||||||
| 		mmap.put("platformId", platformId); | //		}
 | ||||||
| 		mmap.put("projects", listProject(platformId)); | //		mmap.put("platformId", "1");
 | ||||||
| 		mmap.put("projectId", projectId); | //		mmap.put("projects", "");
 | ||||||
| 		mmap.put("year", year); | //		mmap.put("projectId", "");
 | ||||||
| 
 | //		mmap.put("year", year);
 | ||||||
| 		if (index != null) { | //
 | ||||||
| 			IndexV v = indexVService.selectIndexVById(index); | //		if (index != null) {
 | ||||||
| 			mmap.put("v", v); | ////			IndexV v = indexVService.selectIndexVById(index);
 | ||||||
| 
 | //			mmap.put("v", "1");
 | ||||||
| 			Map<String, String> summap = new HashMap<>(); | //
 | ||||||
| 			mmap.put("sList", getSList(summap, platformId, projectId, year, v)); | //	//		Map<String, String> summap = new HashMap<>();
 | ||||||
| 
 | //			mmap.put("sList", "");
 | ||||||
| 			String valueString = new StrSubstitutor(summap).replace(v.getFormula()); | //
 | ||||||
| 			mmap.put("value", getValue(valueString)); | //	//		String valueString = new StrSubstitutor(summap).replace(v.getFormula());
 | ||||||
| 
 | //			mmap.put("value", "");
 | ||||||
| 		} | //
 | ||||||
|  | //		}
 | ||||||
| 
 | 
 | ||||||
| 		return prefix + "/sum"; | 		return prefix + "/sum"; | ||||||
| 	} | 	} | ||||||
|  | @ -346,11 +347,8 @@ public class IndexVController extends BaseController { | ||||||
| 	@PostMapping("/listProject") | 	@PostMapping("/listProject") | ||||||
| 	@ResponseBody | 	@ResponseBody | ||||||
| 	public List<LinkedHashMap<String, Object>> listProject(String platformId) { | 	public List<LinkedHashMap<String, Object>> listProject(String platformId) { | ||||||
| 		return ssMapper.selectDetail( | 		List<LinkedHashMap<String, Object>> list = new ArrayList<>(); | ||||||
| 				// "select * from dwd_asset_project where platform_id='" + reset(platformId) +
 | 		return list; | ||||||
| 				// "' 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"); |  | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	private String getValue(String valueString) { | 	private String getValue(String valueString) { | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ | ||||||
|             <div class="col-sm-7"> |             <div class="col-sm-7"> | ||||||
|                 <div class="signin-info"> |                 <div class="signin-info"> | ||||||
|                     <div class="logopanel m-b"> |                     <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> | ||||||
|                     <div class="m-b"></div> |                     <div class="m-b"></div> | ||||||
|                     <h4></h4> |                     <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 | 
|  | @ -26,7 +26,7 @@ | ||||||
|         </div> |         </div> | ||||||
|         <a th:href="@{/index}"> |         <a th:href="@{/index}"> | ||||||
|             <li class="logo hidden-xs"> |             <li class="logo hidden-xs"> | ||||||
|                 <span class="logo-lg">临港集团</span> |                 <span class="logo-lg">核数工具</span> | ||||||
|             </li> |             </li> | ||||||
|          </a> |          </a> | ||||||
|         <div class="sidebar-collapse"> |         <div class="sidebar-collapse"> | ||||||
|  |  | ||||||
|  | @ -9,273 +9,20 @@ | ||||||
| 		<div class="row"> | 		<div class="row"> | ||||||
| 			<div class="col-sm-12 search-collapse"> | 			<div class="col-sm-12 search-collapse"> | ||||||
| 			    <p class="select-title"><B>展示指标查询</B></p> | 			    <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> 查看</a> |  | ||||||
| 							    <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</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}]] [[${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> 导出</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> | 			</div> | ||||||
| 
 | 
 | ||||||
| 			 | 			 | ||||||
| 		</div> | 		</div> | ||||||
| 	</div> | 	</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">×</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 :: footer" /> | ||||||
| 	<th:block th:include="include :: bootstrap-select-js" /> | 	<th:block th:include="include :: bootstrap-select-js" /> | ||||||
| 	<th:block th:include="include :: jquery-cxselect-js" /> | 	<th:block th:include="include :: jquery-cxselect-js" /> | ||||||
| 
 | 
 | ||||||
| 	<script th:inline="javascript"> | 	<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> |     </script> | ||||||
| </body> | </body> | ||||||
|  |  | ||||||
|  | @ -26,7 +26,7 @@ | ||||||
|             <div class="col-sm-7"> |             <div class="col-sm-7"> | ||||||
|                 <div class="signin-info"> |                 <div class="signin-info"> | ||||||
|                     <div class="logopanel m-b"> |                     <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> | ||||||
|                     <div class="m-b"></div> |                     <div class="m-b"></div> | ||||||
|                     <h4></h4> |                     <h4></h4> | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue