Browse Source

Merge remote-tracking branch 'origin/expert_invite' into dev

# Conflicts:
#	pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
master
WendyYang 1 year ago
parent
commit
381ca8c346
26 changed files with 236 additions and 91 deletions
  1. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/common/model/ReqRegionDTO.java
  2. +7
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/ApplicationController.java
  3. +4
    -6
      pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/IrsController.java
  4. +80
    -36
      pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java
  5. +2
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/RandomInviteRuleDTO.java
  6. +5
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java
  7. +4
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java
  8. +4
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java
  9. +0
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java
  10. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java
  11. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java
  12. +5
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java
  13. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java
  14. +2
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java
  15. +23
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  16. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java
  17. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  18. +3
    -3
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
  19. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/staging/utils/ProjectStatusFlowUtil.java
  20. +21
    -13
      pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java
  21. +5
    -0
      pmapi/src/main/resources/application-dev.yml
  22. +5
    -0
      pmapi/src/main/resources/application-pre.yml
  23. +5
    -0
      pmapi/src/main/resources/application-prod.yml
  24. +16
    -9
      pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest.java
  25. +5
    -0
      pmapi/src/test/resources/application-dev.yml
  26. +6
    -1
      pmapi/src/test/resources/application-pre.yml

+ 20
- 0
pmapi/src/main/java/com/ningdatech/pmapi/common/model/ReqRegionDTO.java View File

@@ -0,0 +1,20 @@
package com.ningdatech.pmapi.common.model;

import lombok.Data;

/**
* <p>
* ReqRegionDTO
* </p>
*
* @author WendyYang
* @since 2023/8/4
**/
@Data
public class ReqRegionDTO {

private String regionCode;

private Integer regionLevel;

}

+ 7
- 3
pmapi/src/main/java/com/ningdatech/pmapi/irs/controller/ApplicationController.java View File

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


import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ningdatech.log.annotation.WebLog; import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.irs.manage.AppIrsManage; import com.ningdatech.pmapi.irs.manage.AppIrsManage;
import com.ningdatech.pmapi.irs.model.dto.ApiApplyDTO; 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.dto.PushProjectAppToIrsDTO;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;

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


