|
@@ -197,81 +197,69 @@ public class GkwxhwzyfzblhhzController extends BaseController {
|
|
try {
|
|
try {
|
|
Specification<GkwxhwzyfzblhhzEntity> spec = new Specification<GkwxhwzyfzblhhzEntity>() {
|
|
Specification<GkwxhwzyfzblhhzEntity> spec = new Specification<GkwxhwzyfzblhhzEntity>() {
|
|
@Override
|
|
@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>();
|
|
List<Predicate> list = new ArrayList<Predicate>();
|
|
addRecordCodeFilter(functionId, cb, root, list);
|
|
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) {
|
|
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) {
|
|
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) {
|
|
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) {
|
|
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)) {
|
|
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)) {
|
|
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)) {
|
|
// if (null != aqgljgfzr && !"".equals(aqgljgfzr)) {
|
|
// list.add(cb.like(root.get("aqgljg").as(String.class),
|
|
// list.add(cb.like(root.get("aqgljg").as(String.class),
|
|
// "%" + aqgljgfzr + "%"));
|
|
// "%" + aqgljgfzr + "%"));
|
|
// }
|
|
// }
|
|
- list = Utils.setWorkflowSpec(list, cb, query, root,
|
|
|
|
- lcStatus);
|
|
|
|
|
|
+ list = Utils.setWorkflowSpec(list, cb, query, root, lcStatus);
|
|
|
|
+
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
}
|
|
}
|
|
};
|
|
};
|
|
- Page<GkwxhwzyfzblhhzEntity> result = gkwxhwzyfzblhhzService
|
|
|
|
- .findAll(spec, pageable);
|
|
|
|
|
|
+ Page<GkwxhwzyfzblhhzEntity> result = gkwxhwzyfzblhhzService.findAll(spec, pageable);
|
|
if (result != null) {
|
|
if (result != null) {
|
|
for (GkwxhwzyfzblhhzEntity entity : result) {
|
|
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.getTaskList().get(0);
|
|
- entity.setFzs((List<GkwxhwzyfzblFzEntity>) queryfzs(entity)
|
|
|
|
- .getResult());
|
|
|
|
|
|
+ }
|
|
|
|
+ entity.setFzs((List<GkwxhwzyfzblFzEntity>) queryfzs(entity).getResult());
|
|
}
|
|
}
|
|
for (GkwxhwzyfzblhhzEntity ba : result) {
|
|
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);
|
|
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);
|
|
ba.setTaskState(Constants.TASK_CANDIDATE);
|
|
}
|
|
}
|
|
}
|
|
}
|