浏览代码

git-svn-id: https://192.168.57.71/svn/lyggkj@117 1a6f6e3a-4066-fe46-b609-79c204482ece

ld_liufl 8 年之前
父节点
当前提交
c1d9884313
共有 1 个文件被更改,包括 117 次插入97 次删除
  1. 117 97
      gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zysqbp/WhsqbpWebService.java

+ 117 - 97
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/webService/zysqbp/WhsqbpWebService.java

@@ -93,11 +93,12 @@ public class WhsqbpWebService extends BaseController {
 	@Autowired
 	private DcService dcService;
 	@Autowired
-	private CkService ckService;	
+	private CkService ckService;
 	@Autowired
 	private CbService cbService;
 	@Autowired
 	private HsCompareService compareService;
+
 	// @Autowired
 	// private WorkflowMangerService workService;
 	// @Autowired
@@ -136,8 +137,8 @@ public class WhsqbpWebService extends BaseController {
 			SinglePageRequest page = new SinglePageRequest(pageCount, count,
 					"desc", "bgsj");
 			Page<ZysqbpEntity> list = zysqbpService.findAll(spec, page);
-			if(list==null||list.getTotalPages()<pageCount){
-				return  new ArrayList<ZysqbpEntity>();
+			if (list == null || list.getTotalPages() < pageCount) {
+				return new ArrayList<ZysqbpEntity>();
 			}
 			return list.getContent();
 			// List<ZysqbpEntity> list = zysqbpService.getZysqbpListByJyr(count,
@@ -155,8 +156,8 @@ public class WhsqbpWebService extends BaseController {
 			// 只检索审核中的状态记录
 			addNotEmptyModel(filterList, "recordStatus",
 					BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
-			//非admin 用户
-			if(!user.getId().equals("1l")) {
+			// 非admin 用户
+			if (!user.getId().equals("1l")) {
 				addNotEmptyModel(filterList, "recordStatus",
 						BaseEntity.RECORD_STATE_COMPLETED, Operator.NEQ);
 				addNotEmptyModel(filterList, "recordStatus",
@@ -167,7 +168,7 @@ public class WhsqbpWebService extends BaseController {
 						BaseEntity.RECORD_STATE_REJECT, Operator.NEQ);
 				addNotEmptyModel(filterList, "recordStatus",
 						BaseEntity.RECORD_STATE_CALEL, Operator.NEQ);
-			}		
+			}
 			// 根据所在地过滤
 			addNotEmptyModel(filterList, "szd.id", szd, Operator.LIKE);
 			// List<ZysqbpEntity> list =
@@ -179,8 +180,8 @@ public class WhsqbpWebService extends BaseController {
 			SinglePageRequest page = new SinglePageRequest(pageCount, count,
 					"desc", "bgsj");
 			Page<ZysqbpEntity> list = zysqbpService.findAll(spec, page);
-			if(list==null||list.getTotalPages()<pageCount){
-				return  new ArrayList<ZysqbpEntity>();
+			if (list == null || list.getTotalPages() < pageCount) {
+				return new ArrayList<ZysqbpEntity>();
 			}
 			return list.getContent();
 		}
@@ -202,7 +203,7 @@ public class WhsqbpWebService extends BaseController {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		// 只检索非删除状态记录
 		addNotEmptyModel(filterList, "recordStatus",
-						BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
+				BaseEntity.RECORD_STATE_DELETE, Operator.NEQ);
 		// 根据 申请单位 过滤
 		addNotEmptyModel(filterList, "zydw.gkjyr", gkjyr, Operator.LIKE);
 		// 根据所在地过滤
@@ -260,8 +261,8 @@ public class WhsqbpWebService extends BaseController {
 		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
 				"bgsj");
 		Page<ZysqbpEntity> list = zysqbpService.findAll(spec, page);
-		if(list==null||list.getTotalPages()<pageCount){
-			return  new ArrayList<ZysqbpEntity>();
+		if (list == null || list.getTotalPages() < pageCount) {
+			return new ArrayList<ZysqbpEntity>();
 		}
 		return list.getContent();
 	}
@@ -411,7 +412,7 @@ public class WhsqbpWebService extends BaseController {
 	 * @return
 	 */
 	public ZysqbpEntity saveKgWg(ZysqbpEntity sqbp) {
-		if(sqbp!=null){
+		if (sqbp != null) {
 			ZysqbpEntity entity = zysqbpService.findOne(sqbp.getId());
 			entity.setUpdateDate(new Date());
 			entity.setUpdateUser(Utils.getWebServiceUser());
@@ -422,21 +423,21 @@ public class WhsqbpWebService extends BaseController {
 			entity.setXg(sqbp.getXg());
 			entity.setWgzt(sqbp.getWgzt());
 			entity.setWgsj(sqbp.getWgsj());
-			sqbp= zysqbpService.kgwgSave(entity);
+			sqbp = zysqbpService.kgwgSave(entity);
 		}
-		return sqbp;		
+		return sqbp;
 	}
-	
-	
+
 	/**
 	 * 删除
+	 * 
 	 * @param entity
 	 * @return
 	 */
 	public WsResult delete(ZysqbpEntity entity) {
 		WsResult ws = new WsResult();
-		entity=zysqbpService.findOne(entity.getId());
-		if(entity.getRecordStatus()==BaseEntity.RECORD_STATE_VALID){
+		entity = zysqbpService.findOne(entity.getId());
+		if (entity.getRecordStatus() == BaseEntity.RECORD_STATE_VALID) {
 			try {
 				zysqbpService.logicDelete(Collections.singletonList(entity));
 				ws.setResultCode(WsResult.SUCCESS);
@@ -446,10 +447,9 @@ public class WhsqbpWebService extends BaseController {
 			}
 		} else {
 			ws.setResultCode(WsResult.WARNING);
-		}	
+		}
 		return ws;
 	}
-	
 
 	/**
 	 * 提交信息 return 0:提交成功 1:您选择的作业场所的附证未进行年审,请先保存本条数据,并进行相应的附证年审!
@@ -463,7 +463,7 @@ public class WhsqbpWebService extends BaseController {
 			sqbp.setAddDate(new Date());
 			sqbp.setAddUser(Utils.getWebServiceUser());
 			sqbp.setRecordCode("90");
-			sqbp.setKgzt(Constants.NO);//确保开 工状态有数据
+			sqbp.setKgzt(Constants.NO);// 确保开 工状态有数据
 			sqbp.setWgzt(Constants.NO);
 		} else {
 			ZysqbpEntity vo = zysqbpService.findOne(sqbp.getId());
@@ -477,7 +477,7 @@ public class WhsqbpWebService extends BaseController {
 			sqbp.setTbdyid(vo.getTbdyid());
 			sqbp.setUpdateDate(new Date());
 			sqbp.setUpdateUser(Utils.getWebServiceUser());
-			sqbp.setKgzt(Constants.NO);//确保开 工状态有数据
+			sqbp.setKgzt(Constants.NO);// 确保开 工状态有数据
 			sqbp.setWgzt(Constants.NO);
 		}
 		if (sqbp.getZyddqybh() != null) {
@@ -605,7 +605,7 @@ public class WhsqbpWebService extends BaseController {
 
 	public ZysqbpEntity aduit(String shyj, String shsj, boolean auditflag,
 			ZysqbpEntity entity) throws CloneNotSupportedException {
-		entity =zysqbpService.findOne(entity.getId());
+		entity = zysqbpService.findOne(entity.getId());
 		// 确保entity有重新查一下
 		zysqbpController.aduit(shyj, new Date(), auditflag, entity);
 		entity = zysqbpService.findOne(entity.getId());
@@ -719,9 +719,9 @@ public class WhsqbpWebService extends BaseController {
 	 * 
 	 */
 	public ZysqbpEntity doQxzy(ZysqbpEntity vo) {
-		ZysqbpEntity entity =  zysqbpService.findOne(vo.getId());
+		ZysqbpEntity entity = zysqbpService.findOne(vo.getId());
 		try {
-			//存取取消原因
+			// 存取取消原因
 			entity.setByzd1(vo.getByzd1());
 			zysqqxService.submitQxWebService(entity);
 			entity.setRecordStatus(BaseEntity.RECORD_STATE_QXSUBMIT);// 提交过后,状态改为取消审核中
@@ -807,7 +807,7 @@ public class WhsqbpWebService extends BaseController {
 	}
 
 	/**
-	 * 判断当前用户是否有审批权限 之判断 
+	 * 判断当前用户是否有审批权限 之判断
 	 * 
 	 * @param id
 	 * @return 0 表示未签收,代办理,1表示已签收待办理 ,""表示 无流程
@@ -844,50 +844,54 @@ public class WhsqbpWebService extends BaseController {
 		}
 		return "";
 	}
-	
+
 	/**
 	 * 获取泊位信息
-	 * @param zycs 作业场所类型
-	 * @param id 场所id
+	 * 
+	 * @param zycs
+	 *            作业场所类型
+	 * @param id
+	 *            场所id
 	 * @return
 	 */
-	public BwEntity findByZycsAndId(String zycs,Long id) {
-		//只查询泊位的信息
-		if(Constants.GGDM_ID_ZYDD_BW.equals(Long.parseLong(zycs))) {
+	public BwEntity findByZycsAndId(String zycs, Long id) {
+		// 只查询泊位的信息
+		if (Constants.GGDM_ID_ZYDD_BW.equals(Long.parseLong(zycs))) {
 			return bwService.findOne(id);
 		}
 		return null;
 	}
 
-	
 	/**
 	 * 根据中文 船名和英文船名分页获取船舶信息
+	 * 
 	 * @param zwcm
 	 * @param ywcm
 	 * @param n
 	 * @param pageCount
 	 * @return
 	 */
-	public List<CbEntity> getCbPageListByCm(String zwcm,String ywcm,int n ,int pageCount){
+	public List<CbEntity> getCbPageListByCm(String zwcm, String ywcm, int n,
+			int pageCount) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		addNotEmptyModel(filterList, "zwcm", zwcm, PredicateModel.Operator.LIKE);
 		addNotEmptyModel(filterList, "ywcm", ywcm, PredicateModel.Operator.LIKE);
 		Specification<CbEntity> spec = SpecificationCreater
 				.searchByPredicateModels(filterList);
-		SinglePageRequest page = new SinglePageRequest(pageCount, n,
-				"asc", "cbbh");
-		Page<CbEntity> list =cbService.findAll(spec,
-				page);	
+		SinglePageRequest page = new SinglePageRequest(pageCount, n, "asc",
+				"cbbh");
+		Page<CbEntity> list = cbService.findAll(spec, page);
 		return list.getContent();
 	}
-	
+
 	/**
 	 * 查询对比结果详细
 	 * 
-	 * @param id 作业申报id
+	 * @param id
+	 *            作业申报id
 	 * @return
 	 */
-	public List<ZysqbphsdbEntity>  queryDb(Long id) {
+	public List<ZysqbphsdbEntity> queryDb(Long id) {
 		List<ZysqbphsdbEntity> list = new ArrayList<ZysqbphsdbEntity>();
 		Map<String, Map<String, String>> map = compareService.mergeInfo(id);
 		if (map == null) {
@@ -919,38 +923,40 @@ public class WhsqbpWebService extends BaseController {
 		}
 		return list;
 	}
-	
+
 	/**
 	 * 根据英文名称获取船舶信息
+	 * 
 	 * @param ywcm
 	 * @return
 	 */
-	public CbEntity getCbByYwcm(String ywcm){
+	public CbEntity getCbByYwcm(String ywcm) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		addNotEmptyModel(filterList, "ywcm", ywcm, PredicateModel.Operator.EQ);
 		Specification<CbEntity> spec = SpecificationCreater
 				.searchByPredicateModels(filterList);
-		List<CbEntity> list =cbService.findAll(spec);	
-		if(list!=null && list.size()>0){
+		List<CbEntity> list = cbService.findAll(spec);
+		if (list != null && list.size() > 0) {
 			return list.get(0);
 		}
 		return null;
 	}
-	
-	
+
 	/**
 	 * 根据船舶获取申报记录(已完成)
+	 * 
 	 * @param cm
 	 * @param n
 	 * @param pageCount
 	 * @return
 	 */
-	public List<ZysqbpEntity> getZysqbpPageListByCb( String cm,int n, int pageCount) {
+	public List<ZysqbpEntity> getZysqbpPageListByCb(String cm, int n,
+			int pageCount) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		List<PredicateModel> recordList = new ArrayList<PredicateModel>();
 		// 只检索已完成和变更已完成的数据
 		addNotEmptyModel(recordList, "recordStatus",
-						BaseEntity.RECORD_STATE_BGCOMPLETED, Operator.EQ);
+				BaseEntity.RECORD_STATE_BGCOMPLETED, Operator.EQ);
 		addNotEmptyModel(recordList, "recordStatus",
 				BaseEntity.RECORD_STATE_COMPLETED, Operator.EQ);
 		filterList.add(new PredicateModel(JoinType.OR, recordList));
@@ -961,44 +967,48 @@ public class WhsqbpWebService extends BaseController {
 		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
 				"bgsj");
 		Page<ZysqbpEntity> list = zysqbpService.findAll(spec, page);
-		if(list==null||list.getTotalPages()<pageCount){
-			return  new ArrayList<ZysqbpEntity>();
+		if (list == null || list.getTotalPages() < pageCount) {
+			return new ArrayList<ZysqbpEntity>();
 		}
 		return list.getContent();
 	}
-	
+
 	/**
 	 * 根据泊位获取申报记录(已完成)
+	 * 
 	 * @param cm
 	 * @param n
 	 * @param pageCount
 	 * @return
 	 */
-	public List<ZysqbpEntity> getZysqbpPageListByBw( BwEntity entity,int n, int pageCount) {
+	public List<ZysqbpEntity> getZysqbpPageListByBw(BwEntity entity, int n,
+			int pageCount) {
 		List<PredicateModel> filterList = new ArrayList<PredicateModel>();
 		List<PredicateModel> recordList = new ArrayList<PredicateModel>();
 		// 只检索已完成和变更已完成的数据
 		addNotEmptyModel(recordList, "recordStatus",
-						BaseEntity.RECORD_STATE_BGCOMPLETED, Operator.EQ);
+				BaseEntity.RECORD_STATE_BGCOMPLETED, Operator.EQ);
 		addNotEmptyModel(recordList, "recordStatus",
 				BaseEntity.RECORD_STATE_COMPLETED, Operator.EQ);
 		filterList.add(new PredicateModel(JoinType.OR, recordList));
 		// 根据泊位,只查询泊位
-		addNotEmptyModel(filterList, "zyddqybh.qynbbh", entity.getId(), Operator.EQ);
+		addNotEmptyModel(filterList, "zyddqybh.qynbbh", entity.getId(),
+				Operator.EQ);
 		addNotEmptyModel(filterList, "zydd.id", "10000501", Operator.EQ);
 		Specification<ZysqbpEntity> spec = SpecificationCreater
 				.searchByPredicateModels(filterList);
 		SinglePageRequest page = new SinglePageRequest(pageCount, n, "desc",
 				"bgsj");
 		Page<ZysqbpEntity> list = zysqbpService.findAll(spec, page);
-		if(list==null||list.getTotalPages()<pageCount){
-			return  new ArrayList<ZysqbpEntity>();
+		if (list == null || list.getTotalPages() < pageCount) {
+			return new ArrayList<ZysqbpEntity>();
 		}
 		return list.getContent();
 	}
-	
+
 	/**
 	 * 吞吐量 统计
+	 * 
 	 * @param szd
 	 * @param ndName
 	 * @param jdName
@@ -1024,60 +1034,70 @@ public class WhsqbpWebService extends BaseController {
 				bc = zysqbpService.getForSeasonList(0l, ndName, jdName, bgsj1,
 						bgsj2, kgsj1, kgsj2, wgsj1, wgsj2, hzName, true);
 			else {
-				bc = zysqbpService.getForSeasonList(szd, ndName,
-						jdName, bgsj1, bgsj2, kgsj1, kgsj2, wgsj1, wgsj2,
-						hzName, true);
+				bc = zysqbpService.getForSeasonList(szd, ndName, jdName, bgsj1,
+						bgsj2, kgsj1, kgsj2, wgsj1, wgsj2, hzName, true);
 			}
 		} else if (qymcName != 0) {
 			bc.setAttribute("countList8", zysqbpService.findJyrBwAndHwList(
 					ndName, jdName, bgsj1, bgsj2, kgsj1, kgsj2, wgsj1, wgsj2,
-					qymcName, hzName, mtbwName, true));		
+					qymcName, hzName, mtbwName, true));
 		}
-		//年度
-		if(bc.getAttribute("ndcountList")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("ndcountList"));
+		// 年度
+		if (bc.getAttribute("ndcountList") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("ndcountList"));
 		}
-		//一季度
-		if(bc.getAttribute("countList1")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("countList1"));
+		// 一季度
+		if (bc.getAttribute("countList1") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("countList1"));
 		}
-		//二季度
-		if(bc.getAttribute("countList2")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("countList2"));
+		// 二季度
+		if (bc.getAttribute("countList2") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("countList2"));
 		}
-		//三季度
-		if(bc.getAttribute("countList3")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("countList3"));
+		// 三季度
+		if (bc.getAttribute("countList3") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("countList3"));
 		}
-		//四季度
-		if(bc.getAttribute("countList4")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("countList4"));
+		// 四季度
+		if (bc.getAttribute("countList4") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("countList4"));
 		}
-		//季度
-		if(bc.getAttribute("jdcountList")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("jdcountList"));
+		// 季度
+		if (bc.getAttribute("jdcountList") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("jdcountList"));
 		}
-		//第一个月
-		if(bc.getAttribute("countList5")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("countList5"));
+		// 第一个月
+		if (bc.getAttribute("countList5") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("countList5"));
 		}
-		//第二个月
-		if(bc.getAttribute("countList6")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("countList6"));
+		// 第二个月
+		if (bc.getAttribute("countList6") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("countList6"));
 		}
-		//第三个月
-		if(bc.getAttribute("countList7")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("countList7"));
+		// 第三个月
+		if (bc.getAttribute("countList7") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("countList7"));
 		}
-		//总
-		if(bc.getAttribute("ydcountList")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("ydcountList"));
+		// 总
+		if (bc.getAttribute("ydcountList") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("ydcountList"));
 		}
-		//企业
-		if(bc.getAttribute("countList8")!=null){
-			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc.getAttribute("countList8"));
+		// 企业
+		if (bc.getAttribute("countList8") != null) {
+			statisticsEntity.setNdcountList((List<ZysqbpCountEntity>) bc
+					.getAttribute("countList8"));
 		}
-		return statisticsEntity;	
+		return statisticsEntity;
 	}
-	
+
 }