/** /**
* @Classname ApplicationController * @Classname ApplicationController
@@ -45,4 +43,10 @@ public class ApplicationController {
public JSONArray searchApps(ApiApplyDTO apply) throws NoSuchAlgorithmException { public JSONArray searchApps(ApiApplyDTO apply) throws NoSuchAlgorithmException {
return appIrsManage.searchApps(apply); 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 View File

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


import com.ningdatech.log.annotation.WebLog; 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.manage.IrsManage;
import com.ningdatech.pmapi.projectdeclared.model.vo.IrsApplicationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.IrsApplicationVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.PiotTasksVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PiotTasksVO;
@@ -11,10 +8,11 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; 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.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;


+ 80
- 36
pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java View File

@@ -9,12 +9,13 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.function.VUtils;
import com.ningdatech.irs.service.IRefreshTokenService; import com.ningdatech.irs.service.IRefreshTokenService;
import com.ningdatech.pmapi.common.enumeration.CommonEnum; 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.statemachine.util.StateMachineUtils;
import com.ningdatech.pmapi.common.util.CryptUtils; import com.ningdatech.pmapi.common.util.CryptUtils;
import com.ningdatech.pmapi.common.util.HttpUtil; import com.ningdatech.pmapi.common.util.HttpUtil;
import com.ningdatech.pmapi.common.util.RefreshKeyUtil; 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.irs.model.res.ApiResponse;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO; import com.ningdatech.pmapi.projectlib.model.dto.ProjectDTO;
import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.Project;
@@ -34,7 +35,6 @@ import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@@ -93,8 +93,23 @@ public class AppIrsManage {
@Value("${irs.push-project-detail.appSecret}") @Value("${irs.push-project-detail.appSecret}")
private String pushProjectAppSecret; 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 * @param dto
* @return * @return
* @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
@@ -112,14 +127,14 @@ public class AppIrsManage {
ApiApplyDTO apiApply = new ApiApplyDTO(); ApiApplyDTO apiApply = new ApiApplyDTO();
apiApply.setAppId(appCode); apiApply.setAppId(appCode);
JSONObject jsonObject = this.searchApp(apiApply); 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不存在!"); VUtils.isTrue(Objects.isNull(apiApplySearchResult)).throwMessage("应用在IRS不存在!");


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


ApiResponse body = forEntity.getBody(); 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; return Boolean.FALSE;
} }


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


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


/** /**
* 查询app * 查询app
*
* @param apply * @param apply
* @return * @return
* @throws NoSuchAlgorithmException * @throws NoSuchAlgorithmException
@@ -184,27 +200,27 @@ public class AppIrsManage {
"&appKey=" + searchAppKey + "&" + "&appKey=" + searchAppKey + "&" +
"pageSize=10&pageNum=1&appCode=" + appCode + "pageSize=10&pageNum=1&appCode=" + appCode +
"&areaCode=&deptCode=&name="; "&areaCode=&deptCode=&name=";
log.info("url : {}",url);
log.info("url : {}", url);
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); 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()); JSONObject body = JSON.parseObject(forEntity.getBody());
if(Objects.isNull(body)){
if (Objects.isNull(body)) {
return null; return null;
} }
JSONObject datas = body.getJSONObject("datas"); JSONObject datas = body.getJSONObject("datas");
if(Objects.isNull(datas)){
if (Objects.isNull(datas)) {
return null; return null;
} }
JSONObject data = datas.getJSONObject("data"); JSONObject data = datas.getJSONObject("data");
if(Objects.isNull(data)){
if (Objects.isNull(data)) {
return null; return null;
} }
JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult"); JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult");
if(CollUtil.isEmpty(apiApplySearchResult)){
if (CollUtil.isEmpty(apiApplySearchResult)) {
return null; return null;
} }
return apiApplySearchResult.getJSONObject(0); return apiApplySearchResult.getJSONObject(0);
@@ -225,19 +241,19 @@ public class AppIrsManage {
RestTemplate restTemplate = new RestTemplate(); RestTemplate restTemplate = new RestTemplate();
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); 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()); JSONObject body = JSON.parseObject(forEntity.getBody());
if(Objects.isNull(body)){
if (Objects.isNull(body)) {
return null; return null;
} }
JSONObject datas = body.getJSONObject("datas"); JSONObject datas = body.getJSONObject("datas");
if(Objects.isNull(datas)){
if (Objects.isNull(datas)) {
return null; return null;
} }
JSONObject data = datas.getJSONObject("data"); JSONObject data = datas.getJSONObject("data");
if(Objects.isNull(data)){
if (Objects.isNull(data)) {
return null; return null;
} }
JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult"); JSONArray apiApplySearchResult = data.getJSONArray("apiApplySearchResult");
@@ -252,14 +268,14 @@ public class AppIrsManage {
String appKey = "A331101453557202109017383"; String appKey = "A331101453557202109017383";
String method = "POST"; String method = "POST";
String interfaceName = "5crv7i4727abLCv0"; 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); String sign = MD5.create().digestHex(appKey + secret + timestamp);
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory();
RestTemplate restTemplate; RestTemplate restTemplate;
if(Objects.nonNull(factory)){
if (Objects.nonNull(factory)) {
restTemplate = new RestTemplate(factory); restTemplate = new RestTemplate(factory);
}else{
} else {
restTemplate = new RestTemplate(); restTemplate = new RestTemplate();
} }
String appId = "A330000100000202105005790"; String appId = "A330000100000202105005790";
@@ -269,7 +285,7 @@ public class AppIrsManage {
"&sign=" + sign + "&appKey=" + appKey + "&sign=" + sign + "&appKey=" + appKey +
"&capCode=" + capCode + "&capTime=" + timestamp + "&capCode=" + capCode + "&capTime=" + timestamp +
"&appId=" + appId; "&appId=" + appId;
log.info("url :{}",url);
log.info("url :{}", url);
ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class); ResponseEntity<String> forEntity = restTemplate.getForEntity(url, String.class);
log.info(forEntity.getBody()); log.info(forEntity.getBody());
return forEntity.getBody(); return forEntity.getBody();
@@ -277,6 +293,7 @@ public class AppIrsManage {


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


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

} }

+ 2
- 5
pmapi/src/main/java/com/ningdatech/pmapi/meeting/entity/dto/RandomInviteRuleDTO.java View File

@@ -1,5 +1,6 @@
package com.ningdatech.pmapi.meeting.entity.dto; package com.ningdatech.pmapi.meeting.entity.dto;


import com.ningdatech.pmapi.common.model.ReqRegionDTO;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@@ -30,11 +31,7 @@ public class RandomInviteRuleDTO extends AbstractInviteRule {
@ApiModelProperty("履职意向地层级") @ApiModelProperty("履职意向地层级")
private Integer intentionRegionLevel; private Integer intentionRegionLevel;


@ApiModelProperty("专家层级编码")
private String expertRegionCode;

@ApiModelProperty("专家层级级别")
private Integer expertRegionLevel;
private List<ReqRegionDTO> expertRegionList;


@ApiModelProperty("专家标签") @ApiModelProperty("专家标签")
private List<ExpertTagChooseDTO> expertTags; private List<ExpertTagChooseDTO> expertTags;


+ 5
- 3
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/ExpertInviteManage.java View File

@@ -123,9 +123,11 @@ public class ExpertInviteManage {
* @param rule 随机邀请规则 * @param rule 随机邀请规则
*/ */
private static void addRegionLimit(LambdaQueryWrapper<ExpertUserFullInfo> query, RandomInviteRuleDTO rule) { private static void addRegionLimit(LambdaQueryWrapper<ExpertUserFullInfo> query, RandomInviteRuleDTO rule) {
if (ObjectUtils.allNotNull(rule.getExpertRegionCode(), rule.getExpertRegionLevel())) {
query.eq(ExpertUserFullInfo::getRegionCode, rule.getExpertRegionCode());
query.eq(ExpertUserFullInfo::getRegionLevel, rule.getExpertRegionLevel());
if (CollUtil.isNotEmpty(rule.getExpertRegionList())) {
String inSqlParam = rule.getExpertRegionList().stream()
.map(w -> "('" + w.getRegionCode() + "'," + w.getRegionLevel() + ")")
.collect(Collectors.joining(",", "(", ")"));
query.apply("(region_code, region_level) in " + inSqlParam);
} }
} }




