Quellcode durchsuchen

git-svn-id: https://192.168.57.71/svn/jsgkj@1356 931142cf-59ea-a443-aa0e-51397b428577

ld_xuhx vor 8 Jahren
Ursprung
Commit
a10e469bdc

+ 107 - 0
gkjsjy/trunk/WebContent/WEB-INF/pages/gkyxtjyfx/hxhbtj/hxhbtjpro.jsp

@@ -0,0 +1,107 @@
+<%@ page language="java" contentType="text/html; charset=UTF-8"
+	pageEncoding="UTF-8"%>
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="utf-8">
+    <title>江苏省港口建设与经营管理信息系统</title>
+    <meta name="viewport" content="width=device-width, initial-scale=1">
+
+    <%@ include file="../../common.jsp"%>
+	<script type="text/javascript" src="${app }/static/biz/js/gkyxtjyfx/hxhbtj/hxhbtjmain.js"></script>
+	<script type="text/javascript">
+		$(document).ready(function () {
+			iFrameHeightIframe('${menuid}');//自适应高度
+		});
+		
+		function searchMain(){
+			$("#hxhbtjproform").submit();
+		}
+	</script>
+	
+</head>
+
+<body>
+	<div class="box" >
+		<div class="box-content">
+		<h1 align="center" style="margin-top:0px;"><font style="font-size:25px;color:#196794;font-family:微软雅黑;font-weight: bold;">全省港口集装箱航线航班月度统计表(${rq }月)</h1>
+		<form action="${app }/hxhbtjpro/main" id="hxhbtjproform" method="post"> 
+		<input type="hidden" name="menuid" value="${menuid }">		
+		<div>
+   				   <table class="search_table" cellpadding="0" cellspacing="0">
+   				   	   <tr>
+							
+							<th width="10%"></th>
+							<th width="24%"></th>
+							<th width="10%"></th>
+							<th width="22%"></th>
+					   </tr>
+					   <tr>
+				            <td class="right">
+			                	日期:&nbsp;
+			                </td>
+			                <td>
+			                	<input class="Wdate" id="rq" name="rq" value="${rq }" type="text" onFocus="WdatePicker({lang:'zh-cn',skin:'default',dateFmt:'yyyy-MM'})">
+			                </td>
+	                        <td class="right" colspan="6">
+			                       	<a class="btn btn-default btn-sm" href="#" onclick="searchMain()">
+								   		<i class="glyphicon glyphicon-search"></i>查询
+							   		</a>
+	                        </td>
+	                    </tr>
+                    </table>
+          		</div>
+				<!-- 列表 -->
+			    <div  style="background-color:#f4f4f4;">
+				    <table class="main_table" cellpadding="0" cellspacing="0">
+					  
+						    <tr>
+				    			<th width="20%" rowspan="2">地区</th>
+				        		<th width="20%" colspan="2">远洋航线</th>
+								<th width="20%" colspan="2">近洋航线</th>
+								<th width="20%" colspan="2">外贸内支线</th>
+								<th width="20%" colspan="2">内贸航线</th>
+						    </tr>
+					   
+					    	<tr>
+				    			<th>航线</th>
+				    			<th>航班</th>
+				    			<th>航线</th>
+				    			<th>航班</th>
+				    			<th>航线</th>
+				    			<th>航班</th>
+				    			<th>航线</th>
+				    			<th>航班</th>
+						    </tr>
+						  <c:forEach items="${volist}" var="volist" varStatus="status">
+						  <tr>
+						  		<td>${volist.szd }</td>
+						  		<td>${volist.yyhxts }</td>
+						  		<td>${volist.yyhxhbs }</td>
+						  		<td>${volist.jyhxts }</td>
+						  		<td>${volist.jyhxhbs }</td>
+						  		<td>${volist.nzxts }</td>
+						  		<td>${volist.nzxhbs }</td>
+						  		<td>${volist.nmhxts }</td>
+						  		<td>${volist.nmhxhbs }</td>
+						  </tr>
+						  </c:forEach>
+					   	<tr>
+					   		<td>合计</td>
+					   		<td>${a1 }</td>
+					   		<td>${a2 }</td>
+					   		<td>${a3 }</td>
+					   		<td>${a4 }</td>
+					   		<td>${a5 }</td>
+					   		<td>${a6 }</td>
+					   		<td>${a7 }</td>
+					   		<td>${a8 }</td>
+					   	</tr>
+				    </table>
+				</div>
+				</form>
+		</div>
+</div>
+</body>
+</html>

+ 91 - 0
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hxhbtj/ctl/HxhbtjProCtl.java

