Browse Source

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

ld_guxl 8 years ago
parent
commit
b00e07dfab

+ 0 - 29
gkjsjy/trunk/src/com/xt/jygl/ggfwxxgl/hxgl/service/impl/HxcqglServiceImpl.java

@@ -1,29 +0,0 @@
-package com.xt.jygl.ggfwxxgl.hxgl.service.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.xt.jygl.common.service.JyglBaseService;
-import com.xt.jygl.ggfwxxgl.hxgl.dao.HxcqglDao;
-import com.xt.jygl.ggfwxxgl.hxgl.entity.HxcqglEntity;
-import com.xt.jygl.ggfwxxgl.hxgl.service.HxcqglService;
-import com.xt.jygl.gkjsgl.tzjhgl.dao.TzjhglDao;
-import com.xtframe.sec.common.SecRepository;
-
-@Service
-public class HxcqglServiceImpl extends JyglBaseService<HxcqglEntity, String> implements HxcqglService {
-	@Autowired
-	private HxcqglDao dao;
-	@Override
-	protected SecRepository<HxcqglEntity, String> getDao() {
-		return this.dao;
-	}
-
-	@Override
-	public List<HxcqglEntity> findByHxid(String hxid) {
-		return dao.findByHxid(hxid);
-	}
-
-}

+ 0 - 78
gkjsjy/trunk/src/com/xt/jygl/ggfwxxgl/hxgl/service/impl/HxglServiceImpl.java

@@ -1,78 +0,0 @@
-package com.xt.jygl.ggfwxxgl.hxgl.service.impl;
-
-import java.util.List;
-
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import com.xt.jygl.common.service.JyglBaseService;
-import com.xt.jygl.ggfwxxgl.hxgl.dao.HxcqglDao;
-import com.xt.jygl.ggfwxxgl.hxgl.dao.HxglDao;
-import com.xt.jygl.ggfwxxgl.hxgl.entity.HxglEntity;
-import com.xt.jygl.ggfwxxgl.hxgl.service.HxglService;
-import com.xt.jygl.ggfwxxgl.hxhbgl.entity.HxhbglEntity;
-import com.xtframe.sec.common.SecRepository;
-
-@Service
-public class HxglServiceImpl extends JyglBaseService<HxglEntity, String> implements HxglService {
-
-	@Autowired
-	private HxglDao dao;
-
-	@Override
-	protected SecRepository<HxglEntity, String> getDao() {
-		// TODO Auto-generated method stub
-		return this.dao;
-	}
-
-	@Override
-	public List<Object[]> kbxk(String bn, String by, String sn, String sy, String szgk) {
-		return dao.kbxk(bn, by, sn, sy, szgk);
-	}
-
-	@Override
-	public List<HxglEntity> findByRq(String rq) {
-		return dao.findByRq(rq);
-	}
-
-	@Override
-	public Object bywcltj(String rq, String szgk) {
-		return dao.bywcltj(rq, szgk);
-	}
-
-	@Override
-	public Object bnljltj(String rq, String szgk) {
-		return dao.bnljltj(rq, szgk);
-	}
-
-	@Override
-	public Object tbzzs(String rq, String lastyear, String szgk) {
-		return dao.tbzzs(rq, lastyear, szgk);
-	}
-
-	@Override
-	public List<Object> hxhbyytj(String rq, String szgk) {
-		return dao.hxhbyytj(rq, szgk);
-	}
-
-	@Override
-	public List<Object> hbyytj(String rq, String szgk) {
-		return dao.hbyytj(rq, szgk);
-	}
-
-	@Override
-	public List<HxglEntity> findByRqAndSzgk(String rq, String szgk) {
-		return dao.findByRqAndSzgk(rq, szgk);
-	}
-
-	@Override
-	public List<Object> bytyhxs(String rq, String szgk) {
-		return dao.bytyhxs(rq, szgk);
-	}
-
-	@Override
-	public void tingHang(String id) {
-		dao.tingHang(id);
-	}
-
-}

+ 49 - 0
gkjsjy/trunk/src/com/xt/jygl/ggfwxxgl/hxgl/service/impl/HxhbtjServiceImpl.java

@@ -0,0 +1,49 @@
+package com.xt.jygl.gkyxtjyfx.hxhbtj.service.impl;
+
+import java.util.List;
+
+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;
+import com.xt.jygl.gkyxtjyfx.hxhbtj.service.HxhbtjService;
+import com.xtframe.sec.common.SecRepository;
+
+@Service
+public class HxhbtjServiceImpl extends JyglBaseService<HxhbtjEntity, String> implements HxhbtjService {
+
+	@Autowired
+	private HxhbtjDao dao;
+
+	@Override
+	protected SecRepository<HxhbtjEntity, String> getDao() {
+		return this.dao;
+	}
+
+	@Override
+	public Object bnljltj(String year, String szgk) {
+		return dao.bnljltj(year, szgk);
+	}
+
+	@Override
+	public Object tbzzs(String rq, String lastyear, String szgk) {
+		return dao.tbzzs(rq, lastyear, szgk);
+	}
+
+	@Override
+	public List<Object[]> kbxk(String bn, String by, String sn, String sy, String szgk) {
+		return dao.kbxk(bn, by, sn, sy, szgk);
+	}
+
+	@Override
+	public Object bywcltj(String rq, String szgk) {
+		return dao.bywcltj(rq, szgk);
+	}
+
+	@Override
+	public List<Object> cf(String rq, String szgk) {
+		return dao.cf(rq, szgk);
+	}
+
+}

+ 564 - 97
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hxhbtj/ctl/HxhbtjCtl.java

@@ -1,45 +1,354 @@
 package com.xt.jygl.gkyxtjyfx.hxhbtj.ctl;
 
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
+import javax.persistence.criteria.CriteriaBuilder;
+import javax.persistence.criteria.CriteriaQuery;
+import javax.persistence.criteria.Predicate;
+import javax.persistence.criteria.Root;
+import javax.servlet.http.HttpServletRequest;
 
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.data.domain.Page;
+import org.springframework.data.jpa.domain.Specification;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
 import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
 
-import com.xt.jygl.ggfwxxgl.hxgl.entity.HxglEntity;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.xt.jygl.common.BaseWebCtl;
+import com.xt.jygl.common.Constants;
+import com.xt.jygl.common.GlobalData;
 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.hxhbtj.entity.HxhbtjEntity;
+import com.xt.jygl.gkyxtjyfx.hxhbtj.service.HxhbtjService;
 import com.xt.jygl.gkyxtjyfx.hxhbtj.vo.HxhbtjVo;
-import com.xtframe.core.base.ctl.BaseCtl;
+import com.xtframe.core.base.ctl.WebJsonResult;
 import com.xtframe.core.support.SecurityMgr;
+import com.xtframe.sec.code.entity.CodeEntity;
+import com.xtframe.sec.common.BaseEntity;
+import com.xtframe.sec.common.QueryService;
+import com.xtframe.sec.common.SimplePageRequest;
+import com.xtframe.sec.utils.SecUtils;
 import com.xtframe.util.StringUtils;
 
 @Controller
 @RequestMapping("/hxhbtj")
