Explorar el Código

Merge branch 'master' into feature/dashboard

master
niohe·erbao hace 1 año
padre
commit
879912db73
Se han modificado 21 ficheros con 204 adiciones y 77 borrados
  1. +7
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/ApplicationController.java
  2. +4
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/IrsController.java
  3. +80
    -36
      pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java
  4. +4
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java
  5. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java
  6. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java
  7. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java
  8. +5
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java
  9. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java
  10. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java
  11. +23
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  12. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java
  13. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  14. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
  15. +21
    -13
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  16. +5
    -0
      pmapi/src/main/resources/application-dev.yml
  17. +5
    -0
      pmapi/src/main/resources/application-pre.yml
  18. +5
    -0
      pmapi/src/main/resources/application-prod.yml
  19. +16
    -9
      pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest.java
  20. +5
    -0
      pmapi/src/test/resources/application-dev.yml
  21. +6
    -1
      pmapi/src/test/resources/application-pre.yml

+ 7
- 3
pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/ApplicationController.java Ver fichero

@@ -1,19 +1,17 @@
package com.ningdatech.pmapi.irs.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.irs.manage.AppIrsManage;
import com.ningdatech.pmapi.irs.model.dto.ApiApplyDTO;
import com.ningdatech.pmapi.irs.model.dto.ApiApplySearchResult;
import com.ningdatech.pmapi.irs.model.dto.PushProjectAppToIrsDTO;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.security.NoSuchAlgorithmException;
import java.util.List;