+ 4
- 3
pmapi/src/main/java/com/ningdatech/pmapi/meeting/manage/MeetingManage.java View File

@@ -586,9 +586,10 @@ public class MeetingManage {
List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel()); List<RegionDTO> intentionRegions = regionCache.listParents(randomRule.getIntentionRegionCode(), randomRule.getIntentionRegionLevel());
randomRule.setIntentionRegions(intentionRegions); randomRule.setIntentionRegions(intentionRegions);
} }
if (StrUtil.isNotEmpty(randomRule.getExpertRegionCode())) {
List<RegionDTO> expertRegions = regionCache.listParents(randomRule.getExpertRegionCode(), randomRule.getExpertRegionLevel());
randomRule.setExpertRegions(expertRegions);
if (CollUtil.isNotEmpty(randomRule.getExpertRegionList())) {
List<RegionDTO> regions = CollUtils.convert(randomRule.getExpertRegions(),
w -> regionCache.getByCodeAndLevel(w.getRegionCode(), w.getRegionLevel()));
randomRule.setExpertRegions(regions);
} }
result.getRandomRules().add(randomRule); result.getRandomRules().add(randomRule);
}); });


+ 4
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/FinalAcceptanceManage.java View File

@@ -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, 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, noticeManage.sendFirtUser(projectInfo,model.getFormName(),instanceId,


+ 0
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ReviewByDeptJointManage.java View File

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


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


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


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ConstructionPlanReviewHandle.java View File

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


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/DeptUnitedReviewHandle.java View File

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


+ 5
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/PreliminaryPreviewHandle.java View File

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


+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/ProjectFinalInspectionHandle.java View File

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




+ 2
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/handle/UnitInnerAuditHandle.java View File

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


+ 23
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

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


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

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


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

if (projectService.save(project)) { if (projectService.save(project)) {
projectService.update(Wrappers.lambdaUpdate(Project.class) projectService.update(Wrappers.lambdaUpdate(Project.class)
.set(Project::getNewest, Boolean.FALSE) .set(Project::getNewest, Boolean.FALSE)
@@ -548,7 +558,7 @@ public class ProjectLibManage {
return project; 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(); Project project = new Project();
VUtils.isTrue(Objects.isNull(oldProject)) VUtils.isTrue(Objects.isNull(oldProject))
.throwMessage("项目不存在!"); .throwMessage("项目不存在!");
@@ -560,9 +570,13 @@ public class ProjectLibManage {
project.setCreateOn(LocalDateTime.now()); project.setCreateOn(LocalDateTime.now());
project.setUpdateOn(LocalDateTime.now()); project.setUpdateOn(LocalDateTime.now());
// 标识保存的项目信息是否为建设方案申报项目 // 标识保存的项目信息是否为建设方案申报项目
project.setIsConstruct(Boolean.TRUE);
project.setIsConstruct(Boolean.FALSE);
project.setIsBackReject(isBackReject);
stateMachineUtils.pass(project); stateMachineUtils.pass(project);


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

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


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

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


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


if (CollUtil.isEmpty(historyProjects)) { if (CollUtil.isEmpty(historyProjects)) {


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

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


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

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

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

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


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

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

} }

+ 3
- 3
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java View File

@@ -2,11 +2,9 @@ package com.ningdatech.pmapi.projectlib.model.vo;


import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.util.BizUtils; import com.ningdatech.pmapi.common.util.BizUtils;
import com.ningdatech.pmapi.portrait.model.vo.TagVO; import com.ningdatech.pmapi.portrait.model.vo.TagVO;
import com.ningdatech.pmapi.projectdeclared.model.entity.Contract;
import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO; import com.ningdatech.pmapi.projectdeclared.model.vo.ContractVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO; import com.ningdatech.pmapi.projectdeclared.model.vo.OperationVO;
import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO; import com.ningdatech.pmapi.projectdeclared.model.vo.PreInsAcceptancePersonVO;
@@ -21,7 +19,6 @@ import lombok.Data;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;


import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@@ -402,6 +399,9 @@ public class ProjectDetailVO {
@ApiModelProperty("审批详情") @ApiModelProperty("审批详情")
private ProcessProgressDetailVo process; private ProcessProgressDetailVo process;


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

@ApiModelProperty("标签") @ApiModelProperty("标签")
private List<TagVO> tags; private List<TagVO> tags;




+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/staging/utils/ProjectStatusFlowUtil.java View File

@@ -31,6 +31,7 @@ public class ProjectStatusFlowUtil {
* value: lambda表达式,最终会获取发起实例的函数 * value: lambda表达式,最终会获取发起实例的函数
*/ */
public ProjectStatusFlowUtil(){ public ProjectStatusFlowUtil(){
intervalTimeMap.put(0,60);
intervalTimeMap.put(1,60 * 2); intervalTimeMap.put(1,60 * 2);
intervalTimeMap.put(2,60 * 6); intervalTimeMap.put(2,60 * 6);
intervalTimeMap.put(3,60 * 15); intervalTimeMap.put(3,60 * 15);


+ 21
- 13
pmapi/src/main/java/com/ningdatech/pmapi/todocenter/manage/TodoCenterManage.java View File

@@ -653,10 +653,7 @@ public class TodoCenterManage {
List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class) List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList) .in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId)); .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()); 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) List<ProjectInst> projectInstList = projectInstService.list(Wrappers.lambdaQuery(ProjectInst.class)
.in(ProjectInst::getProjectId, projectIdList) .in(ProjectInst::getProjectId, projectIdList)
.orderByDesc(ProjectInst::getProjectId)); .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()); List<String> instCodes = projectInstList.stream().map(ProjectInst::getInstCode).collect(Collectors.toList());


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


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

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


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


ProjectInst newPi = new ProjectInst(); ProjectInst newPi = new ProjectInst();
@@ -1142,6 +1139,9 @@ public class TodoCenterManage {
.eq(ProjectApplication::getIsConstruct, Boolean.TRUE)); .eq(ProjectApplication::getIsConstruct, Boolean.TRUE));
if (CollUtil.isNotEmpty(applicationList)) { if (CollUtil.isNotEmpty(applicationList)) {
projectApplicationService.removeBatchByIds(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(); List<ProjectApplicationDTO> applications = projectDto.getApplicationList();
@@ -1159,11 +1159,19 @@ public class TodoCenterManage {
!InstTypeEnum.DEPT_UNITED_REVIEW.getCode().equals(instType)) { !InstTypeEnum.DEPT_UNITED_REVIEW.getCode().equals(instType)) {
projectApplication.setIsConstruct(Boolean.TRUE); projectApplication.setIsConstruct(Boolean.TRUE);
} }
if(StringUtils.isNotBlank(application.getRelatedExistsApplication())){
projectApplication.setApplicationName(null);
}
projectApplication.setProjectVersion(project.getVersion()); 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; return Boolean.TRUE;


+ 5
- 0
pmapi/src/main/resources/application-dev.yml View File

@@ -206,6 +206,11 @@ provincial:
#天印服务器接口信息 #天印服务器接口信息
irs: irs:
is-search-app: false 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: seal-platform:
project-id: 330001110 project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a project-secret: 70e512d40c8f440484db4acab181570a


+ 5
- 0
pmapi/src/main/resources/application-pre.yml View File

@@ -209,6 +209,11 @@ provincial:
#天印服务器接口信息 #天印服务器接口信息
irs: irs:
is-search-app: true 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: seal-platform:
project-id: 330001110 project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a project-secret: 70e512d40c8f440484db4acab181570a


+ 5
- 0
pmapi/src/main/resources/application-prod.yml View File

@@ -209,6 +209,11 @@ provincial:
#天印服务器接口信息 #天印服务器接口信息
irs: irs:
is-search-app: true 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: seal-platform:
project-id: 330001110 project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a project-secret: 70e512d40c8f440484db4acab181570a


+ 16
- 9
pmapi/src/test/java/com/ningdatech/pmapi/irs/IrsTest.java View File

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

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


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


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


@Test @Test
public void test1(){
public void test1() {
String method = "GET"; String method = "GET";
String url = "https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020230427000001/irs-res-bill/report/pdfUrl" + String url = "https://bcdsg.zj.gov.cn:8443/restapi/prod/IC33000020230427000001/irs-res-bill/report/pdfUrl" +
"?appCode=A331101453557202109017383"; "?appCode=A331101453557202109017383";
@@ -53,14 +58,14 @@ public class IrsTest extends AppTests {
//请求头 //请求头
HttpHeaders headers = new HttpHeaders(); 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()); headers.add(entry.getKey(), entry.getValue());
} }
//封装请求头 //封装请求头
HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers); HttpEntity<MultiValueMap<String, Object>> formEntity = new HttpEntity<MultiValueMap<String, Object>>(headers);


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


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


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

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

} }

+ 5
- 0
pmapi/src/test/resources/application-dev.yml View File

@@ -206,6 +206,11 @@ provincial:
#天印服务器接口信息 #天印服务器接口信息
irs: irs:
is-search-app: false 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: seal-platform:
project-id: 330001110 project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a project-secret: 70e512d40c8f440484db4acab181570a


+ 6
- 1
pmapi/src/test/resources/application-pre.yml View File

@@ -145,7 +145,7 @@ flowable:
async-executor-activate: true async-executor-activate: true
#关闭一些不需要的功能服务 #关闭一些不需要的功能服务
rest-api-enabled: false rest-api-enabled: false
# database-schema-update: false
# database-schema-update: false
idm: idm:
enabled: false enabled: false
common: common:
@@ -209,6 +209,11 @@ provincial:
#天印服务器接口信息 #天印服务器接口信息
irs: irs:
is-search-app: true 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: seal-platform:
project-id: 330001110 project-id: 330001110
project-secret: 70e512d40c8f440484db4acab181570a project-secret: 70e512d40c8f440484db4acab181570a


Loading…
Cancel
Save