Browse Source

Merge remote-tracking branch 'origin/master'

master
PoffyZhang 1 year ago
parent
commit
89a0f0f54f
4 changed files with 97 additions and 49 deletions
  1. +70
    -21
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java
  2. +24
    -12
      pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectFileVO.java
  3. +0
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  4. +3
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/handler/DefaultExpiredSessionStrategy.java

+ 70
- 21
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/manage/ProjectFileManage.java View File

@@ -28,9 +28,16 @@ import com.ningdatech.pmapi.filemanage.model.vo.ProjectFileVO;
import com.ningdatech.pmapi.filemanage.service.INdProjectApplyBorrowService;
import com.ningdatech.pmapi.organization.model.entity.DingOrganization;
import com.ningdatech.pmapi.organization.service.IDingOrganizationService;
import com.ningdatech.pmapi.projectdeclared.manage.ConstructionManage;
import com.ningdatech.pmapi.projectdeclared.manage.DefaultDeclaredProjectManage;
import com.ningdatech.pmapi.projectdeclared.manage.FinalAcceptanceManage;
import com.ningdatech.pmapi.projectdeclared.manage.PurchaseManage;
import com.ningdatech.pmapi.projectdeclared.model.entity.Contract;
import com.ningdatech.pmapi.projectdeclared.model.entity.Purchase;
import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.FinalAcceptanceVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO;
import com.ningdatech.pmapi.projectdeclared.service.IContractService;
import com.ningdatech.pmapi.projectdeclared.service.IPurchaseService;
import com.ningdatech.pmapi.projectlib.enumeration.InstTypeEnum;
@@ -54,6 +61,7 @@ import com.wflow.exception.BusinessException;
import com.wflow.workflow.bean.dto.OrgInfoDTO;
import com.wflow.workflow.bean.process.FileBasicInfo;
import com.wflow.workflow.bean.process.ProcessComment;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import com.wflow.workflow.bean.vo.ProcessStartParamsVo;
import com.wflow.workflow.service.ProcessInstanceService;
import com.wflow.workflow.service.ProcessModelService;
@@ -102,6 +110,9 @@ public class ProjectFileManage {
private final IContractService contractService;
private final ExpertReviewManage expertReviewManage;
private final FileService fileService;
private final PurchaseManage purchaseManage;
private final ConstructionManage constructionManage;
private final FinalAcceptanceManage finalAcceptanceManage;

public PageVo<ProjectFileListVO> list(ProjectFileListParam param) {

@@ -184,9 +195,36 @@ public class ProjectFileManage {
}

public ProjectFileVO file(Long projectId) {
ProjectDetailVO projectDetailVo = projectLibManage.getProjectDetail(projectId);

return null;
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
String empPosUnitCode = userFullInfo.getEmpPosUnitCode();

// 判断该项目是否为本单位或下属单位的项目或者已经申请借阅成功的项目
Project project = projectService.getById(projectId);
Set<String> subOrgList = getSubOrgList(empPosUnitCode);

if (!checkCanRead(subOrgList,project)){
throw new BizException("您没有权限查看此项目档案!");
}
ProjectFileVO projectFileVo = new ProjectFileVO();
String projectCode = project.getProjectCode();
ProjectDetailVO projectDetailVo = projectLibManage.getProjectDetail(projectId);
List<ProcessDetailVO> processDetailVos = projectLibManage.processScheduleDetail(projectId);
ProjectReviewDetailVO projectReviewDetailVo = expertReviewManage.projectExpertReviewDetail(projectCode);
PurchaseVO purchaseVo = purchaseManage.detailByProjectId(projectId);
ContractVO contractVo = constructionManage.detailContractByProjectId(projectId);
PreInsVO preInsVo = constructionManage.detailPreInsByProjectId(projectId);
FinalAcceptanceVO finalAcceptanceVo = finalAcceptanceManage.detailByProjectId(projectId);

projectFileVo.setProjectDetailVo(projectDetailVo);
projectFileVo.setProcessDetailVos(processDetailVos);
projectFileVo.setProjectReviewDetailVo(projectReviewDetailVo);
projectFileVo.setPurchaseVo(purchaseVo);
projectFileVo.setContractVo(contractVo);
projectFileVo.setPreInsVo(preInsVo);
projectFileVo.setFinalAcceptanceVo(finalAcceptanceVo);

return projectFileVo;
}

public String wantRead(Long projectId) {
@@ -357,41 +395,52 @@ public class ProjectFileManage {
// 方案申报阶段
// 获取建设方案文件
String constructionPlanFile = project.getConstructionPlanFile();
JSONObject jsonObject = JSON.parseObject(constructionPlanFile, JSONObject.class);
Long constructFileId = jsonObject.getLong(CommonConst.FILE_ID_STR);
fileIdList.add(constructFileId);
String str = StrPool.LEFT_SQ_BRACKET + StrPool.RIGHT_SQ_BRACKET;
if (!str.equals(constructionPlanFile)) {
JSONObject jsonObject = JSON.parseObject(constructionPlanFile, JSONObject.class);
Long constructFileId = jsonObject.getLong(CommonConst.FILE_ID_STR);
fileIdList.add(constructFileId);
}

// 立项批复阶段
// 获取批复文件
String approvedFile = project.getApprovedFile();
fileIdList.add(Long.valueOf(approvedFile));
if (Objects.nonNull(approvedFile)) {
fileIdList.add(Long.valueOf(approvedFile));
}
// 获取建设方案文件
String approvedConstructionPlanFile = project.getApprovedConstructionPlanFile();
fileIdList.add(Long.valueOf(approvedConstructionPlanFile));
if (Objects.nonNull(approvedConstructionPlanFile)) {
fileIdList.add(Long.valueOf(approvedConstructionPlanFile));
}

// 采购结果备案阶段
Purchase purchase = purchaseService
.getOne(Wrappers.lambdaQuery(Purchase.class).eq(Purchase::getProjectId, projectId).last(BizConst.LIMIT_1));
// 获取投标文件
String biddingDoc = purchase.getBiddingDoc();
List<Long> biddingFileIdList = getFileIdList(biddingDoc);
fileIdList.addAll(biddingFileIdList);
// 获取招标文件
String bidDoc = purchase.getBidDoc();
List<Long> bidFileIdList = getFileIdList(bidDoc);
fileIdList.addAll(bidFileIdList);
// 获取中标通知书
String acceptanceLetter = purchase.getAcceptanceLetter();
List<Long> acceptFileIdList = getFileIdList(acceptanceLetter);
fileIdList.addAll(acceptFileIdList);
if (Objects.nonNull(purchase)) {
String biddingDoc = purchase.getBiddingDoc();
List<Long> biddingFileIdList = getFileIdList(biddingDoc);
fileIdList.addAll(biddingFileIdList);
// 获取招标文件
String bidDoc = purchase.getBidDoc();
List<Long> bidFileIdList = getFileIdList(bidDoc);
fileIdList.addAll(bidFileIdList);
// 获取中标通知书
String acceptanceLetter = purchase.getAcceptanceLetter();
List<Long> acceptFileIdList = getFileIdList(acceptanceLetter);
fileIdList.addAll(acceptFileIdList);
}

// 合同备案阶段
Contract contract = contractService
.getOne(Wrappers.lambdaQuery(Contract.class).eq(Contract::getProjectId, projectId).last(BizConst.LIMIT_1));
// 获取合同附件
String attachment = contract.getAttachment();
List<Long> contractFileIdList = getFileIdList(attachment);
fileIdList.addAll(contractFileIdList);
if (Objects.nonNull(contract)) {
String attachment = contract.getAttachment();
List<Long> contractFileIdList = getFileIdList(attachment);
fileIdList.addAll(contractFileIdList);
}
// 初验备案阶段
// 获取初验材料
String preliminaryInspectionMaterials = project.getPreliminaryInspectionMaterials();


+ 24
- 12
pmapi/src/main/java/com/ningdatech/pmapi/filemanage/model/vo/ProjectFileVO.java View File

@@ -1,10 +1,19 @@
package com.ningdatech.pmapi.filemanage.model.vo;

import com.ningdatech.pmapi.expert.model.vo.ExpertReviewDetailVO;
import com.ningdatech.pmapi.expert.model.vo.ProjectReviewDetailVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.FinalAcceptanceVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.PurchaseVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.List;

/**
* @Classname ProjectFileVO
@@ -16,21 +25,24 @@ import java.time.LocalDateTime;
@ApiModel(value = "ProjectFileVO", description = "项目档案")
public class ProjectFileVO {

@ApiModelProperty("项目ID")
private Long id;
@ApiModelProperty("项目档案详情")
private ProjectDetailVO projectDetailVo;

@ApiModelProperty("项目名称")
private String projectName;
@ApiModelProperty("流程进度详情")
private List<ProcessDetailVO> processDetailVos;

@ApiModelProperty("项目单位")
private String buildOrgName;
@ApiModelProperty("专家评审详情")
private ProjectReviewDetailVO projectReviewDetailVo;

@ApiModelProperty("项目编号")
private String pojectCode;
@ApiModelProperty("招标登记详情")
private PurchaseVO purchaseVo;

@ApiModelProperty("是否可阅")
private Boolean canRead = Boolean.FALSE;
@ApiModelProperty("合同登记详情")
private ContractVO contractVo;

@ApiModelProperty("最后修改时间")
private LocalDateTime updateOn;
@ApiModelProperty("初验登记详情")
private PreInsVO preInsVo;

@ApiModelProperty("终验信息详情")
private FinalAcceptanceVO finalAcceptanceVo;
}

+ 0
- 11
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -551,18 +551,7 @@ public class ProjectLibManage {
}

public List<ProcessDetailVO> processScheduleDetail(Long projectId) {

UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
String empPosUnitCode = userFullInfo.getEmpPosUnitCode();

List<ProcessDetailVO> processDetailVOS = new ArrayList<>();
// 判断该项目是否为本单位或下属单位的项目或者已经申请借阅成功的项目
Project project = projectService.getById(projectId);
Set<String> subOrgList = getSubOrgList(empPosUnitCode);

if (!checkCanRead(subOrgList,project)){
throw new BizException("您没有权限查看此项目档案!");
}
return processExecuteHandle.handle(projectId, processDetailVOS);
}



+ 3
- 5
pmapi/src/main/java/com/ningdatech/pmapi/user/security/auth/handler/DefaultExpiredSessionStrategy.java View File

@@ -6,11 +6,11 @@ import com.ningdatech.pmapi.user.security.auth.errorcode.AuthErrorCodeEnum;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.security.web.session.SessionInformationExpiredEvent;
import org.springframework.security.web.session.SessionInformationExpiredStrategy;
import org.springframework.stereotype.Component;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@@ -29,11 +29,9 @@ public class DefaultExpiredSessionStrategy implements SessionInformationExpiredS

@Override
public void onExpiredSessionDetected(SessionInformationExpiredEvent sessionInformationExpiredEvent)
throws IOException, ServletException {
if (LOG.isInfoEnabled()) {
LOG.info("session is expired");
}
throws IOException {
HttpServletResponse response = sessionInformationExpiredEvent.getResponse();
response.setStatus(HttpStatus.UNAUTHORIZED.value());
response.setContentType("application/json;charset=UTF-8");
response.getWriter().write(objectMapper.writeValueAsString(
ApiResponse.of(AuthErrorCodeEnum.SESSION_EXPIRED.getCode(), AuthErrorCodeEnum.SESSION_EXPIRED.getMsg(), null)));


Loading…
Cancel
Save