/**
* @Classname ApplicationController
@@ -45,4 +43,10 @@ public class ApplicationController {
public JSONArray searchApps(ApiApplyDTO apply) throws NoSuchAlgorithmException {
return appIrsManage.searchApps(apply);
}

@GetMapping("/digitalResourcesIndicators/{appCode}/{pageSize}")
public JSONObject getDigitalResourcesIndicators(@PathVariable String appCode,@PathVariable Integer pageSize) {
return appIrsManage.getDigitalResourceIndicatorsByAppCode(appCode, pageSize);
}

}

+ 4
- 6
pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/IrsController.java Ver fichero

@@ -1,9 +1,6 @@
package com.ningdatech.pmapi.irs.controller;

import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.common.util.CryptUtils;
import com.ningdatech.pmapi.common.util.HttpUtil;
import com.ningdatech.pmapi.irs.utils.RefreshTokenUtil;
import com.ningdatech.pmapi.projectdeclared.manage.IrsManage;
import com.ningdatech.pmapi.projectdeclared.model.vo.IrsApplicationVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.PiotTasksVO;
@@ -11,10 +8,11 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;


+ 80
- 36
pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java Ver fichero

@@ -9,12 +9,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.function.VUtils;
import com.ningdatech.irs.service.IRefreshTokenService;
import com.ningdatech.pmapi.common.enumeration.CommonEnum;
import com.ningdatech.pmapi.common.statemachine.contants.RegionContant;
import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.common.util.CryptUtils;
import com.ningdatech.pmapi.common.util.HttpUtil;
import com.ningdatech.pmapi.common.util.RefreshKeyUtil;
import com.ningdatech.pmapi.irs.model.dto.*;
import com.ningdatech.pmapi.irs.model.dto.ApiApplyDTO;
import com.ningdatech.pmapi.irs.model.dto.ApiApplySearchResult;
import com.ningdatech.pmapi.irs.model.dto.PushProjectAppToIrsDTO;
import com.ningdatech.pmapi.irs.model.res.ApiResponse;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
@@ -34,7 +35,6 @@ import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.security.NoSuchAlgorithmException;
import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@@ -93,8 +93,23 @@ public class AppIrsManage {
@Value("${irs.push-project-detail.appSecret}")
private String pushProjectAppSecret;

//=============数字资源指标获取========================================================================================

@Value("${irs.digital-resource-indicators.app-key}")
private String driAppKey;

@Value("${irs.digital-resource-indicators.app-secret}")
private String driAppSecret;

@Value("${irs.digital-resource-indicators.interface-name}")
private String driInterfaceName;

@Value("${irs.digital-resource-indicators.url}")
private String driUrl;

/**
* 推送 项目和应用关系
*
* @param dto
* @return
* @throws NoSuchAlgorithmException
@@ -112,14 +127,14 @@ public class AppIrsManage {
ApiApplyDTO apiApply = new ApiApplyDTO();
apiApply.setAppId(appCode);
JSONObject jsonObject = this.searchApp(apiApply);
ApiApplySearchResult apiApplySearchResult = JSON.parseObject(JSON.toJSONString(jsonObject),ApiApplySearchResult.class);
ApiApplySearchResult apiApplySearchResult = JSON.parseObject(JSON.toJSONString(jsonObject), ApiApplySearchResult.class);
VUtils.isTrue(Objects.isNull(apiApplySearchResult)).throwMessage("应用在IRS不存在!");

long timestamp = System.currentTimeMillis();
String areaCode = project.getAreaCode();
String projectName = project.getProjectName();
String requestSecret = RefreshKeyUtil.getRequestSecret(pushAppKey, pushAppScret);
String capCode = CryptUtils.encryptHMAC(timestamp + areaCode,"bcb4fc0f517fc168ee543fcf4d231f3b");
String capCode = CryptUtils.encryptHMAC(timestamp + areaCode, "bcb4fc0f517fc168ee543fcf4d231f3b");
String capTime = String.valueOf(timestamp);
String sign = CryptUtils.MD5Encode(pushAppKey + requestSecret + timestamp);
String url = pushUrl + "?requestTime=" + timestamp +
@@ -134,14 +149,14 @@ public class AppIrsManage {

ApiResponse body = forEntity.getBody();

if(Objects.isNull(body) || Objects.isNull(body.getCode())
|| 0 != body.getCode()){
if (Objects.isNull(body) || Objects.isNull(body.getCode())
|| 0 != body.getCode()) {
return Boolean.FALSE;
}

//保存关系
app.setAppCode(appCode);
if(applicationService.updateById(app)){
if (applicationService.updateById(app)) {
/**
* 判断下 如果成功的话 那么判断下 这个项目的初次创建的app 是否都已经被注册
* 如果都已经注册 要调用状态机 进入下一个状态
@@ -150,8 +165,8 @@ public class AppIrsManage {
.eq(ProjectApplication::getProjectId, project.getId()));
//筛选出 初次新建的app 但是没有appCode的
apps = apps.stream().filter(a -> {
if(CommonEnum.YES.getCode().equals(a.getIsFirst()) &&
StringUtils.isBlank(app.getAppCode())){
if (CommonEnum.YES.getCode().equals(a.getIsFirst()) &&
StringUtils.isBlank(app.getAppCode())) {
return Boolean.TRUE;
}
return Boolean.FALSE;
@@ -159,7 +174,7 @@ public class AppIrsManage {
.collect(Collectors.toList());

//如果筛选出来的 为空的话 就调用状态机
if(CollUtil.isEmpty(apps)){
if (CollUtil.isEmpty(apps)) {
stateMachineUtils.pass(project);
project.setUpdateOn(LocalDateTime.now());
projectService.updateById(project);
@@ -171,6 +186,7 @@ public class AppIrsManage {

/**
* 查询app
*
* @param apply
* @return
* @throws NoSuchAlgorithmException
@@ -184,27 +200,27 @@ public class AppIrsManage {
"&appKey=" + searchAppKey + "&" +
"pageSize=10&pageNum=1&appCode=" + appCode +
"&areaCode=&deptCode=&name=";
log.info("url : {}",url);
log.info("url : {}", url);
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);

log.info("查询应用目录 : {}",JSON.toJSONString(forEntity));
log.info("查询应用目录 : {}", JSON.toJSONString(forEntity));

if(Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody())){
if (Objects.nonNull(forEntity.getBody()) && Objects.nonNull(forEntity.getBody())) {
JSONObject body = JSON.parseObject(forEntity.getBody());
if(Objects.isNull(body)){
if (Objects.isNull(body)) {
return null;
}
JSONObject datas = body.getJSONObject("datas");
if(Objects.isNull(datas)){
if (Objects.isNull(datas)) {
return null;
}
JSONObject data = datas.getJSONObject("data");
if(Objects.isNull(data)){
if (Objects.isNull(data)) {
return null;
}
JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult");
if(CollUtil.isEmpty(apiApplySearchResult)){
if (CollUtil.isEmpty(apiApplySearchResult)) {
return null;
}
return apiApplySearchResult.getJSONObject(0);
@@ -225,19 +241,19 @@ public class AppIrsManage {
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);

log.info("查询应用目录 : {}",JSON.toJSONString(forEntity));
log.info("查询应用目录 : {}", JSON.toJSONString(forEntity));

if(Objects.nonNull(forEntity.getBody())){
if (Objects.nonNull(forEntity.getBody())) {
JSONObject body = JSON.parseObject(forEntity.getBody());
if(Objects.isNull(body)){
if (Objects.isNull(body)) {
return null;
}
JSONObject datas = body.getJSONObject("datas");
if(Objects.isNull(datas)){
if (Objects.isNull(datas)) {
return null;
}
JSONObject data = datas.getJSONObject("data");
if(Objects.isNull(data)){
if (Objects.isNull(data)) {
return null;
}
JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult");
@@ -252,14 +268,14 @@ public class AppIrsManage {
String appKey = "A331101453557202109017383";
String method = "POST";
String interfaceName = "5crv7i4727abLCv0";
String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,interfaceName,method);
log.info("secret :{}",secret);
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, method);
log.info("secret :{}", secret);
String sign = MD5.create().digestHex(appKey + secret + timestamp);
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate;
if(Objects.nonNull(factory)){
if (Objects.nonNull(factory)) {
restTemplate = new RestTemplate(factory);
}else{
} else {
restTemplate = new RestTemplate();
}
String appId = "A330000100000202105005790";
@@ -269,7 +285,7 @@ public class AppIrsManage {
"&sign=" + sign + "&appKey=" + appKey +
"&capCode=" + capCode + "&capTime=" + timestamp +
"&appId=" + appId;
log.info("url :{}",url);
log.info("url :{}", url);
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
log.info(forEntity.getBody());
return forEntity.getBody();
@@ -277,6 +293,7 @@ public class AppIrsManage {

/**
* 推送项目详情
*
* @return
*/
public String pushProjectDetail(ProjectDTO projectDto) {
@@ -285,14 +302,14 @@ public class AppIrsManage {
String appKey = pushProjectAppKey;
String method = HttpMethod.POST.name();
String interfaceName = pushProjectInterfaceName;
String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,interfaceName,method);
log.info("secret :{}",secret);
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, method);
log.info("secret :{}", secret);
String sign = MD5.create().digestHex(appKey + secret + timestamp);
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate;
if(Objects.nonNull(factory)){
if (Objects.nonNull(factory)) {
restTemplate = new RestTemplate(factory);
}else{
} else {
restTemplate = new RestTemplate();
}
String baseProjPrincipal = projectDto.getResponsibleMan();//"蒋国海"
@@ -318,13 +335,13 @@ public class AppIrsManage {
String baseProvManDeprtDing = projectDto.getHigherSuperOrgCode();//"GO_6c383c049d95461f9a0df780140ceb32";
String baseBasisEstablish = projectDto.getBuildBasis();//"中共遂昌县委办公室关于研究开发“天工”智能化管理平台(三期)的函";
String capCode = null;
try{
try {
capCode = CryptUtils.encryptHMAC(timestamp + areaCode, "bcb4fc0f517fc168ee543fcf4d231f3b");
}catch (Exception e){
} catch (Exception e) {
log.error(e.getMessage());
}

String url = pushProjectUrl+ "?" +
String url = pushProjectUrl + "?" +
"requestTime=" + timestamp + "&sign=" + sign +
"&appKey=" + appKey + "&baseProjPrincipal=" + baseProjPrincipal + "" +
"&baseProjSetYear=" + baseProjSetYear + "&baseProjId=" + baseProjId +
@@ -337,9 +354,36 @@ public class AppIrsManage {
"&baseProjConsClass=" + baseProjConsClass + "&capCode=" + capCode + "&baseManDeprtDing=" + baseManDeprtDing +
"&baseProvManDeprtDing=" + baseProvManDeprtDing + "&baseBasisEstablish=" + baseBasisEstablish +
"&baseAreaCode=" + areaCode + "&capTime=" + timestamp + "&baseAreaName=" + baseAreaName;
log.info("url :{}",url);
log.info("url :{}", url);
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
log.info(forEntity.getBody());
return forEntity.getBody();
}

public JSONObject getDigitalResourceIndicatorsByAppCode(String appCode, Integer pageSize) {
long timestamp = System.currentTimeMillis();
String appSecret = driAppSecret;
String appKey = driAppKey;
String method = HttpMethod.POST.name();
String interfaceName = driInterfaceName;
String secret = refreshTokenService.refreshToken(appKey, appSecret, govRequestTokenUrl, govRefreshTokenUrl, interfaceName, method);
log.info("secret : {}", secret);
String sign = MD5.create().digestHex(appKey + secret + timestamp);
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate;
if (Objects.nonNull(factory)) {
restTemplate = new RestTemplate(factory);
} else {
restTemplate = new RestTemplate();
}

String url = driUrl + "?" +
"requestTime=" + timestamp + "&sign=" + sign +
"&appKey=" + appKey + "&appCode=" + appCode + "&pageIndex=1&pageSize=" + pageSize;
log.info("url :{}", url);
ResponseEntity<JSONObject> forEntity = restTemplate.getForEntity(url, JSONObject.class);
log.info(Objects.requireNonNull(forEntity.getBody()).toJSONString());
return forEntity.getBody();
}

}

+ 4
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java Ver fichero

@@ -238,7 +238,8 @@ public class FinalAcceptanceManage {

//保存终验项目
//生成新版本 并且进入下一状态
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode());
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId,
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE);

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,
@@ -298,7 +299,8 @@ public class FinalAcceptanceManage {

//保存终验项目
//生成新版本 并且进入下一状态
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode());
projectInfo = projectLibManage.saveProjectWithVersionAndPass(projectInfo,instanceId,
InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode(),Boolean.TRUE);

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,


+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java Ver fichero

@@ -102,9 +102,6 @@ public class ReviewByDeptJointManage {

//保存项目信息
projectInfo = projectLibManage.saveProjectWithVersion(projectInfo,instanceId,ProjectProcessStageEnum.DEPARTMENT_JOINT_APPROVAL_PROCESS.getCode());
// if(!modifyProject(projectInfo, instanceId)){
// return Boolean.FALSE;
// }

//发送给第一个审批人消息
noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java Ver fichero

@@ -12,6 +12,7 @@ import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -64,6 +65,7 @@ public class ConstructionPlanReviewHandle extends AbstractProcessBusinessHandle
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.CONSTRUCTION_PLAN_REVIEW.getCode())
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last(BizConst.LIMIT_1));
ProcessProgressVo instanceDetail = null;


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java Ver fichero