@@ -0,0 +1,91 @@
+package com.xt.jygl.gkyxtjyfx.hxhbtj.ctl;
+
+import java.math.BigDecimal;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.Model;
+import org.springframework.web.bind.annotation.RequestMapping;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.ggfwxxgl.hxgl.service.HxglService;
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xt.jygl.gkjcxx.gk.service.GkService;
+import com.xt.jygl.gkyxtjyfx.gkttlfx.vo.GkttlfxVo;
+import com.xt.jygl.gkyxtjyfx.hxhbtj.service.HxhbtjService;
+import com.xt.jygl.gkyxtjyfx.hxhbtj.vo.HxhbtjVo;
+import com.xtframe.core.support.SecurityMgr;
+import com.xtframe.sec.common.QueryService;
+import com.xtframe.sec.common.SimplePageRequest;
+import com.xtframe.util.StringUtils;
+
+@Controller
+@RequestMapping("/hxhbtjpro")
+public class HxhbtjProCtl extends BaseWebCtl {
+	@Autowired
+	private HxglService hxglService;
+	@Autowired
+	private SecurityMgr securityMgr;
+	@Autowired
+	private GkService gkService;
+	@Autowired
+	private HxhbtjService hxhbtjService;
+	@Autowired
+	private QueryService query;
+
+	@RequestMapping(value = "/main")
+	public String main(SimplePageRequest page, Model model, final HttpServletRequest request, String rq, final String szgkid, final String menuid) throws JsonProcessingException {
+		
+		if(StringUtils.isEmpty(rq)){
+			SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+			rq = sdf.format(new Date());
+		}
+		
+		List<Object> list = hxhbtjService.findAllSzd(rq);
+		List<HxhbtjVo> volist = new ArrayList<HxhbtjVo>();
+		Object[] sum = new Object[10];
+		if(list != null && list.size()>0){
+			for (Object ob : list) {
+				Object[] e = (Object[]) ob;
+				HxhbtjVo vo = new HxhbtjVo();
+				vo.setSzd((String) e[0]);
+				vo.setYyhxts(e[1].toString());
+				vo.setYyhxhbs(e[2].toString());
+				vo.setJyhxts(e[3].toString());
+				vo.setJyhxhbs(e[4].toString());
+				vo.setNzxts(e[5].toString());
+				vo.setNzxhbs(e[6].toString());
+				vo.setNmhxts(e[7].toString());
+				vo.setNmhxhbs(e[8].toString());
+				volist.add(vo);
+				for (int j = 1; j < e.length; j++) {
+					BigDecimal s = new BigDecimal(0.0000);
+					if (sum[j] != null) {
+						s = (BigDecimal) sum[j];
+					}
+					BigDecimal ss = (BigDecimal) e[j];
+					s = s.add(ss);
+					sum[j] = s;
+				}
+			}
+		}
+		for (int i = 0; i < sum.length; i++) {
+			if (sum[i] != null) {
+				model.addAttribute("a" + i, sum[i].toString());
+			}
+		}
+		model.addAttribute("volist", volist);
+		model.addAttribute("rq", rq);
+		model.addAttribute("menuid", menuid);
+		return "gkyxtjyfx/hxhbtj/hxhbtjpro";
+	}
+
+	
+}

+ 2 - 2
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hxhbtj/service/HxhbtjService.java

@@ -2,9 +2,7 @@ package com.xt.jygl.gkyxtjyfx.hxhbtj.service;
 
 import java.util.List;
 
-import com.xt.jygl.gkjygl.gkjyr.jyrck.entity.CkEntity;
 import com.xt.jygl.gkyxtjyfx.hxhbtj.entity.HxhbtjEntity;
-import com.xt.jygl.workflow.service.BaseWorkFlowService;
 
 public interface HxhbtjService{
 
@@ -23,5 +21,7 @@ public interface HxhbtjService{
 	public List<Object> cf(String rq, String szgkid);
 
 	public <S extends HxhbtjEntity> S save(S entity);
+	
+	List<Object> findAllSzd(String rq);
 
 }

+ 19 - 0
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hxhbtj/service/impl/HxhbtjServiceImpl.java

@@ -1,9 +1,12 @@
 package com.xt.jygl.gkyxtjyfx.hxhbtj.service.impl;
 
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+
 import com.xt.jygl.common.service.JyglBaseService;
 import com.xt.jygl.gkyxtjyfx.hxhbtj.dao.HxhbtjDao;
 import com.xt.jygl.gkyxtjyfx.hxhbtj.entity.HxhbtjEntity;
@@ -46,4 +49,20 @@ public class HxhbtjServiceImpl extends JyglBaseService<HxhbtjEntity, String> imp
 		return dao.cf(rq, szgk);
 	}
 
+	@SuppressWarnings("unchecked")
+	@Override
+	public List<Object> findAllSzd(String rq) {
+		Map<String, Object> params = new HashMap<String, Object>();
+		StringBuilder sb = new StringBuilder();
+		sb.append("select d.text,nvl(a.a1, 0) yyhxts,nvl(a.a2, 0) yyhxhbs,nvl(a.a3, 0) jyhxts,nvl(a.a4, 0) jyhxhbs,");
+		sb.append("nvl(a.a5, 0) nzxts,nvl(a.a6, 0) nzxhbs,nvl(a.a7, 0) nmhxts,nvl(a.a8, 0) nmhxhbs");
+		sb.append(" from ");
+		sb.append(" (select t.szd szd,nvl(sum(t.yyhxts), 0) a1,nvl(sum(t.yyhxhbs), 0) a2,nvl(sum(t.jyhxts), 0) a3,nvl(sum(t.jyhxhbs), 0) a4,");
+		sb.append(" nvl(sum(t.nzxts), 0) a5,nvl(sum(t.nzxhbs), 0) a6, nvl(sum(t.nmhxts), 0) a7,nvl(sum(t.nmhxhbs), 0) a8 ");
+        sb.append(" from GK_OPERATION_JSJY_HXHBTJ t where t.rq = :rq group by t.szd) a") ;
+        sb.append(" right join gk_operation_jsjy_code d  on a.szd = d.id where d.pid = 900 ");
+        params.put("rq", rq);
+		return (List<Object>) dao.nativeQuery(sb.toString(), params);
+	}
+
 }