-public class HxhbtjCtl extends BaseCtl {
+public class HxhbtjCtl extends BaseWebCtl {
 	@Autowired
 	private HxglService hxglService;
 	@Autowired
 	private SecurityMgr securityMgr;
 	@Autowired
 	private GkService gkService;
+	@Autowired
+	private HxhbtjService hxhbtjService;
+	@Autowired
+	private QueryService query;
 
-	/**
-	 * 统计一览页面
-	 * @param model
-	 * @param rq 日期
-	 * @param szgkid 所在港区ID
-	 * @param menuid
-	 * @return
-	 */
-	@SuppressWarnings("unused")
+//	@SuppressWarnings("unused")
 	@RequestMapping(value = "/main")
-	public String main(Model model, final String rq, final String szgkid, final String menuid) {
+//	@RequiresPermissions("hxhbtj:main")
+	public String main(SimplePageRequest page, Model model, final HttpServletRequest request, final String rq, final String szgkid, final String menuid) throws JsonProcessingException {
+		// 查询条件
+		Specification<HxhbtjEntity> spec = new Specification<HxhbtjEntity>() {
+			@Override
+			public Predicate toPredicate(Root<HxhbtjEntity> root, CriteriaQuery<?> query, CriteriaBuilder cb) {
+				List<Predicate> list = new ArrayList<Predicate>();
+				//所在港口
+				if (StringUtils.isNotEmpty(szgkid)) {
+					list.add(cb.like(root.get("szgk").get("id").as(String.class), "%" + szgkid + "%"));
+				}
+				//日期
+				if (rq != null) {
+					list.add(cb.like(root.get("rq").as(String.class), "%" + rq + "%"));
+				}
+				
+				list.add(cb.notEqual(root.get("recordStatus").as(Integer.class), BaseEntity.RECORD_STATE_DELETE));
+				return cb.and(list.toArray(new Predicate[] {}));
+			}
+		};
+
+		Page<HxhbtjEntity> list = query.findAll(spec, toPageRequest(page), HxhbtjEntity.class);
+		List<HxhbtjVo> voList = new ArrayList<HxhbtjVo>();
+		for (HxhbtjEntity entity : list) {
+			HxhbtjVo vo = new HxhbtjVo();
+			if (entity != null) {
+				BeanUtils.copyProperties(entity, vo);
+				vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
+				vo.setBywcl(entity.getBywcl() != null ? entity.getBywcl().toString() : "");
+				vo.setBnljl(entity.getBnljl() != null ? entity.getBnljl().toString() : "");
+				vo.setTbzzs(entity.getTbzzs() != null ? entity.getTbzzs().toString() : "");
+				vo.setRq(entity.getRq() != null ? entity.getRq().toString() : "");
+				voList.add(vo);
+			}
+		}
+
+		model.addAttribute("list", voList);
+		model.addAttribute("menuid", menuid);
+		model.addAttribute("szgkid", szgkid);
+		model.addAttribute("rq", rq);
+		
+		// 翻页共通
+		putPageInfo(model, page, list);
+		return "gkyxtjyfx/hxhbtj/hxhbtj";
+	}
+	
+	@RequestMapping(value = "/delete")
+//	@RequiresPermissions("hxhbtj:delete")
+	@ResponseBody
+	public WebJsonResult delete(Model model, String id) {
+		WebJsonResult wr = success();
+		try {
+			hxhbtjService.logicDelete(id);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return wr;
+	}
+	
+	@RequestMapping(value = "/view")
+//	@RequiresPermissions("hxhbtj:main")
+	public String view(Model model, String id, String menuid) {
+		HxhbtjEntity entity = hxhbtjService.findOne(id);
+		HxhbtjVo vo = new HxhbtjVo();
+		BeanUtils.copyProperties(entity, vo);
+		vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
+		vo.setBywcl(entity.getBywcl() != null ? entity.getBywcl().toString() : "");
+		vo.setBnljl(entity.getBnljl() != null ? entity.getBnljl().toString() : "");
+		vo.setTbzzs(entity.getTbzzs() != null ? entity.getTbzzs().toString() : "");
+		vo.setRq(entity.getRq() != null ? entity.getRq().toString() : "");
+		
+		//月内外贸完成量
+		vo.setNmjzxttl(entity.getNmjzxttl() != null ? entity.getNmjzxttl().toString() : "");
+		vo.setWmjzxttl(entity.getWmjzxttl() != null ? entity.getWmjzxttl().toString() : "");
+		
+		//年内外贸完成量
+		vo.setNnmjzxttl(entity.getNnmjzxttl() != null ? entity.getNnmjzxttl().toString() : "");
+		vo.setNwmjzxttl(entity.getNwmjzxttl() != null ? entity.getNwmjzxttl().toString() : "");
+		
+		//内外贸同比增长数
+		vo.setNmtbzzs(entity.getNmtbzzs() != null ? entity.getNmtbzzs().toString() : "");
+		vo.setWmtbzzs(entity.getWmtbzzs() != null ? entity.getWmtbzzs().toString() : "");
+		
+		//本月运营航线、航班数
+		vo.setYyhxts(entity.getYyhxts() != null ? entity.getYyhxts().toString() : "");
+		vo.setYyhxhbs(entity.getYyhxhbs() != null ? entity.getYyhxhbs().toString() : "");
+		vo.setJyhxts(entity.getJyhxts() != null ? entity.getJyhxts().toString() : "");
+		vo.setJyhxhbs(entity.getJyhxhbs() != null ? entity.getJyhxhbs().toString() : "");
+		
+		vo.setNzxts(entity.getNzxts() != null ? entity.getNzxts().toString() : "");
+		vo.setNzxhbs(entity.getJyhxhbs() != null ? entity.getNzxhbs().toString() : "");
+		vo.setNmhxts(entity.getNmhxts() != null ? entity.getNmhxts().toString() : "");
+		vo.setNmhxhbs(entity.getNmhxhbs() != null ? entity.getNmhxhbs().toString() : "");
+		
+		// 新开辟航线数
+		vo.setYyxkphxs(entity.getYyxkphxs() != null ? entity.getYyxkphxs().toString() : "");
+		vo.setYytkhxs(entity.getYytkhxs() != null ? entity.getYytkhxs().toString() : "");
+		vo.setJyxkphxs(entity.getJyxkphxs() != null ? entity.getJyxkphxs().toString() : "");
+		vo.setJytkhxs(entity.getJytkhxs() != null ? entity.getJytkhxs().toString() : "");
+		
+		//停开航线数
+		vo.setNzxxkphxs(entity.getNzxxkphxs() != null ? entity.getNzxxkphxs().toString() : "");
+		vo.setNzxtkhxs(entity.getNzxtkhxs() != null ? entity.getNzxtkhxs().toString() : "");
+		vo.setNmxkphxs(entity.getNmxkphxs() != null ? entity.getNmxkphxs().toString() : "");
+		vo.setNmtkhxs(entity.getNmtkhxs() != null ? entity.getNmtkhxs().toString() : "");
+		
+		// 填表人跟联系电话
+		vo.setTbr(securityMgr.getCurrUser().getName());
+		if (securityMgr.getCurrUser().getSfjyr().getText().equals("是")) {
+			vo.setLxdh(securityMgr.getCurrUser().getSsjyr().getLxdh());
+		} else {
+			vo.setLxdh(securityMgr.getCurrUser().getSsglbm() != null ? securityMgr.getCurrUser().getSsglbm().getLxdh() : "");
+		}
+		
+		model.addAttribute("record", vo);
+		model.addAttribute("menuid", menuid);
+		return "gkyxtjyfx/hxhbtj/hxhbtjView";
+	}
+	
+	
+	@RequestMapping(value = "/add")
+//	@RequiresPermissions("hxhbtj:add")
+	public String add(Model model, String menuid, String path) {
+		if (!StringUtils.isEmpty(path)) {
+			path = path.replace(":", "&");
+			String jyrid = path.substring(path.lastIndexOf("=") + 1);
+		}
+		if(SecUtils.getCurrUser() != null){
+			List<CodeEntity> list = securityMgr.codeService().findValidCodesByGroupCodeAndCity(Constants.GROUP_CODE_SZD, GlobalData.CITY_CODE);
+			model.addAttribute("sz",list.size()==1?list.get(0).getId():"");
+			if(list.size()==1){
+				List<GkEntity> gklist = gkService.findBySzd(list.get(0).getId());
+				model.addAttribute("gk",gklist.size()==1?gklist.get(0).getId():"");
+			}
+		}
+		model.addAttribute("path", path);
+		model.addAttribute("menuid", menuid);
+		return "gkyxtjyfx/hxhbtj/hxhbtjAdd";
+	}
+	
+	@RequestMapping(value = "/edit")
+//	@RequiresPermissions("hxhbtj:edit")
+	public String edit(Model model, String id, String path) {
+		if (!StringUtils.isEmpty(path)) {
+			path = path.replace(":", "&");
+		}
+		model.addAttribute("path", path);
+		HxhbtjEntity entity = hxhbtjService.findOne(id);
+		HxhbtjVo vo = new HxhbtjVo();
+		BeanUtils.copyProperties(entity, vo);
+		vo.setSzgkzw(entity.getSzgk() != null ? entity.getSzgk().getGkmc() : "");
+		vo.setBywcl(entity.getBywcl() != null ? entity.getBywcl().toString() : "");
+		vo.setBnljl(entity.getBnljl() != null ? entity.getBnljl().toString() : "");
+		vo.setTbzzs(entity.getTbzzs() != null ? entity.getTbzzs().toString() : "");
+		vo.setRq(entity.getRq() != null ? entity.getRq().toString() : "");
+		
+		//月内外贸完成量
+		vo.setNmjzxttl(entity.getNmjzxttl() != null ? entity.getNmjzxttl().toString() : "");
+		vo.setWmjzxttl(entity.getWmjzxttl() != null ? entity.getWmjzxttl().toString() : "");
+		
+		//年内外贸完成量
+		vo.setNnmjzxttl(entity.getNnmjzxttl() != null ? entity.getNnmjzxttl().toString() : "");
+		vo.setNwmjzxttl(entity.getNwmjzxttl() != null ? entity.getNwmjzxttl().toString() : "");
+		
+		//内外贸同比增长数
+		vo.setNmtbzzs(entity.getNmtbzzs() != null ? entity.getNmtbzzs().toString() : "");
+		vo.setWmtbzzs(entity.getWmtbzzs() != null ? entity.getWmtbzzs().toString() : "");
+		
+		//本月运营航线、航班数
+		vo.setYyhxts(entity.getYyhxts() != null ? entity.getYyhxts().toString() : "");
+		vo.setYyhxhbs(entity.getYyhxhbs() != null ? entity.getYyhxhbs().toString() : "");
+		vo.setJyhxts(entity.getJyhxts() != null ? entity.getJyhxts().toString() : "");
+		vo.setJyhxhbs(entity.getJyhxhbs() != null ? entity.getJyhxhbs().toString() : "");
+		
+		vo.setNzxts(entity.getNzxts() != null ? entity.getNzxts().toString() : "");
+		vo.setNzxhbs(entity.getJyhxhbs() != null ? entity.getNzxhbs().toString() : "");
+		vo.setNmhxts(entity.getNmhxts() != null ? entity.getNmhxts().toString() : "");
+		vo.setNmhxhbs(entity.getNmhxhbs() != null ? entity.getNmhxhbs().toString() : "");
+		
+		// 新开辟航线数
+		vo.setYyxkphxs(entity.getYyxkphxs() != null ? entity.getYyxkphxs().toString() : "");
+		vo.setYytkhxs(entity.getYytkhxs() != null ? entity.getYytkhxs().toString() : "");
+		vo.setJyxkphxs(entity.getJyxkphxs() != null ? entity.getJyxkphxs().toString() : "");
+		vo.setJytkhxs(entity.getJytkhxs() != null ? entity.getJytkhxs().toString() : "");
+		
+		//停开航线数
+		vo.setNzxxkphxs(entity.getNzxxkphxs() != null ? entity.getNzxxkphxs().toString() : "");
+		vo.setNzxtkhxs(entity.getNzxtkhxs() != null ? entity.getNzxtkhxs().toString() : "");
+		vo.setNmxkphxs(entity.getNmxkphxs() != null ? entity.getNmxkphxs().toString() : "");
+		vo.setNmtkhxs(entity.getNmtkhxs() != null ? entity.getNmtkhxs().toString() : "");
+		
+		// 填表人跟联系电话
+		vo.setTbr(securityMgr.getCurrUser().getName());
+		if (securityMgr.getCurrUser().getSfjyr().getText().equals("是")) {
+			vo.setLxdh(securityMgr.getCurrUser().getSsjyr().getLxdh());
+		} else {
+			vo.setLxdh(securityMgr.getCurrUser().getSsglbm() != null ? securityMgr.getCurrUser().getSsglbm().getLxdh() : "");
+		}
+		model.addAttribute("record", vo);
+		model.addAttribute("szgkid", entity.getSzgk().getId());
+		return "gkyxtjyfx/hxhbtj/hxhbtjEdit";
+	}
+	
+	@RequestMapping(value = "/save")
+//	@RequiresPermissions("hxhbtj:add")
+	@ResponseBody
+	public WebJsonResult save(Model model,String path, String szgkid, String rq, HxhbtjEntity code ) {
+		WebJsonResult wr = success();
+		if (StringUtils.isEmpty(szgkid)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择所在港口!");
+			return wr;
+		}
+		if (StringUtils.isEmpty(rq)) {
+			wr.setSuccess(false);
+			wr.setMessage("请选择日期!");
+			return wr;
+		}
+		//日期、港口不能重复
+//		List<Object> cf = hxhbtjService.cf(rq, szgkid);
+//		if (cf != null && cf.size() != 0){
+//			wr.setSuccess(false);
+//			wr.setMessage("该日期已存在记录!");
+//			return wr;
+//		}
+		HxhbtjEntity entity = new HxhbtjEntity();
+		try {
+			if (!StringUtils.isEmpty(code.getId())) {
+				entity = hxhbtjService.findOne(code.getId());
+			}
+			entity.setBywcl(code.getBywcl());
+			entity.setBnljl(code.getBnljl());
+			entity.setTbzzs(code.getTbzzs());
+			entity.setRq(code.getRq());
+			
+			//月内外贸完成量
+			entity.setNmjzxttl(code.getNmjzxttl());
+			entity.setWmjzxttl(code.getWmjzxttl());
+			
+			//年内外贸完成量
+			entity.setNnmjzxttl(code.getNnmjzxttl());
+			entity.setNwmjzxttl(code.getNwmjzxttl());
+			
+			//内外贸同比增长数
+			entity.setNmtbzzs(code.getNmtbzzs());
+			entity.setWmtbzzs(code.getWmtbzzs());
+			
+			//本月运营航线、航班数
+			entity.setYyhxts(code.getYyhxts());
+			entity.setYyhxhbs(code.getYyhxhbs());
+			entity.setJyhxts(code.getJyhxts());
+			entity.setJyhxhbs(code.getJyhxhbs());
+			
+			entity.setNzxts(code.getNzxts());
+			entity.setNzxhbs(code.getJyhxhbs());
+			entity.setNmhxts(code.getNmhxts());
+			entity.setNmhxhbs(code.getNmhxhbs());
+			
+			// 新开辟航线数
+			entity.setYyxkphxs(code.getYyxkphxs());
+			entity.setYytkhxs(code.getYytkhxs());
+			entity.setJyxkphxs(code.getJyxkphxs());
+			entity.setJytkhxs(code.getJytkhxs());
+			
+			//停开航线数
+			entity.setNzxxkphxs(code.getNzxxkphxs());
+			entity.setNzxtkhxs(code.getNzxtkhxs());
+			entity.setNmxkphxs(code.getNmxkphxs());
+			entity.setNmtkhxs(code.getNmtkhxs());
+
+			GkEntity szgk = new GkEntity();
+			szgk.setId(szgkid);
+			entity.setSzgk(szgk);
+			
+			if (!StringUtils.isEmpty(path) && path.indexOf("bg") > 0) {
+				if (path.indexOf("add") > 0) {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_COPY);
+				} else {
+					entity.setRecordStatus(BaseEntity.RECORE_STATE_BGFLAG);
+				}
+			}
+			hxhbtjService.save(entity);
+		} catch (Exception e) {
+			wr.setSuccess(false);
+			wr.setMessage("操作失败!");
+			e.printStackTrace();
+		}
+		return wr;
+	}
+	
+	@RequestMapping(value = "/stat")
+	public String stat(Model model, String rq, String szgkid) {
 		// 取到所在地下第一个所在港口
 		List<GkEntity> list = gkService.findBySzd(securityMgr.getCurrUser().getSzd() != null ? securityMgr.getCurrUser().getSzd().getId() : "");
 		String dftszgk = "";
@@ -47,11 +356,14 @@ public class HxhbtjCtl extends BaseCtl {
 			dftszgk = list.get(0).getId();
 		}
 		Date date = new Date();
-		// 本月数据
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
 		String benyue = sdf.format(date);
 		Object[] ob = (Object[]) hxglService.bywcltj(StringUtils.isEmpty(rq) ? benyue : rq, StringUtils.isEmpty(szgkid) ? dftszgk : szgkid);
 		HxhbtjVo vo = new HxhbtjVo();
+		
+		vo.setRq(rq);
+		
+		// 本月数据
 		vo.setBywcl(ob[0] != null ? (ob[0].toString()) : "");
 		vo.setBynmwcl(ob[1] != null ? (ob[1].toString()) : "");
 		vo.setBywmwcl(ob[2] != null ? (ob[2].toString()) : "");
@@ -97,6 +409,7 @@ public class HxhbtjCtl extends BaseCtl {
 			for (Object[] obj : list1) {
 				Object[] data = (Object[]) obj;
 				if (data[0].equals(bn + by)) {
+					
 					vo.setByyyhxzs1(Integer.parseInt(data[1] + ""));
 					vo.setByyyhbzs1(Integer.parseInt(data[2] + ""));
 					vo.setByyyhxzs2(Integer.parseInt(data[3] + ""));
@@ -105,96 +418,49 @@ public class HxhbtjCtl extends BaseCtl {
 					vo.setByyyhbzs3(Integer.parseInt(data[6] + ""));
 					vo.setByyyhxzs4(Integer.parseInt(data[7] + ""));
 					vo.setByyyhbzs4(Integer.parseInt(data[8] + ""));
+					
+					vo.setYyhxts(data[1] + "");
+					vo.setYyhxhbs(data[2] + "");
+					vo.setJyhxts(data[3] + "");
+					vo.setJyhxhbs(data[4] + "");
+					vo.setNzxts(data[5] + "");
+					vo.setNzxhbs(data[6] + "");
+					vo.setNmhxts(data[7] + "");
+					vo.setNmhxhbs(data[8] + "");
 					// 默认新开辟航线数为本月数量
-					vo.setByxkphxs1(vo.getByyyhxzs1());
-					vo.setByxkphxs2(vo.getByyyhxzs2());
-					vo.setByxkphxs3(vo.getByyyhxzs3());
-					vo.setByxkphxs4(vo.getByyyhxzs4());
+					vo.setYyxkphxs(vo.getYyhxts());
+					vo.setJyxkphxs(vo.getJyhxts());
+					vo.setNzxxkphxs(vo.getNzxts());
+					vo.setNmxkphxs(vo.getNmhxts());
 				} else if (data[0].equals(sn + sy)) {
 					int t1 = Integer.parseInt(data[1] + "");
-					vo.setByxkphxs1(vo.getByyyhxzs1() - t1 < 0 ? 0 : vo.getByyyhxzs1() - t1);
-					vo.setBytkhxs1(t1 - vo.getByyyhxzs1() < 0 ? 0 : t1 - vo.getByyyhxzs1());
+					vo.setYyxkphxs(vo.getByyyhxzs1() - t1 < 0 ? "0" : vo.getByyyhxzs1() - t1 +"");
+					vo.setYytkhxs(t1 - vo.getByyyhxzs1() < 0 ? "0" : t1 - vo.getByyyhxzs1() +"");
 					int t2 = Integer.parseInt(data[3] + "");
-					vo.setByxkphxs2(vo.getByyyhxzs2() - t2 < 0 ? 0 : vo.getByyyhxzs2() - t2);
-					vo.setBytkhxs2(t2 - vo.getByyyhxzs2() < 0 ? 0 : t2 - vo.getByyyhxzs2());
+					vo.setJyxkphxs(vo.getByyyhxzs2() - t2 < 0 ? "0" : vo.getByyyhxzs2() - t2 +"");
+					vo.setJytkhxs(t2 - vo.getByyyhxzs2() < 0 ? "0" : t2 - vo.getByyyhxzs2() +"");
 					int t3 = Integer.parseInt(data[5] + "");
-					vo.setByxkphxs3(vo.getByyyhxzs3() - t3 < 0 ? 0 : vo.getByyyhxzs3() - t3);
-					vo.setBytkhxs3(t3 - vo.getByyyhxzs3() < 0 ? 0 : t3 - vo.getByyyhxzs3());
+					vo.setNzxxkphxs(vo.getByyyhxzs3() - t3 < 0 ? "0" : vo.getByyyhxzs3() - t3 +"");
+					vo.setNzxtkhxs(t3 - vo.getByyyhxzs3() < 0 ? "0" : t3 - vo.getByyyhxzs3() +"");
 					int t4 = Integer.parseInt(data[7] + "");
-					vo.setByxkphxs4(vo.getByyyhxzs4() - t4 < 0 ? 0 : vo.getByyyhxzs4() - t4);
-					vo.setBytkhxs1(t4 - vo.getByyyhxzs4() < 0 ? 0 : t4 - vo.getByyyhxzs4());
-
+					vo.setNmxkphxs(vo.getByyyhxzs4() - t4 < 0 ? "0" : vo.getByyyhxzs4() - t4 +"");
+					vo.setNmtkhxs(t4 - vo.getByyyhxzs4() < 0 ? "0" : t4 - vo.getByyyhxzs4() +"");
+					
+					/*int t1 = Integer.parseInt(data[1] + "");
+					vo.setYyxkphxs(Integer.parseInt(vo.getYyhxts()) - t1 < 0 ? "0" : vo.getByyyhxzs1() - t1 +"");
+					vo.setYytkhxs(t1 - Integer.parseInt(vo.getYyhxts()) < 0 ? "0" : t1 - Integer.parseInt(vo.getYyhxts()) +"");
+					int t2 = Integer.parseInt(data[3] + "");
+					vo.setJyxkphxs(Integer.parseInt(vo.getJyhxts()) - t2 < 0 ? "0" : Integer.parseInt(vo.getJyhxts()) - t2 +"");
+					vo.setJytkhxs(t2 - Integer.parseInt(vo.getJyhxts()) < 0 ? "0" : t2 - Integer.parseInt(vo.getJyhxts()) +"");
+					int t3 = Integer.parseInt(data[5] + "");
+					vo.setNzxxkphxs(Integer.parseInt(vo.getNzxts()) - t3 < 0 ? "0" : Integer.parseInt(vo.getNzxts()) - t3 +"");
+					vo.setNzxtkhxs(t3 - Integer.parseInt(vo.getNzxts()) < 0 ? "0" : t3 - Integer.parseInt(vo.getNzxts()) +"");
+					int t4 = Integer.parseInt(data[7] + "");
+					vo.setNmxkphxs(Integer.parseInt(vo.getNmhxts()) - t4 < 0 ? "0" : Integer.parseInt(vo.getNmhxts()) +"");
+					vo.setNmtkhxs(t4 - Integer.parseInt(vo.getNmhxts()) < 0 ? "0" : t4 - Integer.parseInt(vo.getNmhxts()) +"");*/
 				}
 			}
 		}
-		/*
-		 * //航线航班本月营运航线 List<Object>
-		 * list1=hxglService.hxhbyytj(StringUtils.isEmpty(rq)?benyue:rq,
-		 * StringUtils.isEmpty(szgkid)?dftszgk:szgkid);
-		 * vo.setByyyhxzs1(list1.get(0).toString());
-		 * vo.setByyyhxzs2(list1.get(1).toString());
-		 * vo.setByyyhxzs3(list1.get(2).toString());
-		 * vo.setByyyhxzs4(list1.get(3).toString()); //本月航班数量按照航线类型分组
-		 * List<Object>
-		 * list2=hxglService.hbyytj(StringUtils.isEmpty(rq)?benyue:rq,
-		 * StringUtils.isEmpty(szgkid)?dftszgk:szgkid);
-		 * vo.setByyyhbzs1(list2.get(0).toString());
-		 * vo.setByyyhbzs2(list2.get(1).toString());
-		 * vo.setByyyhbzs3(list2.get(2).toString());
-		 * vo.setByyyhbzs4(list2.get(3).toString()); //本月停航航班数量按照航线类型分组
-		 * List<Object>
-		 * list3=hxglService.bytyhxs(StringUtils.isEmpty(rq)?benyue:rq,
-		 * StringUtils.isEmpty(szgkid)?dftszgk:szgkid);
-		 * vo.setBytkhxs1(list3.get(0).toString());
-		 * vo.setBytkhxs2(list3.get(1).toString());
-		 * vo.setBytkhxs3(list3.get(2).toString());
-		 * vo.setBytkhxs4(list3.get(3).toString()); //按照日期统计所有本月航线(名称)
-		 * List<HxglEntity>
-		 * hxgl=hxglService.findByRqAndSzgk(StringUtils.isEmpty(
-		 * rq)?benyue:rq,StringUtils.isEmpty(szgkid)?dftszgk:szgkid); String
-		 * lastmonth=""; if(StringUtils.isEmpty(rq)){ Integer i =
-		 * Integer.parseInt(benyue.substring(5, 7))-1; if(i<10){
-		 * lastmonth=benyue.substring(0, 5)+"0"+i; }else{
-		 * lastmonth=benyue.substring(0, 5)+i; } }else{ Integer i =
-		 * Integer.parseInt(rq.substring(5, 7))-1; if(i<10){
-		 * lastmonth=rq.substring(0, 5)+"0"+i; }else{ lastmonth=rq.substring(0,
-		 * 5)+i; } } //按照日期统计所有上个月月航线(名称) List<HxglEntity>
-		 * lasthxgl=hxglService.findByRqAndSzgk
-		 * (lastmonth,StringUtils.isEmpty(szgkid)?dftszgk:szgkid);
-		 * //count表示本月航线名称与上月航线名称相同的航线总数 int count1 = 0; int count2 = 0; int
-		 * count3 = 0; int count4 = 0; for(int i=0;i<hxgl.size();i++){ for(int
-		 * j=0;j<lasthxgl.size();j++){
-		 * if(hxgl.get(i).getHxlx().getId().equals("7001")){
-		 * if(hxgl.get(i).getHxmc
-		 * ().equals(lasthxgl.get(j).getHxmc())&&lasthxgl.get
-		 * (j).getHxlx().getId().equals("7001")){ count1=count1+1; break; }
-		 * }else
-		 * if(hxgl.get(i).getHxlx().getId().equals("7002")&&lasthxgl.get(j)
-		 * .getHxlx().getId().equals("7002")){
-		 * if(hxgl.get(i).getHxmc().equals(lasthxgl.get(j).getHxmc())){
-		 * count2=count2+1; break; } }else
-		 * if(hxgl.get(i).getHxlx().getId().equals
-		 * ("7003")&&lasthxgl.get(j).getHxlx().getId().equals("7003")){
-		 * if(hxgl.get(i).getHxmc().equals(lasthxgl.get(j).getHxmc())){
-		 * count3=count3+1; break; } }else
-		 * if(hxgl.get(i).getHxlx().getId().equals
-		 * ("7004")&&lasthxgl.get(j).getHxlx().getId().equals("7004")){
-		 * if(hxgl.get(i).getHxmc().equals(lasthxgl.get(j).getHxmc())){
-		 * count4=count4+1; break; } } } } int hxlxcount1 = 0; int hxlxcount2 =
-		 * 0; int hxlxcount3 = 0; int hxlxcount4 = 0; for(int
-		 * i=0;i<hxgl.size();i++){
-		 * if(hxgl.get(i).getHxlx().getId().equals("7001")){
-		 * hxlxcount1=hxlxcount1+1; }
-		 * if(hxgl.get(i).getHxlx().getId().equals("7002")){
-		 * hxlxcount2=hxlxcount2+1; }
-		 * if(hxgl.get(i).getHxlx().getId().equals("7003")){
-		 * hxlxcount3=hxlxcount3+1; }
-		 * if(hxgl.get(i).getHxlx().getId().equals("7004")){
-		 * hxlxcount4=hxlxcount4+1; } } vo.setByxkphxs1((hxlxcount1-count1)+"");
-		 * vo.setByxkphxs2((hxlxcount2-count2)+"");
-		 * vo.setByxkphxs3((hxlxcount3-count3)+"");
-		 * vo.setByxkphxs4((hxlxcount4-count4)+"");
-		 */
 		// 填表人跟联系电话
 		vo.setTbr(securityMgr.getCurrUser().getName());
 		if (securityMgr.getCurrUser().getSfjyr().getText().equals("是")) {
@@ -202,10 +468,211 @@ public class HxhbtjCtl extends BaseCtl {
 		} else {
 			vo.setLxdh(securityMgr.getCurrUser().getSsglbm() != null ? securityMgr.getCurrUser().getSsglbm().getLxdh() : "");
 		}
+		
 		model.addAttribute("record", vo);
 		model.addAttribute("szgkid", StringUtils.isEmpty(szgkid) ? dftszgk : szgkid);
 		model.addAttribute("rq", rq != null ? rq : benyue);
-		model.addAttribute("menuid", menuid);
-		return "gkyxtjyfx/hxhbtj/hxhbtj";
+		return "gkyxtjyfx/hxhbtj/hxhbtjStat";
+	}
+	
+	//同步省级数据 
+	@RequestMapping(value = "/saveTbzt")
+	@ResponseBody
+	public WebJsonResult saveTbzt(Model model, String id, String spflag) {
+		WebJsonResult wr = success();
+		HxhbtjEntity entity = hxhbtjService.findOne(id);
+
+		entity.setSftb(Constants.YES);
+		hxhbtjService.save(entity);
+
+		String url = "GK_OPERATION_JSJY_HXHBTJ_ONE_CP?condition=ID=" + id;
+
+		boolean flag = getTbStatus(url, null);
+		if (flag) {
+//				entity.setFlowstatus("0");
+			entity.setTbzt(Constants.YES);
+			hxhbtjService.save(entity);
+		} else {
+//				entity.setFlowstatus(null);
+			entity.setSftb(Constants.NO);
+			hxhbtjService.save(entity);
+			wr.setSuccess(false);
+			wr.setMessage("提交失败");
+		}
+		return wr;
 	}
+
+	
+	
+//	@SuppressWarnings("unused")
+//	@RequestMapping(value = "/main")
+//	public String main(Model model, final String rq, final String szgkid, final String menuid) {
+//		// 取到所在地下第一个所在港口
+//		List<GkEntity> list = gkService.findBySzd(securityMgr.getCurrUser().getSzd() != null ? securityMgr.getCurrUser().getSzd().getId() : "");
+//		String dftszgk = "";
+//		if (list.size() > 0) {
+//			dftszgk = list.get(0).getId();
+//		}
+//		Date date = new Date();
+//		// 本月数据
+//		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
+//		String benyue = sdf.format(date);
+//		Object[] ob = (Object[]) hxglService.bywcltj(StringUtils.isEmpty(rq) ? benyue : rq, StringUtils.isEmpty(szgkid) ? dftszgk : szgkid);
+//		HxhbtjVo vo = new HxhbtjVo();
+//		vo.setBywcl(ob[0] != null ? (ob[0].toString()) : "");
+//		vo.setBynmwcl(ob[1] != null ? (ob[1].toString()) : "");
+//		vo.setBywmwcl(ob[2] != null ? (ob[2].toString()) : "");
+//		// 本年数据
+//		SimpleDateFormat sdf2 = new SimpleDateFormat("yyyy");
+//		String bennian = sdf2.format(date);
+//		String rq2 = "";
+//		if (!StringUtils.isEmpty(rq)) {
+//			rq2 = rq.substring(0, 4);
+//		}
+//		Object[] ob2 = (Object[]) hxglService.bnljltj(StringUtils.isEmpty(rq2) ? bennian : rq2, StringUtils.isEmpty(szgkid) ? dftszgk : szgkid);
+//		vo.setBnljl(ob2[0] != null ? (ob2[0].toString()) : "");
+//		vo.setBnnmljl(ob2[1] != null ? (ob2[1].toString()) : "");
+//		vo.setBnwmljl(ob2[2] != null ? (ob2[2].toString()) : "");
+//		// 同比增长数
+//		String lastyear = "";
+//		if (StringUtils.isEmpty(rq)) {
+//			Integer i = Integer.parseInt(benyue.substring(0, 4)) - 1;
+//			lastyear = i + benyue.substring(4, 7);
+//		} else {
+//			Integer i = Integer.parseInt(rq.substring(0, 4)) - 1;
+//			lastyear = i + rq.substring(4, 7);
+//		}
+//		Object[] ob3 = (Object[]) hxglService.tbzzs(StringUtils.isEmpty(rq) ? benyue : rq, lastyear, StringUtils.isEmpty(szgkid) ? dftszgk : szgkid);
+//		vo.setTbzzs(ob3[0] != null ? (String.format("%.2f", ob3[0]) + "%") : "- -");
+//		vo.setNmtbzzs(ob3[1] != null ? (String.format("%.2f", ob3[1]) + "%") : "- -");
+//		vo.setWmtbzzs(ob3[2] != null ? (String.format("%.2f", ob3[2]) + "%") : "- -");
+//		// 集装箱航线航班开辟情况
+//		Calendar cal = Calendar.getInstance();
+//		if (StringUtils.isNotEmpty(rq)) {
+//			String year = rq.substring(0, 4);
+//			String month = rq.substring(5, 7);
+//			cal.set(Calendar.YEAR, Integer.parseInt(year));
+//			cal.set(Calendar.MONTH, Integer.parseInt(month));
+//		}
+//		String bn = cal.get(Calendar.YEAR) + "";
+//		String by = (cal.get(Calendar.MONTH) + 1) + "";
+//		cal.add(Calendar.MONTH, -1);
+//		String sn = cal.get(Calendar.YEAR) + "";
+//		String sy = (cal.get(Calendar.MONTH) + 1) + "";
+//		List<Object[]> list1 = hxglService.kbxk(bn, by, sn, sy, StringUtils.isEmpty(szgkid) ? dftszgk : szgkid);
+//		if (list1 != null && list1.size() > 0) {
+//			for (Object[] obj : list1) {
+//				Object[] data = (Object[]) obj;
+//				if (data[0].equals(bn + by)) {
+//					vo.setByyyhxzs1(Integer.parseInt(data[1] + ""));
+//					vo.setByyyhbzs1(Integer.parseInt(data[2] + ""));
+//					vo.setByyyhxzs2(Integer.parseInt(data[3] + ""));
+//					vo.setByyyhbzs2(Integer.parseInt(data[4] + ""));
+//					vo.setByyyhxzs3(Integer.parseInt(data[5] + ""));
+//					vo.setByyyhbzs3(Integer.parseInt(data[6] + ""));
+//					vo.setByyyhxzs4(Integer.parseInt(data[7] + ""));
+//					vo.setByyyhbzs4(Integer.parseInt(data[8] + ""));
+//					// 默认新开辟航线数为本月数量
+//					vo.setByxkphxs1(vo.getByyyhxzs1());
+//					vo.setByxkphxs2(vo.getByyyhxzs2());
+//					vo.setByxkphxs3(vo.getByyyhxzs3());
+//					vo.setByxkphxs4(vo.getByyyhxzs4());
+//				} else if (data[0].equals(sn + sy)) {
+//					int t1 = Integer.parseInt(data[1] + "");
+//					vo.setByxkphxs1(vo.getByyyhxzs1() - t1 < 0 ? 0 : vo.getByyyhxzs1() - t1);
+//					vo.setBytkhxs1(t1 - vo.getByyyhxzs1() < 0 ? 0 : t1 - vo.getByyyhxzs1());
+//					int t2 = Integer.parseInt(data[3] + "");
+//					vo.setByxkphxs2(vo.getByyyhxzs2() - t2 < 0 ? 0 : vo.getByyyhxzs2() - t2);
+//					vo.setBytkhxs2(t2 - vo.getByyyhxzs2() < 0 ? 0 : t2 - vo.getByyyhxzs2());
+//					int t3 = Integer.parseInt(data[5] + "");
+//					vo.setByxkphxs3(vo.getByyyhxzs3() - t3 < 0 ? 0 : vo.getByyyhxzs3() - t3);
+//					vo.setBytkhxs3(t3 - vo.getByyyhxzs3() < 0 ? 0 : t3 - vo.getByyyhxzs3());
+//					int t4 = Integer.parseInt(data[7] + "");
+//					vo.setByxkphxs4(vo.getByyyhxzs4() - t4 < 0 ? 0 : vo.getByyyhxzs4() - t4);
+//					vo.setBytkhxs1(t4 - vo.getByyyhxzs4() < 0 ? 0 : t4 - vo.getByyyhxzs4());
+//					
+//				}
+//			}
+//		}
+//		/*
+//		 * //航线航班本月营运航线 List<Object>
+//		 * list1=hxglService.hxhbyytj(StringUtils.isEmpty(rq)?benyue:rq,
+//		 * StringUtils.isEmpty(szgkid)?dftszgk:szgkid);
+//		 * vo.setByyyhxzs1(list1.get(0).toString());
+//		 * vo.setByyyhxzs2(list1.get(1).toString());
+//		 * vo.setByyyhxzs3(list1.get(2).toString());
+//		 * vo.setByyyhxzs4(list1.get(3).toString()); //本月航班数量按照航线类型分组
+//		 * List<Object>
+//		 * list2=hxglService.hbyytj(StringUtils.isEmpty(rq)?benyue:rq,
+//		 * StringUtils.isEmpty(szgkid)?dftszgk:szgkid);
+//		 * vo.setByyyhbzs1(list2.get(0).toString());
+//		 * vo.setByyyhbzs2(list2.get(1).toString());
+//		 * vo.setByyyhbzs3(list2.get(2).toString());
+//		 * vo.setByyyhbzs4(list2.get(3).toString()); //本月停航航班数量按照航线类型分组
+//		 * List<Object>
+//		 * list3=hxglService.bytyhxs(StringUtils.isEmpty(rq)?benyue:rq,
+//		 * StringUtils.isEmpty(szgkid)?dftszgk:szgkid);
+//		 * vo.setBytkhxs1(list3.get(0).toString());
+//		 * vo.setBytkhxs2(list3.get(1).toString());
+//		 * vo.setBytkhxs3(list3.get(2).toString());
+//		 * vo.setBytkhxs4(list3.get(3).toString()); //按照日期统计所有本月航线(名称)
+//		 * List<HxglEntity>
+//		 * hxgl=hxglService.findByRqAndSzgk(StringUtils.isEmpty(
+//		 * rq)?benyue:rq,StringUtils.isEmpty(szgkid)?dftszgk:szgkid); String
+//		 * lastmonth=""; if(StringUtils.isEmpty(rq)){ Integer i =
+//		 * Integer.parseInt(benyue.substring(5, 7))-1; if(i<10){
+//		 * lastmonth=benyue.substring(0, 5)+"0"+i; }else{
+//		 * lastmonth=benyue.substring(0, 5)+i; } }else{ Integer i =
+//		 * Integer.parseInt(rq.substring(5, 7))-1; if(i<10){
+//		 * lastmonth=rq.substring(0, 5)+"0"+i; }else{ lastmonth=rq.substring(0,
+//		 * 5)+i; } } //按照日期统计所有上个月月航线(名称) List<HxglEntity>
+//		 * lasthxgl=hxglService.findByRqAndSzgk
+//		 * (lastmonth,StringUtils.isEmpty(szgkid)?dftszgk:szgkid);
+//		 * //count表示本月航线名称与上月航线名称相同的航线总数 int count1 = 0; int count2 = 0; int
+//		 * count3 = 0; int count4 = 0; for(int i=0;i<hxgl.size();i++){ for(int
+//		 * j=0;j<lasthxgl.size();j++){
+//		 * if(hxgl.get(i).getHxlx().getId().equals("7001")){
+//		 * if(hxgl.get(i).getHxmc
+//		 * ().equals(lasthxgl.get(j).getHxmc())&&lasthxgl.get
+//		 * (j).getHxlx().getId().equals("7001")){ count1=count1+1; break; }
+//		 * }else
+//		 * if(hxgl.get(i).getHxlx().getId().equals("7002")&&lasthxgl.get(j)
+//		 * .getHxlx().getId().equals("7002")){
+//		 * if(hxgl.get(i).getHxmc().equals(lasthxgl.get(j).getHxmc())){
+//		 * count2=count2+1; break; } }else
+//		 * if(hxgl.get(i).getHxlx().getId().equals
+//		 * ("7003")&&lasthxgl.get(j).getHxlx().getId().equals("7003")){
+//		 * if(hxgl.get(i).getHxmc().equals(lasthxgl.get(j).getHxmc())){
+//		 * count3=count3+1; break; } }else
+//		 * if(hxgl.get(i).getHxlx().getId().equals
+//		 * ("7004")&&lasthxgl.get(j).getHxlx().getId().equals("7004")){
+//		 * if(hxgl.get(i).getHxmc().equals(lasthxgl.get(j).getHxmc())){
+//		 * count4=count4+1; break; } } } } int hxlxcount1 = 0; int hxlxcount2 =
+//		 * 0; int hxlxcount3 = 0; int hxlxcount4 = 0; for(int
+//		 * i=0;i<hxgl.size();i++){
+//		 * if(hxgl.get(i).getHxlx().getId().equals("7001")){
+//		 * hxlxcount1=hxlxcount1+1; }
+//		 * if(hxgl.get(i).getHxlx().getId().equals("7002")){
+//		 * hxlxcount2=hxlxcount2+1; }
+//		 * if(hxgl.get(i).getHxlx().getId().equals("7003")){
+//		 * hxlxcount3=hxlxcount3+1; }
+//		 * if(hxgl.get(i).getHxlx().getId().equals("7004")){
+//		 * hxlxcount4=hxlxcount4+1; } } vo.setByxkphxs1((hxlxcount1-count1)+"");
+//		 * vo.setByxkphxs2((hxlxcount2-count2)+"");
+//		 * vo.setByxkphxs3((hxlxcount3-count3)+"");
+//		 * vo.setByxkphxs4((hxlxcount4-count4)+"");
+//		 */
+//		// 填表人跟联系电话
+//		vo.setTbr(securityMgr.getCurrUser().getName());
+//		if (securityMgr.getCurrUser().getSfjyr().getText().equals("是")) {
+//			vo.setLxdh(securityMgr.getCurrUser().getSsjyr().getLxdh());
+//		} else {
+//			vo.setLxdh(securityMgr.getCurrUser().getSsglbm() != null ? securityMgr.getCurrUser().getSsglbm().getLxdh() : "");
+//		}
+//		model.addAttribute("record", vo);
+//		model.addAttribute("szgkid", StringUtils.isEmpty(szgkid) ? dftszgk : szgkid);
+//		model.addAttribute("rq", rq != null ? rq : benyue);
+//		model.addAttribute("menuid", menuid);
+//		return "gkyxtjyfx/hxhbtj/hxhbtj";
+//	}
 }

+ 26 - 0
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hxhbtj/dao/HxhbtjDao.java

@@ -0,0 +1,26 @@
+package com.xt.jygl.gkyxtjyfx.hxhbtj.dao;
+
+import java.util.List;
+
+import org.springframework.data.jpa.repository.Query;
+
+import com.xt.jygl.gkyxtjyfx.hxhbtj.entity.HxhbtjEntity;
+import com.xtframe.sec.common.SecRepository;
+
+public interface HxhbtjDao extends SecRepository<HxhbtjEntity, String> {
+	
+	@Query(value = "select sum(t1.a + t1.b), sum(t1.a), sum(t1.b) from (SELECT t.nmjzxttl a, t.wmjzxttl b from GK_OPERATION_JSJY_HXHBGL t  where to_char(t.year||'-'||t.month) = ?1 and t.szgk = ?2 and t.RECORD_STATUS <> 9) t1", nativeQuery = true)
+	public Object bywcltj(String rq, String szgk);
+
+	@Query(value = "select sum(t1.a + t1.b), sum(t1.a), sum(t1.b) from (SELECT t.nmjzxttl a, t.wmjzxttl b from GK_OPERATION_JSJY_HXHBGL t  where t.year =?1 and t.szgk = ?2 and t.RECORD_STATUS <> 9) t1", nativeQuery = true)
+	public Object bnljltj(String year, String szgk);
+	
+	@Query(value = "select ((t1.a1 - t2.a1) / t2.a1) * 100, ((t1.a2 - t2.a2) / t2.a2) * 100, ((t1.a3 - t2.a3) / t2.a3) * 100 from (select (sum(t.nmjzxttl) + sum(t.wmjzxttl)) a1, sum(t.nmjzxttl) a2, sum(t.wmjzxttl) a3 from GK_OPERATION_JSJY_HXHBGL t where t.year||'-'||t.month = ?1 and t.szgk = ?3) t1, (select (sum(t.nmjzxttl) + sum(t.wmjzxttl)) a1, sum(t.nmjzxttl) a2, sum(t.wmjzxttl) a3 from GK_OPERATION_JSJY_HXHBGL t where t.year||'-'||t.month = ?2 and t.szgk = ?3) t2", nativeQuery = true)
+	public Object tbzzs(String rq, String lastyear, String szgk);
+	
+	@Query(value = "select t.year||t.month,sum(t.yyhxts),sum(t.yyhxhbs),sum(t.jyhxts),sum(t.jyhxhbs),sum(t.nzxts),sum(t.nzxhbs),sum(t.nmhxts),sum(t.nmhxhbs) from GK_OPERATION_JSJY_HXHBGL t where ((t.year =?1 and t.month=?2) or (t.year=?3 and t.month=?4)) and t.szgk=?5 group by t.year,t.month  order by t.year desc,t.month desc", nativeQuery = true)
+	public List<Object[]> kbxk(String bn, String by, String sn, String sy, String szgk);
+	
+	@Query(value = "SELECT t.* from GK_OPERATION_JSJY_HXHBTJ t  where t.rq = ?1 and t.szgk = ?2 and t.RECORD_STATUS<>9", nativeQuery = true)
+	public List<Object> cf(String rq, String szgk);
+}

+ 325 - 0
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hxhbtj/entity/HxhbtjEntity.java

@@ -0,0 +1,325 @@
+package com.xt.jygl.gkyxtjyfx.hxhbtj.entity;
+
+import javax.persistence.Entity;
+import javax.persistence.FetchType;
+import javax.persistence.GeneratedValue;
+import javax.persistence.Id;
+import javax.persistence.JoinColumn;
+import javax.persistence.ManyToOne;
+import javax.persistence.Table;
+
+import org.hibernate.annotations.GenericGenerator;
+
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
+import com.xtframe.sec.common.BaseEntity;
+
+/**
+ * 航线航班统计Entity
+ * @author guxl2
+ *
+ */
+@Entity
+@Table(name = "GK_OPERATION_JSJY_HXHBTJ")
+public class HxhbtjEntity extends BaseEntity<String> implements Cloneable {
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -3184732392767118611L;
+	
+	private Integer yyhxts; //远洋航线条数
+	private Integer yyhxhbs; //远洋航线航班数
+	private String yyhxbz; //远洋航线备注
+	private Integer jyhxts; //近洋航线条数
+	private Integer jyhxhbs; //近洋航线航班数
+	private String jyhxbz; //近洋航线备注
+	private Integer nzxts; //内支线条数
+	private Integer nzxhbs; //内支线航班数
+	private String nzxbz; //内支线备注
+	private Integer nmhxts; //内贸航线条数
+	private Integer nmhxhbs; //内贸航线航班数
+	private String nmhxbz; //内贸航线备注
+	private GkEntity szgk; //所在港口
+	private String id; //ID
+	private Double nmjzxttl; //月内贸集装箱吞吐量  TEU
+	private Double wmjzxttl; //月外贸集装箱吞吐量  TEU
+	
+	private Double nnmjzxttl; //年内贸集装箱吞吐量  TEU
+	private Double nwmjzxttl; //年外贸集装箱吞吐量  TEU
+	private Double bywcl; //本月完成量
+	private Double bnljl; //本年累积量
+	private Double tbzzs; //同比增长数
+	private Double nmtbzzs; //内贸同比增长数
+	private Double wmtbzzs; //外贸同比增长数
+	private Integer yyxkphxs; //远洋新开辟航线数
+	private Integer yytkhxs; //远洋停开航线数
+	private Integer jyxkphxs; //近洋新开辟航线数
+	private Integer jytkhxs; //近洋停开航线数
+	private Integer nzxxkphxs; //内支线新开辟航线数
+	private Integer nzxtkhxs; //内支线停开航线数
+	private Integer nmxkphxs; //内贸新开辟航线数
+	private Integer nmtkhxs; //内贸停开航线数
+	private String rq; //日期
+
+	@Id
+	@GenericGenerator(name = "systemUUID", strategy = "uuid")
+	@GeneratedValue(generator = "systemUUID")
+	public String getId() {
+		return this.id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+	
+	public Integer getYyhxts() {
+		return yyhxts;
+	}
+
+	public void setYyhxts(Integer yyhxts) {
+		this.yyhxts = yyhxts;
+	}
+
+	public Integer getYyhxhbs() {
+		return yyhxhbs;
+	}
+
+	public void setYyhxhbs(Integer yyhxhbs) {
+		this.yyhxhbs = yyhxhbs;
+	}
+
+	public String getYyhxbz() {
+		return yyhxbz;
+	}
+
+	public void setYyhxbz(String yyhxbz) {
+		this.yyhxbz = yyhxbz;
+	}
+
+	public Integer getJyhxts() {
+		return jyhxts;
+	}
+
+	public void setJyhxts(Integer jyhxts) {
+		this.jyhxts = jyhxts;
+	}
+
+	public Integer getJyhxhbs() {
+		return jyhxhbs;
+	}
+
+	public void setJyhxhbs(Integer jyhxhbs) {
+		this.jyhxhbs = jyhxhbs;
+	}
+
+	public String getJyhxbz() {
+		return jyhxbz;
+	}
+
+	public void setJyhxbz(String jyhxbz) {
+		this.jyhxbz = jyhxbz;
+	}
+
+	public Integer getNzxts() {
+		return nzxts;
+	}
+
+	public void setNzxts(Integer nzxts) {
+		this.nzxts = nzxts;
+	}
+
+	public Integer getNzxhbs() {
+		return nzxhbs;
+	}
+
+	public void setNzxhbs(Integer nzxhbs) {
+		this.nzxhbs = nzxhbs;
+	}
+
+	public String getNzxbz() {
+		return nzxbz;
+	}
+
+	public void setNzxbz(String nzxbz) {
+		this.nzxbz = nzxbz;
+	}
+
+	public Integer getNmhxts() {
+		return nmhxts;
+	}
+
+	public void setNmhxts(Integer nmhxts) {
+		this.nmhxts = nmhxts;
+	}
+
+	public Integer getNmhxhbs() {
+		return nmhxhbs;
+	}
+
+	public void setNmhxhbs(Integer nmhxhbs) {
+		this.nmhxhbs = nmhxhbs;
+	}
+
+	public String getNmhxbz() {
+		return nmhxbz;
+	}
+
+	public void setNmhxbz(String nmhxbz) {
+		this.nmhxbz = nmhxbz;
+	}
+
+	public Double getNmjzxttl() {
+		return nmjzxttl;
+	}
+
+	public void setNmjzxttl(Double nmjzxttl) {
+		this.nmjzxttl = nmjzxttl;
+	}
+
+	public Double getWmjzxttl() {
+		return wmjzxttl;
+	}
+
+	public void setWmjzxttl(Double wmjzxttl) {
+		this.wmjzxttl = wmjzxttl;
+	}
+	
+	public Double getNnmjzxttl() {
+		return nnmjzxttl;
+	}
+
+	public void setNnmjzxttl(Double nnmjzxttl) {
+		this.nnmjzxttl = nnmjzxttl;
+	}
+
+	public Double getNwmjzxttl() {
+		return nwmjzxttl;
+	}
+
+	public void setNwmjzxttl(Double nwmjzxttl) {
+		this.nwmjzxttl = nwmjzxttl;
+	}
+
+	public Double getBywcl() {
+		return bywcl;
+	}
+
+	public void setBywcl(Double bywcl) {
+		this.bywcl = bywcl;
+	}
+
+	public Double getBnljl() {
+		return bnljl;
+	}
+
+	public void setBnljl(Double bnljl) {
+		this.bnljl = bnljl;
+	}
+
+	public Double getTbzzs() {
+		return tbzzs;
+	}
+
+	public void setTbzzs(Double tbzzs) {
+		this.tbzzs = tbzzs;
+	}
+
+	public Double getNmtbzzs() {
+		return nmtbzzs;
+	}
+
+	public void setNmtbzzs(Double nmtbzzs) {
+		this.nmtbzzs = nmtbzzs;
+	}
+
+	public Double getWmtbzzs() {
+		return wmtbzzs;
+	}
+
+	public void setWmtbzzs(Double wmtbzzs) {
+		this.wmtbzzs = wmtbzzs;
+	}
+
+	public Integer getYyxkphxs() {
+		return yyxkphxs;
+	}
+
+	public void setYyxkphxs(Integer yyxkphxs) {
+		this.yyxkphxs = yyxkphxs;
+	}
+
+	public Integer getYytkhxs() {
+		return yytkhxs;
+	}
+
+	public void setYytkhxs(Integer yytkhxs) {
+		this.yytkhxs = yytkhxs;
+	}
+
+	public Integer getJyxkphxs() {
+		return jyxkphxs;
+	}
+
+	public void setJyxkphxs(Integer jyxkphxs) {
+		this.jyxkphxs = jyxkphxs;
+	}
+
+	public Integer getJytkhxs() {
+		return jytkhxs;
+	}
+
+	public void setJytkhxs(Integer jytkhxs) {
+		this.jytkhxs = jytkhxs;
+	}
+
+	public Integer getNzxxkphxs() {
+		return nzxxkphxs;
+	}
+
+	public void setNzxxkphxs(Integer nzxxkphxs) {
+		this.nzxxkphxs = nzxxkphxs;
+	}
+
+	public Integer getNzxtkhxs() {
+		return nzxtkhxs;
+	}
+
+	public void setNzxtkhxs(Integer nzxtkhxs) {
+		this.nzxtkhxs = nzxtkhxs;
+	}
+
+	public Integer getNmxkphxs() {
+		return nmxkphxs;
+	}
+
+	public void setNmxkphxs(Integer nmxkphxs) {
+		this.nmxkphxs = nmxkphxs;
+	}
+
+	public Integer getNmtkhxs() {
+		return nmtkhxs;
+	}
+
+	public void setNmtkhxs(Integer nmtkhxs) {
+		this.nmtkhxs = nmtkhxs;
+	}
+
+	@ManyToOne(fetch = FetchType.EAGER, targetEntity = GkEntity.class)
+	@JoinColumn(name = "szgk")
+	public GkEntity getSzgk() {
+		return szgk;
+	}
+
+	public void setSzgk(GkEntity szgk) {
+		this.szgk = szgk;
+	}
+	
+	public String getRq() {
+		return rq;
+	}
+
+	public void setRq(String rq) {
+		this.rq = rq;
+	}
+
+}

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

@@ -0,0 +1,27 @@
+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{
+
+	public Object bnljltj(String year, String szgk);
+
+	public Object tbzzs(String string, String lastyear, String string2);
+
+	public List<Object[]> kbxk(String bn, String by, String sn, String sy, String string);
+
+	public Object bywcltj(String rq, String szgk);
+
+	public void logicDelete(String id);
+
+	public HxhbtjEntity findOne(String id);
+
+	public List<Object> cf(String rq, String szgkid);
+
+	public <S extends HxhbtjEntity> S save(S entity);
+
+}

+ 213 - 0
gkjsjy/trunk/src/com/xt/jygl/gkyxtjyfx/hxhbtj/vo/HxhbtjVo.java

@@ -1,5 +1,6 @@
 package com.xt.jygl.gkyxtjyfx.hxhbtj.vo;
 
+import com.xt.jygl.gkjcxx.gk.entity.GkEntity;
 import com.xtframe.sec.common.BaseVo;
 
 public class HxhbtjVo extends BaseVo {
@@ -57,6 +58,194 @@ public class HxhbtjVo extends BaseVo {
 	private String tbr = null;
 	/* 联系电话 */
 	private String lxdh = null;
+	//所在港口
+	private String szgkzw = null;
+	//日期
+	private String rq = null;
+	
+	private String id = null;
+	
+	private String yyhxts = null; //远洋航线条数
+	private String yyhxhbs = null; //远洋航线航班数
+	private String jyhxts = null; //近洋航线条数
+	private String jyhxhbs = null; //近洋航线航班数
+	private String nzxts = null; //内支线条数
+	private String nzxhbs = null; //内支线航班数
+	private String nmhxts = null; //内贸航线条数
+	private String nmhxhbs = null; //内贸航线航班数
+	private String nmjzxttl = null; //月内贸集装箱吞吐量  TEU
+	private String wmjzxttl = null; //月外贸集装箱吞吐量  TEU
+	
+	private String nnmjzxttl = null; //年内贸集装箱吞吐量  TEU
+	private String nwmjzxttl = null; //年外贸集装箱吞吐量  TEU
+	private String yyxkphxs = null; //远洋新开辟航线数
+	private String yytkhxs = null; //远洋停开航线数
+	private String jyxkphxs = null; //近洋新开辟航线数
+	private String jytkhxs = null; //近洋停开航线数
+	private String nzxxkphxs = null; //内支线新开辟航线数
+	private String nzxtkhxs = null; //内支线停开航线数
+	private String nmxkphxs = null; //内贸新开辟航线数
+	private String nmtkhxs = null; //内贸停开航线数
+
+	public String getYyhxts() {
+		return yyhxts;
+	}
+
+	public void setYyhxts(String yyhxts) {
+		this.yyhxts = yyhxts;
+	}
+
+	public String getYyhxhbs() {
+		return yyhxhbs;
+	}
+
+	public void setYyhxhbs(String yyhxhbs) {
+		this.yyhxhbs = yyhxhbs;
+	}
+
+	public String getJyhxts() {
+		return jyhxts;
+	}
+
+	public void setJyhxts(String jyhxts) {
+		this.jyhxts = jyhxts;
+	}
+
+	public String getJyhxhbs() {
+		return jyhxhbs;
+	}
+
+	public void setJyhxhbs(String jyhxhbs) {
+		this.jyhxhbs = jyhxhbs;
+	}
+
+	public String getNzxts() {
+		return nzxts;
+	}
+
+	public void setNzxts(String nzxts) {
+		this.nzxts = nzxts;
+	}
+
+	public String getNzxhbs() {
+		return nzxhbs;
+	}
+
+	public void setNzxhbs(String nzxhbs) {
+		this.nzxhbs = nzxhbs;
+	}
+
+	public String getNmhxts() {
+		return nmhxts;
+	}
+
+	public void setNmhxts(String nmhxts) {
+		this.nmhxts = nmhxts;
+	}
+
+	public String getNmhxhbs() {
+		return nmhxhbs;
+	}
+
+	public void setNmhxhbs(String nmhxhbs) {
+		this.nmhxhbs = nmhxhbs;
+	}
+
+	public String getNmjzxttl() {
+		return nmjzxttl;
+	}
+
+	public void setNmjzxttl(String nmjzxttl) {
+		this.nmjzxttl = nmjzxttl;
+	}
+
+	public String getWmjzxttl() {
+		return wmjzxttl;
+	}
+
+	public void setWmjzxttl(String wmjzxttl) {
+		this.wmjzxttl = wmjzxttl;
+	}
+
+	public String getNnmjzxttl() {
+		return nnmjzxttl;
+	}
+
+	public void setNnmjzxttl(String nnmjzxttl) {
+		this.nnmjzxttl = nnmjzxttl;
+	}
+
+	public String getNwmjzxttl() {
+		return nwmjzxttl;
+	}
+
+	public void setNwmjzxttl(String nwmjzxttl) {
+		this.nwmjzxttl = nwmjzxttl;
+	}
+
+	public String getYyxkphxs() {
+		return yyxkphxs;
+	}
+
+	public void setYyxkphxs(String yyxkphxs) {
+		this.yyxkphxs = yyxkphxs;
+	}
+
+	public String getYytkhxs() {
+		return yytkhxs;
+	}
+
+	public void setYytkhxs(String yytkhxs) {
+		this.yytkhxs = yytkhxs;
+	}
+
+	public String getJyxkphxs() {
+		return jyxkphxs;
+	}
+
+	public void setJyxkphxs(String jyxkphxs) {
+		this.jyxkphxs = jyxkphxs;
+	}
+
+	public String getJytkhxs() {
+		return jytkhxs;
+	}
+
+	public void setJytkhxs(String jytkhxs) {
+		this.jytkhxs = jytkhxs;
+	}
+
+	public String getNzxxkphxs() {
+		return nzxxkphxs;
+	}
+
+	public void setNzxxkphxs(String nzxxkphxs) {
+		this.nzxxkphxs = nzxxkphxs;
+	}
+
+	public String getNzxtkhxs() {
+		return nzxtkhxs;
+	}
+
+	public void setNzxtkhxs(String nzxtkhxs) {
+		this.nzxtkhxs = nzxtkhxs;
+	}
+
+	public String getNmxkphxs() {
+		return nmxkphxs;
+	}
+
+	public void setNmxkphxs(String nmxkphxs) {
+		this.nmxkphxs = nmxkphxs;
+	}
+
+	public String getNmtkhxs() {
+		return nmtkhxs;
+	}
+
+	public void setNmtkhxs(String nmtkhxs) {
+		this.nmtkhxs = nmtkhxs;
+	}
 
 	public String getBywcl() {
 		return bywcl;
@@ -273,4 +462,28 @@ public class HxhbtjVo extends BaseVo {
 	public void setLxdh(String lxdh) {
 		this.lxdh = lxdh;
 	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public String getSzgkzw() {
+		return szgkzw;
+	}
+
+	public void setSzgkzw(String szgkzw) {
+		this.szgkzw = szgkzw;
+	}
+
+	public String getRq() {
+		return rq;
+	}
+
+	public void setRq(String rq) {
+		this.rq = rq;
+	}
 }