|
@@ -75,6 +75,7 @@ import com.jtgh.yjpt.controller.sgalgl.PoiUtils;
|
|
|
import com.jtgh.yjpt.dao.task.GztxDao;
|
|
|
import com.jtgh.yjpt.dao.zysqbp.ZysqbpBgDao;
|
|
|
import com.jtgh.yjpt.entity.BaseEntity;
|
|
|
+import com.jtgh.yjpt.entity.auth.RoleEntity;
|
|
|
import com.jtgh.yjpt.entity.auth.UserEntity;
|
|
|
import com.jtgh.yjpt.entity.bagl.yjyaba.YjyabaEntity;
|
|
|
import com.jtgh.yjpt.entity.common.AccessoryEntity;
|
|
@@ -251,79 +252,60 @@ public class ZysqbpController extends BaseController {
|
|
|
Specification<ZysqbpEntity> spec = new Specification<ZysqbpEntity>() {
|
|
|
|
|
|
@Override
|
|
|
- public Predicate toPredicate(Root<ZysqbpEntity> root,
|
|
|
- CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
|
+ public Predicate toPredicate(Root<ZysqbpEntity> root,CriteriaQuery<?> query, CriteriaBuilder cb) {
|
|
|
List<Predicate> list = new ArrayList<Predicate>();
|
|
|
- addRecordCodeFilter(functionId, cb, root, list, null,
|
|
|
- "zydw");
|
|
|
- list.add(cb.notEqual(
|
|
|
- root.get("recordStatus").as(String.class),
|
|
|
+ addRecordCodeFilter(functionId, cb, root, list, null,"zydw");
|
|
|
+ list.add(cb.notEqual(root.get("recordStatus").as(String.class),
|
|
|
BaseEntity.RECORD_STATE_DELETE));
|
|
|
- if (BaseEntity.RECORD_STATE_DELETE != entity
|
|
|
- .getRecordStatus()) {
|
|
|
- list.add(cb.equal(
|
|
|
- root.get("recordStatus").as(String.class),
|
|
|
+ if (BaseEntity.RECORD_STATE_DELETE != entity.getRecordStatus()) {
|
|
|
+ list.add(cb.equal(root.get("recordStatus").as(String.class),
|
|
|
String.valueOf(entity.getRecordStatus())));
|
|
|
}
|
|
|
if (null != entity.getBh() && !"".equals(entity.getBh()))
|
|
|
- list.add(cb.like(root.get("bh").as(String.class), "%"
|
|
|
- + entity.getBh() + "%"));
|
|
|
+ list.add(cb.like(root.get("bh").as(String.class), "%" + entity.getBh() + "%"));
|
|
|
if (null != entity.getCm() && !"".equals(entity.getCm()))
|
|
|
- list.add(cb.like(root.get("cm").as(String.class), "%"
|
|
|
- + entity.getCm() + "%"));
|
|
|
- if (null != entity.getWxwpmc()
|
|
|
- && !"".equals(entity.getWxwpmc()))
|
|
|
- list.add(cb.like(root.get("wpbh").as(String.class), "%"
|
|
|
- + entity.getWxwpmc() + "%"));
|
|
|
- if (null != entity.getWxhwmcbh()
|
|
|
- && !"".equals(entity.getWxhwmcbh()))
|
|
|
- list.add(cb.like(root.get("wxhwmcbh").as(String.class),
|
|
|
- "%" + entity.getWxhwmcbh() + "%"));
|
|
|
+ list.add(cb.like(root.get("cm").as(String.class), "%" + entity.getCm() + "%"));
|
|
|
+ if (null != entity.getWxwpmc() && !"".equals(entity.getWxwpmc()))
|
|
|
+ list.add(cb.like(root.get("wpbh").as(String.class), "%" + entity.getWxwpmc() + "%"));
|
|
|
+ if (null != entity.getWxhwmcbh() && !"".equals(entity.getWxhwmcbh()))
|
|
|
+ list.add(cb.like(root.get("wxhwmcbh").as(String.class), "%" + entity.getWxhwmcbh() + "%"));
|
|
|
if (null != entity.getZydw()) {
|
|
|
- list.add(cb.equal(
|
|
|
- root.get("zydw").get("id").as(String.class),
|
|
|
+ list.add(cb.equal(root.get("zydw").get("id").as(String.class),
|
|
|
entity.getZydw().getId()));
|
|
|
}
|
|
|
if (null != gkdw && !"".equals(gkdw))
|
|
|
- list.add(cb.like(
|
|
|
- root.get("zydw").get("gkjyr").as(String.class),
|
|
|
+ list.add(cb.like(root.get("zydw").get("gkjyr").as(String.class),
|
|
|
"%" + gkdw + "%"));
|
|
|
if (entity.getMao() != null && !entity.getMao().equals("")) {
|
|
|
list.add(cb.equal(root.get("mao").as(String.class),
|
|
|
entity.getMao()));
|
|
|
}
|
|
|
if (null != entity.getSzd())
|
|
|
- list.add(cb.like(
|
|
|
- root.get("szd").get("id").as(String.class),
|
|
|
+ list.add(cb.like(root.get("szd").get("id").as(String.class),
|
|
|
entity.getSzd().getId() + "%"));
|
|
|
if (null != entity.getSzgq())
|
|
|
list.add(cb.equal(root.get("szgq").as(GqEntity.class),
|
|
|
entity.getSzgq()));
|
|
|
if (bgsj1 != null)
|
|
|
- list.add(cb.greaterThanOrEqualTo(
|
|
|
- root.get("bgsj").as(Date.class), bgsj1));
|
|
|
+ list.add(cb.greaterThanOrEqualTo(root.get("bgsj").as(Date.class), bgsj1));
|
|
|
if (bgsj2 != null)
|
|
|
list.add(cb.lessThan(root.get("bgsj").as(Date.class),
|
|
|
DateUtil.addDate(bgsj2, 1)));
|
|
|
if (kgsj1 != null)
|
|
|
- list.add(cb.greaterThanOrEqualTo(
|
|
|
- root.get("kgsj").as(Date.class), kgsj1));
|
|
|
+ list.add(cb.greaterThanOrEqualTo(root.get("kgsj").as(Date.class), kgsj1));
|
|
|
if (kgsj2 != null)
|
|
|
list.add(cb.lessThan(root.get("kgsj").as(Date.class),
|
|
|
DateUtil.addDate(kgsj2, 1)));
|
|
|
if (wgsj1 != null)
|
|
|
- list.add(cb.greaterThanOrEqualTo(
|
|
|
- root.get("wgsj").as(Date.class), wgsj1));
|
|
|
+ list.add(cb.greaterThanOrEqualTo(root.get("wgsj").as(Date.class), wgsj1));
|
|
|
if (wgsj2 != null)
|
|
|
list.add(cb.lessThan(root.get("wgsj").as(Date.class),
|
|
|
DateUtil.addDate(wgsj2, 1)));
|
|
|
if (Constants.YES.equals(Utils.getCurrentUser().getSfcd())) {
|
|
|
- list.add(cb.equal(
|
|
|
- root.get("addUser").as(UserEntity.class),
|
|
|
+ list.add(cb.equal(root.get("addUser").as(UserEntity.class),
|
|
|
Utils.getCurrentUser()));
|
|
|
}
|
|
|
- list = Utils.setAuditNameSpec(list, cb, query, root,
|
|
|
- lcStatus, name);
|
|
|
+ list = Utils.setAuditNameSpec(list, cb, query, root,lcStatus, name);
|
|
|
return cb.and(list.toArray(new Predicate[] {}));
|
|
|
}
|
|
|
};
|
|
@@ -331,49 +313,66 @@ public class ZysqbpController extends BaseController {
|
|
|
long cost = System.currentTimeMillis() - startTime;
|
|
|
// System.err.println(url + ",cost:"+cost);
|
|
|
LOGGER.info(url + "<SUCCESS> (findAll()) cost:" + cost);
|
|
|
- //
|
|
|
- List<Boolean> sfsbList = new ArrayList<Boolean>();
|
|
|
+
|
|
|
+ List<Boolean> sfsbList = new ArrayList<Boolean>();//用于集装箱企业申报信息颜色显示用
|
|
|
+
|
|
|
for (ZysqbpEntity ba : pageList) {
|
|
|
- sfsbList.add(zysqbpService.doCheckJyrAndWxp(ba.getZydw()
|
|
|
- .getId(), ba.getWxwpmc()));
|
|
|
- if (ba.getRecordStatus() == BaseEntity.RECORD_STATE_QXSUBMIT) {// 取消作业对应的流程
|
|
|
- if (zysqqxService.getTaskByUserAndBusKey(Utils
|
|
|
- .getCurrentUser().getId().toString(), ba.getId()
|
|
|
- .toString()) != null) {
|
|
|
+ sfsbList.add(zysqbpService.doCheckJyrAndWxp(ba.getZydw().getId(), ba.getWxwpmc()));
|
|
|
+
|
|
|
+ // 取消作业对应的流程
|
|
|
+ if (ba.getRecordStatus() == BaseEntity.RECORD_STATE_QXSUBMIT) {
|
|
|
+ if (zysqqxService.getTaskByUserAndBusKey(Utils.getCurrentUser().getId().toString(),
|
|
|
+ ba.getId().toString()) != null) {
|
|
|
ba.setTaskState(Constants.TASK_ASSIGN);
|
|
|
- } else if (zysqqxService.getCandidateTaskByUserAndBusKey(
|
|
|
- Utils.getCurrentUser().getId().toString(), ba
|
|
|
- .getId().toString()) != null) {
|
|
|
+ }
|
|
|
+ else if (zysqqxService.getCandidateTaskByUserAndBusKey(Utils.getCurrentUser().getId().toString(),
|
|
|
+ ba.getId().toString()) != null) {
|
|
|
ba.setTaskState(Constants.TASK_CANDIDATE);
|
|
|
}
|
|
|
- } else if (ba.getRecordStatus() == BaseEntity.RECORD_STATE_BGSUBMIT) {// 变更作业对应的流程
|
|
|
- if (zysqbgService.getTaskByUserAndBusKey(Utils
|
|
|
- .getCurrentUser().getId().toString(), ba.getId()
|
|
|
- .toString()) != null) {
|
|
|
+ }
|
|
|
+ // 变更作业对应的流程
|
|
|
+ else if (ba.getRecordStatus() == BaseEntity.RECORD_STATE_BGSUBMIT) {
|
|
|
+ if (zysqbgService.getTaskByUserAndBusKey(Utils.getCurrentUser().getId().toString(),
|
|
|
+ ba.getId().toString()) != null) {
|
|
|
ba.setTaskState(Constants.TASK_ASSIGN);
|
|
|
- } else if (zysqbgService.getCandidateTaskByUserAndBusKey(
|
|
|
- Utils.getCurrentUser().getId().toString(), ba
|
|
|
- .getId().toString()) != null) {
|
|
|
+ } else if (zysqbgService.getCandidateTaskByUserAndBusKey(Utils.getCurrentUser().getId().toString(),
|
|
|
+ ba.getId().toString()) != null) {
|
|
|
ba.setTaskState(Constants.TASK_CANDIDATE);
|
|
|
}
|
|
|
- } else {
|
|
|
- if (zysqbpService.getTaskByUserAndBusKey(Utils
|
|
|
- .getCurrentUser().getId().toString(), ba.getId()
|
|
|
- .toString()) != null) {
|
|
|
+ }
|
|
|
+ //如何系统启用了签章功能
|
|
|
+ //如果申报已审批完成,判断当前登录账号角色(所在地的限制在列表展现数据的是有已经进行了筛选)是否有审批处理权限,
|
|
|
+ //如果有权限,则审批完成后也具有补签章的权限。
|
|
|
+ else if(GlobalData.iSignature.equals("Y") &&
|
|
|
+ (ba.getRecordStatus() == BaseEntity.RECORD_STATE_COMPLETED ||
|
|
|
+ ba.getRecordStatus() == BaseEntity.RECORD_STATE_BGCOMPLETED )){
|
|
|
+ List<RoleEntity> curUserOwnRoles = Utils.getCurrentUser().getRoles();
|
|
|
+ for(RoleEntity roleEntity : curUserOwnRoles){
|
|
|
+ if(roleEntity.getName().equals("形式审查")){
|
|
|
+ ba.setTaskState(Constants.TASK_SIGNATURE);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //RECORD_STATUS=3 待处理状态
|
|
|
+ else {
|
|
|
+ if (zysqbpService.getTaskByUserAndBusKey(Utils.getCurrentUser().getId().toString(),
|
|
|
+ ba.getId().toString()) != null) {
|
|
|
ba.setTaskState(Constants.TASK_ASSIGN);
|
|
|
- } else if (zysqbpService.getCandidateTaskByUserAndBusKey(
|
|
|
- Utils.getCurrentUser().getId().toString(), ba
|
|
|
- .getId().toString()) != null) {
|
|
|
+ } else if(zysqbpService.getCandidateTaskByUserAndBusKey(Utils.getCurrentUser().getId().toString(),
|
|
|
+ ba.getId().toString()) != null) {
|
|
|
ba.setTaskState(Constants.TASK_CANDIDATE);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
if (ba.getTaskList() != null && ba.getTaskList().size() > 0) {
|
|
|
ba.getTaskList().get(0);
|
|
|
}
|
|
|
if (ba.getZdtaskList() != null && ba.getZdtaskList().size() > 0) {
|
|
|
ba.getZdtaskList().get(0);
|
|
|
}
|
|
|
- }
|
|
|
+ }//end for 设置taskState用于列表最后的操作按钮
|
|
|
+
|
|
|
for (ZysqbpEntity vo : pageList) {
|
|
|
// 检索附件
|
|
|
filterList = new ArrayList<PredicateModel>();
|