@@ -10,6 +10,7 @@ import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -66,6 +67,7 @@ public class DeptUnitedReviewHandle extends AbstractProcessBusinessHandle {
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.DEPT_UNITED_REVIEW.getCode())
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last(BizConst.LIMIT_1));
if (Objects.isNull(projectInst)){


+ 5
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java Ver fichero

@@ -12,6 +12,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -60,10 +61,13 @@ public class PreliminaryPreviewHandle extends AbstractProcessBusinessHandle {
if (Objects.isNull(project)){
throw new BizException("当前项目不存在!");
}
//查出历史版本的 所有项目ID
List<Long> allVersionProjectIds = projectService.getAllVersionProjectId(projectId);
// 根据项目ID查询项目预审流程的流程状态
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.eq(ProjectInst::getProjectId, projectId)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.PRELIMINARY_PREVIEW.getCode())
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last("limit 1"));
ProcessProgressVo instanceDetail = null;


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java Ver fichero

@@ -13,6 +13,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectInst;
import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.process.ProgressNode;
import com.wflow.workflow.bean.vo.ProcessDetailVO;
@@ -60,6 +61,7 @@ public class ProjectFinalInspectionHandle extends AbstractProcessBusinessHandle
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.PROJECT_FINAL_INSPECTION.getCode())
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last(BizConst.LIMIT_1));



