From 54b75751cfc8e161aed657e26b73c01e7f608441 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Thu, 6 Apr 2023 10:24:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=80=E4=B8=AA=20?= =?UTF-8?q?=E5=8F=AF=E4=B8=8A=E4=BC=A0=E4=B8=8A=E7=BA=A7=E6=9D=A1=E7=BA=BF?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E7=9A=84boolean=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectLibManage.java | 2 ++ .../projectlib/model/vo/ProjectLibListItemVO.java | 23 ++++++++++++++++++++++ .../user/security/auth/model/UserInfoDetails.java | 9 +++++++++ 3 files changed, 34 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index ea076ce..add992f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -82,6 +82,7 @@ public class ProjectLibManage { item.setBizDomain(w.getBizDomain()); item.setProcessStatus(w.getProcessStatus()); item.setInstCode(w.getInstCode()); + item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); return item; }); return PageVo.of(records, total); @@ -109,6 +110,7 @@ public class ProjectLibManage { item.setBizDomain(w.getBizDomain()); item.setProcessStatus(w.getProcessStatus()); item.setInstCode(w.getInstCode()); + item.setIsHigherSuperOrg(w.getIsHigherSuperOrg()); if(user.getIsOrgAdmin() && ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(item.getStatus()) && StringUtils.isNotBlank(w.getSuperOrgCode()) && StringUtils.isNotBlank(user.getOrganizationCode()) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java index 6c7f8fe..08a6959 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectLibListItemVO.java @@ -1,7 +1,11 @@ package com.ningdatech.pmapi.projectlib.model.vo; import com.fasterxml.jackson.annotation.JsonFormat; +import com.ningdatech.pmapi.common.enumeration.CommonEnum; +import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum; import com.ningdatech.pmapi.projectlib.enumeration.ProjectTypeEnum; +import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; +import com.ningdatech.pmapi.user.util.LoginUserUtil; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Builder; @@ -95,4 +99,23 @@ public class ProjectLibListItemVO { @ApiModelProperty("21位项目编号") private String projectCode; + + @ApiModelProperty("是否有上级条线主管部门 0没有 1有") + private Integer isHigherSuperOrg; + + //预审申报时候 需不需要上传上级条线意见文件 + private Boolean needUploadSuperLineFile; + public Boolean getNeedUploadSuperLineFile() { + UserInfoDetails userInfoDetail = LoginUserUtil.loginUserDetail(); + //要满足条件 1.当前登录人是市本级单位 2.有上级条线单位 3.项目状态是待预审 + if (Objects.nonNull(userInfoDetail) && userInfoDetail.getIsMunicipalOrg() + && Objects.nonNull(this.isHigherSuperOrg) + && ProjectStatusEnum.PENDING_PREQUALIFICATION.getCode().equals(this.status) + && CommonEnum.YES.getCode().equals(this.isHigherSuperOrg)) { + this.needUploadSuperLineFile = Boolean.TRUE; + return this.needUploadSuperLineFile; + } + this.needUploadSuperLineFile = null; + return this.needUploadSuperLineFile; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java index c95e2e3..e21d3d0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/model/UserInfoDetails.java @@ -3,6 +3,7 @@ package com.ningdatech.pmapi.user.security.auth.model; import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollectionUtil; import com.ningdatech.basic.auth.AbstractLoginUser; +import com.ningdatech.pmapi.common.constant.RegionConst; import com.ningdatech.pmapi.sys.model.entity.Role; import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum; import lombok.Data; @@ -133,4 +134,12 @@ public class UserInfoDetails extends AbstractLoginUser implements UserDetails { } return Boolean.FALSE; } + + public Boolean getIsMunicipalOrg(){ + //如果是丽水市本级的code 就是 + if(RegionConst.RC_LS.equals(this.regionCode)){ + return Boolean.TRUE; + } + return Boolean.FALSE; + } }