Kaynağa Gözat

git-svn-id: https://192.168.57.71/svn/hbghj@144 201dd7a2-ec1b-f84b-8b06-88221118ff88

xt_xuhao 8 yıl önce
ebeveyn
işleme
aa2814fe14

+ 1 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/common/Constants.java

@@ -26,7 +26,7 @@ public class Constants {
 	/** 建设单位角色code */
 	public static final String RECORD_CODE_JSDW = "8";
 	/** 省局所在地 */
-	public static final Long SZD_ID_PROVINCE = 42l;
+	public static final Long SZD_ID_PROVINCE = 42L;
 
 	/** 湖北港航局ID */
 	public static final Long GOV_ID_HB = 1l;

+ 26 - 38
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/zyfzndjy/GkwxhwzyfzblhhzController.java

@@ -197,81 +197,69 @@ public class GkwxhwzyfzblhhzController extends BaseController {
 		try {
 			Specification<GkwxhwzyfzblhhzEntity> spec = new Specification<GkwxhwzyfzblhhzEntity>() {
 				@Override
-				public Predicate toPredicate(Root<GkwxhwzyfzblhhzEntity> root,
-						CriteriaQuery<?> query, CriteriaBuilder cb) {
+				public Predicate toPredicate(Root<GkwxhwzyfzblhhzEntity> root,CriteriaQuery<?> query, CriteriaBuilder cb) {
 					List<Predicate> list = new ArrayList<Predicate>();
 					addRecordCodeFilter(functionId, cb, root, list);
-					//省局人员只查看审批完成的数据
 					
-					// 只检索非删除状态记录
-					list.add(cb.notEqual(
-							root.get("recordStatus").as(String.class),
-							BaseEntity.RECORD_STATE_DELETE));
+					if (Utils.getCurrentUser().getSzd().getId() == Constants.SZD_ID_PROVINCE){
+						//省局人员只查看审批完成的数据
+						list.add(cb.equal(root.get("recordStatus").as(String.class),BaseEntity.RECORD_STATE_COMPLETED));
+					}
+					else{
+						// 只检索非删除状态记录
+						list.add(cb.notEqual(root.get("recordStatus").as(String.class),BaseEntity.RECORD_STATE_DELETE));
+					}
+					
 					// 根据 申请单位 过滤
 					if (null != jyr) {
-						list.add(cb.equal(
-								root.get("jyrVo").as(JyrEntity.class), jyr));
+						list.add(cb.equal(root.get("jyrVo").as(JyrEntity.class), jyr));
 					}
 					// 根据所在地过滤
 					if (null != szd) {
-						list.add(cb.like(
-								root.get("szd").get("id").as(String.class),
-								szd.getId() + "%"));
+						list.add(cb.like(root.get("szd").get("id").as(String.class),szd.getId() + "%"));
 					}
 					// 根据所在地过滤
 					if (null != zs) {
-						list.add(cb.equal(
-								root.get("jyrVo").get("zs").as(CodeEntity.class),zs ));
+						list.add(cb.equal(root.get("jyrVo").get("zs").as(CodeEntity.class),zs));
 					}
 					// 根据港区过滤
 					if (null != gq) {
-						list.add(cb.equal(root.get("ssgq").as(GqEntity.class),
-								gq));
+						list.add(cb.equal(root.get("ssgq").as(GqEntity.class),gq));
 					}
 					// 办理编号
 					if (null != blbh && !"".equals(blbh)) {
-						list.add(cb.like(root.get("byzd1").as(String.class),
-								"%" + blbh + "%"));
+						list.add(cb.like(root.get("byzd1").as(String.class),"%" + blbh + "%"));
 					}
 					// 法定代表人
 					if (null != fddbr && !"".equals(fddbr)) {
-						list.add(cb.like(root.get("fddbr").as(String.class),
-								"%" + fddbr + "%"));
+						list.add(cb.like(root.get("fddbr").as(String.class),"%" + fddbr + "%"));
 					}
 					// 安全部门附证人
 					// if (null != aqgljgfzr && !"".equals(aqgljgfzr)) {
 					// list.add(cb.like(root.get("aqgljg").as(String.class),
 					// "%" + aqgljgfzr + "%"));
 					// }
-					list = Utils.setWorkflowSpec(list, cb, query, root,
-							lcStatus);
+					list = Utils.setWorkflowSpec(list, cb, query, root, lcStatus);
+					
 					return cb.and(list.toArray(new Predicate[] {}));
 				}
 			};
-			Page<GkwxhwzyfzblhhzEntity> result = gkwxhwzyfzblhhzService
-					.findAll(spec, pageable);
+			Page<GkwxhwzyfzblhhzEntity> result = gkwxhwzyfzblhhzService.findAll(spec, pageable);
 			if (result != null) {
 				for (GkwxhwzyfzblhhzEntity entity : result) {
 					//任务
-					if (entity.getTaskList() != null
-							&& entity.getTaskList().size() > 0)
+					if (entity.getTaskList() != null&& entity.getTaskList().size() > 0){
 						entity.getTaskList().get(0);
-					entity.setFzs((List<GkwxhwzyfzblFzEntity>) queryfzs(entity)
-							.getResult());
+					}
+					entity.setFzs((List<GkwxhwzyfzblFzEntity>) queryfzs(entity).getResult());
 				}
 				for (GkwxhwzyfzblhhzEntity ba : result) {
 					//当前任务状态
-					if (gkwxhwzyfzblhhzService.getTaskByUserAndBusKey(Utils
-							.getCurrentUser().getId().toString(), ba.getId()
-							.toString()) != null) {
+					if (gkwxhwzyfzblhhzService.getTaskByUserAndBusKey(Utils.getCurrentUser().getId().toString(), ba.getId().toString()) != null) {
 						ba.setTaskState(Constants.TASK_ASSIGN);
-					} else if (gkwxhwzyfzblhhzService
-							.getCandidateTaskByUserAndBusKey(Utils
-									.getCurrentUser().getId().toString(), ba
-									.getId().toString()) != null) {// if result
-																	// is not
-																	// null ,has
-																	// not done
+					} 
+					else if (gkwxhwzyfzblhhzService.getCandidateTaskByUserAndBusKey(Utils.getCurrentUser().getId().toString(), ba.getId().toString()) != null) {
+						// if result is not null ,has not done
 						ba.setTaskState(Constants.TASK_CANDIDATE);
 					}
 				}

+ 23 - 1
gkaq/yjpt-java/trunk/java_src/com/jtgh/yjpt/controller/zysqbp/ZysqbpController.java

@@ -2682,6 +2682,27 @@ public class ZysqbpController extends BaseController {
 	}
 
 	/**
+	 * 返回传入时间参数的前一天到后一天的时间返回(flex前台做死活有问题)
+	 * @param bgsj
+	 * @return
+	 */
+	public BusinessContext getDateRange(Date bgsj) {
+		BusinessContext bc = createBusinessContext();
+		//DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd 00:00:00");
+		Calendar cal = Calendar.getInstance();
+		cal.setTime(bgsj);
+		cal.add(Calendar.DATE, 1);
+		Date js = cal.getTime();//end
+		cal.add(Calendar.DATE,-2);
+		Date ks = cal.getTime();//begin
+		
+		bc.setAttribute("ks",ks);
+		bc.setAttribute("js",js);
+		 
+		return bc;
+	}
+
+	/**
 	 * 初始化海事比对数据
 	 * 
 	 * @param id
@@ -2711,7 +2732,8 @@ public class ZysqbpController extends BaseController {
 		bc.setResult(cjhs);
 		return bc;
 	}
-
+	
+	
 	/**
 	 * 长江海事船舶申报单列表
 	 *