Bladeren bron

船舶转数据以及精确了了建成时间的精确度

git-svn-id: https://192.168.57.71/svn/jsgkj@1783 931142cf-59ea-a443-aa0e-51397b428577
ld_xuhx 8 jaren geleden
bovenliggende
commit
1237fc16ec

+ 5 - 2
gkjsjy/trunk/WebContent/WEB-INF/pages/gkjcxx/cb/cbview.jsp

@@ -38,7 +38,9 @@
                     	<tr>
 						 	<th>船舶分类:&nbsp;</th>
 	                        <td>
-		                        ${record.cbfl }
+		                        <c:if test="${record.cbfl=='A'}">国籍船舶 </c:if>
+		                        <c:if test="${record.cbfl=='B'}">外籍船舶 </c:if>
+		                        <c:if test="${record.cbfl=='C'}">澳船舶 </c:if>
 	                        </td>
 						 	<th>中文船名:&nbsp;</th>
 	                        <td >
@@ -119,7 +121,8 @@
 	                        </td>
 						 	<th>流转标志:&nbsp;</th>
 	                        <td >
-		                        ${record.lzbz }
+		                        <c:if test="${record.lzbz =='1'}">有效 </c:if>
+		                        <c:if test="${record.lzbz =='2'}">无效 </c:if>
 	                        </td>
 	                    </tr>
 					</table>

+ 16 - 1
gkjsjy/trunk/src/com/xt/jygl/gkjcxx/cb/ctl/CbCtl.java

@@ -1,6 +1,9 @@
 package com.xt.jygl.gkjcxx.cb.ctl;
 
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.Map;
 
@@ -132,9 +135,21 @@ public class CbCtl extends BaseWebCtl {
 		Page<CbEntity> list = query.findAll(spec, toPageRequest(page), CbEntity.class);
 		List<CbEntity> voList = new ArrayList<CbEntity>();
 		for (CbEntity entity : list) {
+			
+			//将建成时间精确到天
+			SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");//小写的mm表示的是分钟  
+			try {
+				Date date=sdf.parse(entity.getJcrq());
+				entity.setJcrq(sdf.format(date));
+			} catch (ParseException e) {
+				// TODO Auto-generated catch block
+				System.err.printf("船舶转日期格式错误");
+				e.printStackTrace();
+			} 
+			entity.setLzbz(entity.getLzbz().trim());
 			voList.add(entity);
 		}
-
+		
 		model.addAttribute("record", voList.get(0));
 		return "gkjcxx/cb/cbview";
 	}