+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java Ver fichero

@@ -20,6 +20,7 @@ import com.ningdatech.pmapi.projectlib.service.IProjectInstService;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.projectlib.utils.ProjectVersionUtil;
import com.ningdatech.pmapi.todocenter.constant.TodoCenterConstant;
import com.ningdatech.pmapi.todocenter.utils.BuildUserUtils;
import com.wflow.workflow.bean.dto.ProcessInstanceUserDto;
import com.wflow.workflow.bean.process.ProgressNode;
@@ -67,6 +68,7 @@ public class UnitInnerAuditHandle extends AbstractProcessBusinessHandle {
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, allVersionProjectIds)
.eq(ProjectInst::getInstType, InstTypeEnum.UNIT_INNER_AUDIT.getCode())
.ne(ProjectInst::getInstCode, TodoCenterConstant.Declared.NULL_INST_CODE)
.orderByDesc(ProjectInst::getCreatOn)
.last(BizConst.LIMIT_1));
ProcessProgressVo instanceDetail = null;


+ 23
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java Ver fichero

@@ -317,6 +317,7 @@ public class ProjectLibManage {
project.setVersion(oldProject.getVersion() + 1);
// 标记为建设方案申报
project.setIsConstruct(Boolean.TRUE);
project.setIsBackReject(Boolean.FALSE);
// 保存初步方案项目ID
if (Boolean.TRUE.equals(oldProject.getIsConstruct())) {
// 重新提交
@@ -384,9 +385,13 @@ public class ProjectLibManage {
project.setId(null);
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
project.setIsBackReject(Boolean.FALSE);
stateMachineUtils.pass(project);
projectService.save(project);

oldProject.setIsBackReject(Boolean.TRUE);
projectService.updateById(oldProject);

projectService.update(Wrappers.lambdaUpdate(Project.class)
.set(Project::getNewest, Boolean.FALSE)
.ne(Project::getId, project.getId())
@@ -410,6 +415,8 @@ public class ProjectLibManage {
project.setId(null);
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
//都是在驳回 重新提交时用的
project.setIsBackReject(Boolean.FALSE);
if (Objects.nonNull(stageCode)) {
project.setStage(stageCode);
}
@@ -417,6 +424,9 @@ public class ProjectLibManage {
project.setStatus(statusCode);
}

oldProject.setIsBackReject(Boolean.TRUE);
projectService.updateById(oldProject);

if (projectService.save(project)) {
projectService.update(Wrappers.lambdaUpdate(Project.class)
.set(Project::getNewest, Boolean.FALSE)
@@ -500,7 +510,7 @@ public class ProjectLibManage {
return project;
}

public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType) {
public Project saveProjectWithVersionAndPass(Project oldProject, String instanceId, Integer instType,Boolean isBackReject) {
Project project = new Project();
VUtils.isTrue(Objects.isNull(oldProject))
.throwMessage("项目不存在!");
@@ -512,9 +522,13 @@ public class ProjectLibManage {
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
// 标识保存的项目信息是否为建设方案申报项目
project.setIsConstruct(Boolean.TRUE);
project.setIsConstruct(Boolean.FALSE);
project.setIsBackReject(isBackReject);
stateMachineUtils.pass(project);

oldProject.setIsBackReject(Boolean.TRUE);
projectService.updateById(oldProject);

if (projectService.save(project)) {
//保存项目和实例的关系
ProjectInst projectInst = new ProjectInst();
@@ -549,9 +563,12 @@ public class ProjectLibManage {
project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now());
// 标识保存的项目信息是否为建设方案申报项目
project.setIsConstruct(Boolean.TRUE);
project.setIsConstruct(Boolean.FALSE);
stateMachineUtils.pass(project);

oldProject.setIsBackReject(Boolean.TRUE);
projectService.updateById(oldProject);

if (projectService.save(project)) {
//保存项目和实例的关系
ProjectInst projectInst = new ProjectInst();
@@ -1020,8 +1037,11 @@ public class ProjectLibManage {
return res;
}

//只查 当前版本 和历史被驳回|退回的版本
List<Project> historyProjects = projectService.list(Wrappers.lambdaQuery(Project.class)
.eq(Project::getProjectCode, project.getProjectCode())
.and(q1->q1.eq(Project::getNewest, Boolean.TRUE)
.or(q2->q2.eq(Project::getIsBackReject,Boolean.TRUE)))
.orderByDesc(Project::getCreateOn));

if (CollUtil.isEmpty(historyProjects)) {


+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java Ver fichero

@@ -317,4 +317,7 @@ public class ProjectDTO implements Serializable {

@ApiModelProperty("项目类型 01首次建设;02迭代升级;03结转建设;04新运维;05续运维")
private String baseProjType;

@ApiModelProperty("是否退回|驳回的项目版本")
private Boolean isBackReject = Boolean.FALSE;
}

+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java Ver fichero

@@ -483,4 +483,8 @@ public class Project implements Serializable {

@ApiModelProperty("区县预审本级主管单位盖章审核日期")
private String countrySealAuditDate;

@ApiModelProperty("是否退回|驳回的项目版本")
private Boolean isBackReject;

}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java Ver fichero

@@ -395,6 +395,9 @@ public class ProjectDetailVO {
@ApiModelProperty("审批详情")
private ProcessProgressDetailVo process;

@ApiModelProperty("是否退回|驳回的项目版本")
private Boolean isBackReject;

public String getVersionStr() {
if (Objects.nonNull(this.newest) && this.newest) {
this.versionStr = "当前版本";


+ 21
- 13
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java Ver fichero

@@ -653,10 +653,7 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
Map<String, Project> projectInfoMap = projectInstList.stream()
.filter(p -> Objects.nonNull(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
@@ -796,10 +793,7 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId));
Map<String, Project> projectInfoMap = projectInstList.stream()
.filter(p -> Objects.nonNull(p.getInstCode()) &&
!TodoCenterConstant.Declared.NULL_INST_CODE.equals(p.getInstCode()))
.collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
Map<String, Project> projectInfoMap = projectInstList.stream().collect(Collectors.toMap(ProjectInst::getInstCode, p -> projectsMap.get(p.getProjectId())));
List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());

// 查出用户工作流
@@ -1108,12 +1102,15 @@ public class TodoCenterManage {
project.setUpdateOn(LocalDateTime.now());
projectService.save(project);

oldProject.setIsBackReject(Boolean.TRUE);
projectService.updateById(oldProject);

ProjectInst oldInst = projectInstService.getOne(Wrappers.lambdaUpdate(ProjectInst.class)
.eq(ProjectInst::getProjectId, oldProject.getId())
.eq(ProjectInst::getInstCode, oldProject.getInstCode()));

String instCode = oldProject.getInstCode();
oldInst.setInstCode("EMPTY");
oldInst.setInstCode(TodoCenterConstant.Declared.NULL_INST_CODE);
projectInstService.updateById(oldInst);

ProjectInst newPi = new ProjectInst();
@@ -1142,6 +1139,9 @@ public class TodoCenterManage {
.eq(ProjectApplication::getIsConstruct, Boolean.TRUE));
if (CollUtil.isNotEmpty(applicationList)) {
projectApplicationService.removeBatchByIds(applicationList);
List<Long> applicationIds = applicationList.stream().map(ProjectApplication::getId).collect(Collectors.toList());
// projectCoreBusinessIndicatorsService.remove(Wrappers.lambdaQuery(ProjectCoreBusinessIndicators.class)
// .in(ProjectCoreBusinessIndicators::getApplicationId, applicationIds));
}

List<ProjectApplicationDTO> applications = projectDto.getApplicationList();
@@ -1159,11 +1159,19 @@ public class TodoCenterManage {
!InstTypeEnum.DEPT_UNITED_REVIEW.getCode().equals(instType)) {
projectApplication.setIsConstruct(Boolean.TRUE);
}
if(StringUtils.isNotBlank(application.getRelatedExistsApplication())){
projectApplication.setApplicationName(null);
}
projectApplication.setProjectVersion(project.getVersion());
projectApplicationService.save(projectApplication);
boolean result = projectApplicationService.save(projectApplication);
// // 保存应用关联的核心业务
// List<ProjectCoreBusinessDTO> coreBusinessList = application.getCoreBusinessList();
// Boolean hasCoreBusiness = CollUtil.isNotEmpty(coreBusinessList) ? Boolean.TRUE : Boolean.FALSE;
// if (Boolean.TRUE.equals(result) && Boolean.TRUE.equals(hasCoreBusiness)){
// for (ProjectCoreBusinessDTO coreBusiness : coreBusinessList) {
// ProjectCoreBusinessIndicators projectCoreBusinessIndicators = new ProjectCoreBusinessIndicators();
// BeanUtils.copyProperties(coreBusiness, projectCoreBusinessIndicators);
// projectCoreBusinessIndicators.setApplicationId(application.getId());
// projectCoreBusinessIndicatorsService.save(projectCoreBusinessIndicators);
// }
// }
}
}
return Boolean.TRUE;


+ 5
- 0
pmapi/src/main/resources/application-dev.yml Ver fichero

@@ -206,6 +206,11 @@ provincial:
#天印服务器接口信息
irs:
is-search-app: false
digital-resource-indicators:
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm
interface-name: 99E2bic31KdXzaa7
app-key: A331101453557202109017383
app-secret: 496f0f2a19994f76b4fd9dae087366c7
seal-platform:
project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a


+ 5
- 0
pmapi/src/main/resources/application-pre.yml Ver fichero

@@ -209,6 +209,11 @@ provincial:
#天印服务器接口信息
irs:
is-search-app: true
digital-resource-indicators:
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm
interfaceName: 99E2bic31KdXzaa7
app-key: A331101453557202109017383
app-secret: 496f0f2a19994f76b4fd9dae087366c7
seal-platform:
project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a


+ 5
- 0
pmapi/src/main/resources/application-prod.yml Ver fichero

@@ -209,6 +209,11 @@ provincial:
#天印服务器接口信息
irs:
is-search-app: true
digital-resource-indicators:
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm
interfaceName: 99E2bic31KdXzaa7
app-key: A331101453557202109017383
app-secret: 496f0f2a19994f76b4fd9dae087366c7
seal-platform:
project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a


+ 16
- 9
pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest.java Ver fichero

@@ -7,6 +7,7 @@ import com.ningdatech.pmapi.AppTests;
import com.ningdatech.pmapi.common.util.CryptUtils;
import com.ningdatech.pmapi.common.util.HmacAuthUtil;
import com.ningdatech.pmapi.common.util.RefreshKeyUtil;
import com.ningdatech.pmapi.irs.manage.AppIrsManage;
import com.ningdatech.zwdd.ZwddIntegrationProperties;
import com.ningdatech.zwdd.client.ZwddAuthClient;
import com.ningdatech.zwdd.client.ZwddClient;
@@ -20,12 +21,14 @@ import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;

import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.NoSuchAlgorithmException;
import java.util.*;
import java.util.Map;
import java.util.Objects;

/**
* @Classname IrsTest
@@ -40,9 +43,11 @@ public class IrsTest extends AppTests {

@Autowired
private ZwddClient zwddClient;
@Autowired
private AppIrsManage appIrsManage;

@Test
public void test1(){
public void test1() {
String method = "GET";
String url = "https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020230427000001/irs-res-bill/report/pdfUrl" +
"?appCode=A331101453557202109017383";
@@ -53,14 +58,14 @@ public class IrsTest extends AppTests {
//请求头
HttpHeaders headers = new HttpHeaders();

for(Map.Entry<String, String> entry : header.entrySet()){
for (Map.Entry<String, String> entry : header.entrySet()) {
headers.add(entry.getKey(), entry.getValue());
}
//封装请求头
HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers);

RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> forEntity = restTemplate.exchange(url, HttpMethod.GET,formEntity, String.class);
ResponseEntity<String> forEntity = restTemplate.exchange(url, HttpMethod.GET, formEntity, String.class);

System.out.println(JSON.toJSONString(forEntity));
}
@@ -100,7 +105,7 @@ public class IrsTest extends AppTests {
String sign = CryptUtils.MD5Encode(appKey + requestSecret + timestamp);
String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/94wbaL1I1Pbz0648.htm?requestTime=" + timestamp +
"&sign=" + sign + "&appKey=" + appKey + "&capCode=" + capCode + "&capTime=" + capTime +
"&baseProjSys=" + baseProjSys + "&areaCode=331123&baseProjName=" + baseProjName + "&baseProjId=" + baseProjId +
"&baseProjSys=" + baseProjSys + "&areaCode=331123&baseProjName=" + baseProjName + "&baseProjId=" + baseProjId +
"&isEffective=1&baseProjSysCode=" + baseProjSysCode;
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
@@ -116,7 +121,7 @@ public class IrsTest extends AppTests {
}

@Test
public void test4(){
public void test4() {
CloseableHttpResponse response = null;
try {
String api = "/media/download";
@@ -147,7 +152,7 @@ public class IrsTest extends AppTests {
fos.close();
} catch (Exception e) {
System.out.println(e);
}finally {
} finally {
if (response != null) {
try {
//特别提醒:需要调用response的close方法关闭网络连接!!!
@@ -160,7 +165,7 @@ public class IrsTest extends AppTests {
}

@Test
public void test5(){
public void test5() {
CloseableHttpResponse response = null;
try {
String api = "/media/download";
@@ -191,7 +196,7 @@ public class IrsTest extends AppTests {
fos.close();
} catch (Exception e) {
System.out.println(e);
}finally {
} finally {
if (response != null) {
try {
//特别提醒:需要调用response的close方法关闭网络连接!!!
@@ -206,6 +211,7 @@ public class IrsTest extends AppTests {
private static ExecutableClient zwddExecutableClient;
@Autowired
private ZwddIntegrationProperties zwddProperties;

public ExecutableClient getZwddExecutableClient() {
if (Objects.isNull(zwddExecutableClient)) {
synchronized (ZwddAuthClientProvider.class) {
@@ -224,4 +230,5 @@ public class IrsTest extends AppTests {
}
return zwddExecutableClient;
}

}

+ 5
- 0
pmapi/src/test/resources/application-dev.yml Ver fichero

@@ -206,6 +206,11 @@ provincial:
#天印服务器接口信息
irs:
is-search-app: false
digital-resource-indicators:
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm
interfaceName: 99E2bic31KdXzaa7
app-key: A331101453557202109017383
app-secret: 496f0f2a19994f76b4fd9dae087366c7
seal-platform:
project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a


+ 6
- 1
pmapi/src/test/resources/application-pre.yml Ver fichero

@@ -145,7 +145,7 @@ flowable:
async-executor-activate: true
#关闭一些不需要的功能服务
rest-api-enabled: false
# database-schema-update: false
# database-schema-update: false
idm:
enabled: false
common:
@@ -209,6 +209,11 @@ provincial:
#天印服务器接口信息
irs:
is-search-app: true
digital-resource-indicators:
url: https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/99E2bic31KdXzaa7.htm
interfaceName: 99E2bic31KdXzaa7
app-key: A331101453557202109017383
app-secret: 496f0f2a19994f76b4fd9dae087366c7
seal-platform:
project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a


Cargando…
Cancelar
Guardar