@@ -1,6 +1,9 @@ | |||||
package com.ningdatech.pmapi.ding.controller; | package com.ningdatech.pmapi.ding.controller; | ||||
import cn.hutool.core.util.StrUtil; | |||||
import cn.hutool.crypto.SecureUtil; | |||||
import com.ningdatech.irs.service.IRefreshTokenService; | import com.ningdatech.irs.service.IRefreshTokenService; | ||||
import com.ningdatech.pmapi.common.config.ProvincialProperties; | |||||
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.ding.task.EmployeeBatchGetTask; | import com.ningdatech.pmapi.ding.task.EmployeeBatchGetTask; | ||||
@@ -12,7 +15,9 @@ import com.ningdatech.zwdd.client.provider.ZwddAuthClientProvider; | |||||
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.beans.factory.annotation.Autowired; | |||||
import org.springframework.beans.factory.annotation.Value; | import org.springframework.beans.factory.annotation.Value; | ||||
import org.springframework.http.HttpMethod; | |||||
import org.springframework.http.ResponseEntity; | import org.springframework.http.ResponseEntity; | ||||
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; | import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; | ||||
import org.springframework.web.bind.annotation.*; | import org.springframework.web.bind.annotation.*; | ||||
@@ -52,6 +57,9 @@ public class DingInfoPullController { | |||||
private final ZwddIntegrationProperties zwddIntegrationProperties; | private final ZwddIntegrationProperties zwddIntegrationProperties; | ||||
@Autowired | |||||
private ProvincialProperties provincialProperties; | |||||
@GetMapping("/employee") | @GetMapping("/employee") | ||||
public void employeeBatchGet() { | public void employeeBatchGet() { | ||||
employeeBatchGetTask.batchGetEmployeeTask(); | employeeBatchGetTask.batchGetEmployeeTask(); | ||||
@@ -112,12 +120,12 @@ public class DingInfoPullController { | |||||
@ApiOperation(value = "省级主管接口测试", notes = "省级主管接口测试") | @ApiOperation(value = "省级主管接口测试", notes = "省级主管接口测试") | ||||
@GetMapping("/test-org") | @GetMapping("/test-org") | ||||
public String testOrg() throws NoSuchAlgorithmException { | public String testOrg() throws NoSuchAlgorithmException { | ||||
long timestamp = System.currentTimeMillis(); | |||||
Long timeStamp = System.currentTimeMillis(); | |||||
String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; | String appSecret = "496f0f2a19994f76b4fd9dae087366c7"; | ||||
String appKey = "A331101453557202109017383"; | String appKey = "A331101453557202109017383"; | ||||
String method = "POST"; | String method = "POST"; | ||||
String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,method); | String secret = refreshTokenService.refreshToken(appKey,appSecret,govRequestTokenUrl,govRefreshTokenUrl,method); | ||||
String sign = CryptUtils.MD5Encode(appKey + secret + timestamp); | |||||
String sign = CryptUtils.MD5Encode(appKey + secret + timeStamp); | |||||
HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); | HttpComponentsClientHttpRequestFactory factory = HttpUtil.generateHttpRequestFactory(); | ||||
RestTemplate restTemplate; | RestTemplate restTemplate; | ||||
if(Objects.nonNull(factory)){ | if(Objects.nonNull(factory)){ | ||||
@@ -128,10 +136,10 @@ public class DingInfoPullController { | |||||
String url = "https://interface.zjzwfw.gov.cn/gateway" + | String url = "https://interface.zjzwfw.gov.cn/gateway" + | ||||
"/api/proxy/001003001029/dataSharing/62vd5jAdM0b7Gr00.htm?" + | "/api/proxy/001003001029/dataSharing/62vd5jAdM0b7Gr00.htm?" + | ||||
"requestTime=" + timestamp + "&sign=" + sign + | |||||
"&appKey=" + appKey + "×tamp=" + timestamp + | |||||
"&authSignature=" + zwddIntegrationProperties.getAppSecret() + | |||||
"&authKey=" + zwddIntegrationProperties.getAppKey(); | |||||
"requestTime=" + timeStamp + "&sign=" + sign + | |||||
"&appKey=" + appKey + "×tamp=" + timeStamp + | |||||
"&authSignature=" + getSha256(timeStamp/1000,provincialProperties.getPushUrl(), HttpMethod.GET.name()) + | |||||
"&authKey=" + provincialProperties.getKey(); | |||||
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()); | ||||
@@ -158,7 +166,7 @@ public class DingInfoPullController { | |||||
} | } | ||||
String appId = "A330000100000202105005790"; | String appId = "A330000100000202105005790"; | ||||
String updateTime = "2023-07-26 00:00:00"; | String updateTime = "2023-07-26 00:00:00"; | ||||
String capCode = timestamp + updateTime + appId; | |||||
String capCode = CryptUtils.MD5Encode(timestamp + updateTime + appId); | |||||
String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/" + | String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/" + | ||||
"dataSharing/5crv7i4727abLCv0.htm?requestTime=" + timestamp + | "dataSharing/5crv7i4727abLCv0.htm?requestTime=" + timestamp + | ||||
"&sign=" + sign + "&appKey=" + appKey + | "&sign=" + sign + "&appKey=" + appKey + | ||||
@@ -169,4 +177,14 @@ public class DingInfoPullController { | |||||
log.info(forEntity.getBody()); | log.info(forEntity.getBody()); | ||||
return forEntity.getBody(); | return forEntity.getBody(); | ||||
} | } | ||||
private String getSha256(Long timeStamp,String url,String method){ | |||||
String secret = provincialProperties.getSecret(); | |||||
String key = provincialProperties.getKey(); | |||||
String bytesToSign = method + StrUtil.LF + url + StrUtil.LF + timeStamp + StrUtil.LF + key; | |||||
log.info("加密message :{}",bytesToSign); | |||||
String res = SecureUtil.hmacSha256(secret).digestBase64(bytesToSign,false); | |||||
log.info("加密结果 :{}",res); | |||||
return res; | |||||
} | |||||
} | } |
@@ -302,6 +302,9 @@ public class ProjectDraft implements Serializable { | |||||
@ApiModelProperty("项目申报书") | @ApiModelProperty("项目申报书") | ||||
private String projectApplicationForm; | private String projectApplicationForm; | ||||
@ApiModelProperty("项目编码") | |||||
private String projectCode; | |||||
private Long createBy; | private Long createBy; | ||||
private Long updateBy; | private Long updateBy; | ||||
} | } |
@@ -275,10 +275,10 @@ public class ProjectLibManage { | |||||
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | ||||
? Boolean.TRUE : Boolean.FALSE; | ? Boolean.TRUE : Boolean.FALSE; | ||||
//采取批量删除 批量添加的方式 | //采取批量删除 批量添加的方式 | ||||
Integer version = Objects.nonNull(project.getVersion()) ? project.getVersion() : 1; | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | ||||
.eq(ProjectApplication::getProjectId,project.getId())); | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode,project.getProjectCode())); | |||||
.eq(ProjectApplication::getProjectCode,project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion,version)); | |||||
if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | ||||
Project finalProject = project; | Project finalProject = project; | ||||
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | ||||
@@ -289,6 +289,7 @@ public class ProjectLibManage { | |||||
projectApplication.setProjectCode(finalProject.getProjectCode()); | projectApplication.setProjectCode(finalProject.getProjectCode()); | ||||
projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); | projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); | ||||
projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); | projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); | ||||
projectApplication.setProjectVersion(version); | |||||
return projectApplication; | return projectApplication; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
projectApplicationService.saveOrUpdateBatch(applications); | projectApplicationService.saveOrUpdateBatch(applications); | ||||
@@ -358,14 +359,9 @@ public class ProjectLibManage { | |||||
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && CommonEnum.YES.getCode().equals(projectDto.getIncludeApplication()) | ||||
? Boolean.TRUE : Boolean.FALSE; | ? Boolean.TRUE : Boolean.FALSE; | ||||
//采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息 | //采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息 | ||||
//采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息 | |||||
List<String> projectCodeList = projectService.list(Wrappers.lambdaQuery(Project.class) | |||||
.eq(Project::getProjectCode, project.getProjectCode()) | |||||
.eq(Project::getIsConstruct, Boolean.TRUE)).stream() | |||||
.map(Project::getProjectCode).collect(Collectors.toList()); | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | ||||
.eq(ProjectApplication::getProjectCode,project.getProjectCode()) | .eq(ProjectApplication::getProjectCode,project.getProjectCode()) | ||||
.in(CollUtil.isNotEmpty(projectCodeList),ProjectApplication::getProjectCode,projectCodeList) | |||||
.eq(ProjectApplication::getProjectVersion,project.getVersion()) | |||||
.eq(ProjectApplication::getIsConstruct,Boolean.TRUE)); | .eq(ProjectApplication::getIsConstruct,Boolean.TRUE)); | ||||
if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | ||||
@@ -379,6 +375,7 @@ public class ProjectLibManage { | |||||
projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); | projectApplication.setBuildOrgCode(finalProject.getBuildOrgCode()); | ||||
projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); | projectApplication.setBuildOrgName(finalProject.getBuildOrgName()); | ||||
projectApplication.setIsConstruct(Boolean.TRUE); | projectApplication.setIsConstruct(Boolean.TRUE); | ||||
projectApplication.setProjectVersion(finalProject.getVersion()); | |||||
return projectApplication; | return projectApplication; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
projectApplicationService.saveBatch(applications); | projectApplicationService.saveBatch(applications); | ||||
@@ -406,9 +403,8 @@ public class ProjectLibManage { | |||||
? Boolean.TRUE : Boolean.FALSE; | ? Boolean.TRUE : Boolean.FALSE; | ||||
//采取批量删除 批量添加的方式 | //采取批量删除 批量添加的方式 | ||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | ||||
.eq(ProjectApplication::getProjectId,project.getId())); | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode,project.getProjectCode())); | |||||
.eq(ProjectApplication::getProjectCode,project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion,project.getVersion())); | |||||
if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | if (isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())) { | ||||
Project finalProject = project; | Project finalProject = project; | ||||
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | ||||
@@ -417,6 +413,7 @@ public class ProjectLibManage { | |||||
projectApplication.setId(null); | projectApplication.setId(null); | ||||
projectApplication.setProjectId(finalProject.getId()); | projectApplication.setProjectId(finalProject.getId()); | ||||
projectApplication.setProjectCode(finalProject.getProjectCode()); | projectApplication.setProjectCode(finalProject.getProjectCode()); | ||||
projectApplication.setProjectVersion(finalProject.getVersion()); | |||||
return projectApplication; | return projectApplication; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
projectApplicationService.saveOrUpdateBatch(applications); | projectApplicationService.saveOrUpdateBatch(applications); | ||||
@@ -490,7 +487,8 @@ public class ProjectLibManage { | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | ||||
.eq(ProjectApplication::getProjectCode,project.getProjectCode()) | .eq(ProjectApplication::getProjectCode,project.getProjectCode()) | ||||
.in(CollUtil.isNotEmpty(projectCodeList),ProjectApplication::getProjectCode,projectCodeList) | .in(CollUtil.isNotEmpty(projectCodeList),ProjectApplication::getProjectCode,projectCodeList) | ||||
.eq(ProjectApplication::getIsConstruct,isConstruct)); | |||||
.eq(ProjectApplication::getIsConstruct,isConstruct) | |||||
.eq(ProjectApplication::getProjectVersion,project.getVersion())); | |||||
//app | //app | ||||
List<ProjectApplicationDTO> applicationList = projecDto.getApplicationList(); | List<ProjectApplicationDTO> applicationList = projecDto.getApplicationList(); | ||||
@@ -503,6 +501,7 @@ public class ProjectLibManage { | |||||
app.setBuildOrgName(project.getBuildOrgName()); | app.setBuildOrgName(project.getBuildOrgName()); | ||||
app.setBuildOrgCode(project.getBuildOrgCode()); | app.setBuildOrgCode(project.getBuildOrgCode()); | ||||
app.setIsConstruct(isConstruct); | app.setIsConstruct(isConstruct); | ||||
app.setProjectVersion(project.getVersion()); | |||||
return app; | return app; | ||||
}) | }) | ||||
.collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
@@ -546,9 +545,8 @@ public class ProjectLibManage { | |||||
//app | //app | ||||
//采取批量删除 批量添加的方式 | //采取批量删除 批量添加的方式 | ||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | ||||
.eq(ProjectApplication::getProjectId,project.getId())); | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode,project.getProjectCode())); | |||||
.eq(ProjectApplication::getProjectCode,project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion,project.getVersion())); | |||||
List<ProjectApplicationDTO> applicationList = projecDto.getApplicationList(); | List<ProjectApplicationDTO> applicationList = projecDto.getApplicationList(); | ||||
if(CollUtil.isNotEmpty(applicationList)){ | if(CollUtil.isNotEmpty(applicationList)){ | ||||
@@ -560,6 +558,7 @@ public class ProjectLibManage { | |||||
app.setProjectCode(project.getProjectCode()); | app.setProjectCode(project.getProjectCode()); | ||||
app.setBuildOrgName(project.getBuildOrgName()); | app.setBuildOrgName(project.getBuildOrgName()); | ||||
app.setBuildOrgCode(project.getBuildOrgCode()); | app.setBuildOrgCode(project.getBuildOrgCode()); | ||||
app.setProjectVersion(project.getVersion()); | |||||
return app; | return app; | ||||
}) | }) | ||||
.collect(Collectors.toList()); | .collect(Collectors.toList()); | ||||
@@ -685,7 +684,8 @@ public class ProjectLibManage { | |||||
// 查询应用 | // 查询应用 | ||||
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | ||||
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) | .eq(ProjectApplication::getProjectCode, vo.getProjectCode()) | ||||
.eq(ProjectApplication::getIsConstruct,projectInfo.getIsConstruct())); | |||||
.eq(ProjectApplication::getIsConstruct,projectInfo.getIsConstruct()) | |||||
.eq(ProjectApplication::getProjectVersion,projectInfo.getVersion())); | |||||
Optional.ofNullable(applications).ifPresent(apps -> | Optional.ofNullable(applications).ifPresent(apps -> | ||||
vo.setProjectApplications(CollUtils.convert(apps, | vo.setProjectApplications(CollUtils.convert(apps, | ||||
@@ -774,7 +774,8 @@ public class ProjectLibManage { | |||||
// 查询应用 | // 查询应用 | ||||
List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | List<ProjectApplication> applications = applicationService.list(Wrappers.lambdaQuery(ProjectApplication.class) | ||||
.eq(ProjectApplication::getProjectCode, vo.getProjectCode()) | .eq(ProjectApplication::getProjectCode, vo.getProjectCode()) | ||||
.eq(ProjectApplication::getIsConstruct,projectInfo.getIsConstruct())); | |||||
.eq(ProjectApplication::getIsConstruct,projectInfo.getIsConstruct()) | |||||
.eq(ProjectApplication::getProjectVersion,projectInfo.getVersion())); | |||||
Optional.ofNullable(applications).ifPresent(apps -> | Optional.ofNullable(applications).ifPresent(apps -> | ||||
vo.setProjectApplications(CollUtils.convert(apps, | vo.setProjectApplications(CollUtils.convert(apps, | ||||
@@ -182,6 +182,9 @@ public class ProjectApplication implements Serializable { | |||||
@ApiModelProperty("项目编码") | @ApiModelProperty("项目编码") | ||||
private String projectCode; | private String projectCode; | ||||
@ApiModelProperty("项目版本") | |||||
private Integer projectVersion; | |||||
@ApiModelProperty("是否为建设方案申报") | @ApiModelProperty("是否为建设方案申报") | ||||
private Boolean isConstruct; | private Boolean isConstruct; | ||||
} | } |
@@ -174,6 +174,9 @@ public class ProjectApplicationVO implements Serializable { | |||||
@ApiModelProperty("项目编码") | @ApiModelProperty("项目编码") | ||||
private String projectCode; | private String projectCode; | ||||
@ApiModelProperty("项目版本") | |||||
private Integer projectVersion; | |||||
private Long createBy; | private Long createBy; | ||||
private Long updateBy; | private Long updateBy; | ||||
@@ -11,6 +11,7 @@ import java.util.stream.Stream; | |||||
import javax.servlet.http.HttpServletResponse; | import javax.servlet.http.HttpServletResponse; | ||||
import cn.hutool.core.bean.copier.CopyOptions; | |||||
import cn.hutool.core.map.MapUtil; | import cn.hutool.core.map.MapUtil; | ||||
import cn.hutool.core.util.ObjectUtil; | import cn.hutool.core.util.ObjectUtil; | ||||
import com.ningdatech.basic.exception.BizException; | import com.ningdatech.basic.exception.BizException; | ||||
@@ -1052,7 +1053,7 @@ public class TodoCenterManage { | |||||
defaultDeclaredProjectManage.checkAmount(projectDto); | defaultDeclaredProjectManage.checkAmount(projectDto); | ||||
//修改项目内容 | //修改项目内容 | ||||
if(!modifyProject(projectDto)){ | |||||
if(!modifyProject(projectDto,projectInfo)){ | |||||
throw new BusinessException("调整项目失败!"); | throw new BusinessException("调整项目失败!"); | ||||
} | } | ||||
@@ -1070,42 +1071,60 @@ public class TodoCenterManage { | |||||
return dto.getInstanceId(); | return dto.getInstanceId(); | ||||
} | } | ||||
private Boolean modifyProject(ProjectDTO projectDto) { | |||||
/** | |||||
* 要改成 生成新版本号 | |||||
* @param projectDto | |||||
* @return | |||||
*/ | |||||
private Boolean modifyProject(ProjectDTO projectDto,Project oldProject) { | |||||
//先修改项目信息 | //先修改项目信息 | ||||
Project project = new Project(); | Project project = new Project(); | ||||
BeanUtils.copyProperties(projectDto,project); | |||||
VUtils.isTrue(Objects.isNull(oldProject)) | |||||
.throwMessage("项目不存在!"); | |||||
BeanUtil.copyProperties(oldProject,project, CopyOptions.create() | |||||
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); | |||||
BeanUtil.copyProperties(projectDto,project, CopyOptions.create() | |||||
.setIgnoreError(Boolean.TRUE).setIgnoreNullValue(Boolean.TRUE)); | |||||
project.setVersion(oldProject.getVersion() + 1); | |||||
project.setId(null); | |||||
project.setCreateOn(LocalDateTime.now()); | |||||
project.setUpdateOn(LocalDateTime.now()); | project.setUpdateOn(LocalDateTime.now()); | ||||
if(!projectService.updateById(project)){ | |||||
throw new BusinessException("项目调整失败"); | |||||
} | |||||
projectService.save(project); | |||||
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"); | |||||
projectInstService.updateById(oldInst); | |||||
ProjectInst newPi = new ProjectInst(); | |||||
newPi.setProjectId(project.getId()); | |||||
newPi.setInstType(oldInst.getInstType()); | |||||
newPi.setInstCode(instCode); | |||||
newPi.setCreatOn(LocalDateTime.now()); | |||||
newPi.setUpdateOn(LocalDateTime.now()); | |||||
projectInstService.save(newPi); | |||||
projectService.update(Wrappers.lambdaUpdate(Project.class) | |||||
.set(Project::getNewest,Boolean.FALSE) | |||||
.ne(Project::getId,project.getId()) | |||||
.eq(Project::getProjectCode,project.getProjectCode())); | |||||
//再修改应用信息 | //再修改应用信息 | ||||
Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && 1 == projectDto.getIncludeApplication() | Boolean isApp = Objects.nonNull(projectDto.getIncludeApplication()) && 1 == projectDto.getIncludeApplication() | ||||
? Boolean.TRUE : Boolean.FALSE; | ? Boolean.TRUE : Boolean.FALSE; | ||||
Long projectDtoId = projectDto.getId(); | Long projectDtoId = projectDto.getId(); | ||||
Project projectInfo = projectService.getById(projectDtoId); | Project projectInfo = projectService.getById(projectDtoId); | ||||
String instCode = projectInfo.getInstCode(); | |||||
ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getInstCode, instCode)); | ProjectInst projectInst = projectInstService.getOne(Wrappers.lambdaQuery(ProjectInst.class).eq(ProjectInst::getInstCode, instCode)); | ||||
Integer instType = projectInst.getInstType(); | Integer instType = projectInst.getInstType(); | ||||
if (InstTypeEnum.UNIT_INNER_AUDIT.getCode().equals(instType) || | |||||
InstTypeEnum.PRELIMINARY_PREVIEW.getCode().equals(instType) || | |||||
InstTypeEnum.DEPT_UNITED_REVIEW.getCode().equals(instType)) { | |||||
//批量删除 | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectId, project.getId())); | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, project.getProjectCode())); | |||||
}else { | |||||
//采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息 | |||||
//采取批量删除 批量添加的方式 批量删除建设方案申报后的应用信息 | |||||
List<String> projectCodeList = projectService.list(Wrappers.lambdaQuery(Project.class) | |||||
.eq(Project::getProjectCode, project.getProjectCode()) | |||||
.eq(Project::getIsConstruct, Boolean.TRUE)).stream() | |||||
.map(Project::getProjectCode).collect(Collectors.toList()); | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode,project.getProjectCode()) | |||||
.in(CollUtil.isNotEmpty(projectCodeList),ProjectApplication::getProjectCode,projectCodeList) | |||||
.eq(ProjectApplication::getIsConstruct,Boolean.TRUE)); | |||||
} | |||||
//批量删除 | |||||
projectApplicationService.remove(Wrappers.lambdaQuery(ProjectApplication.class) | |||||
.eq(ProjectApplication::getProjectCode, project.getProjectCode()) | |||||
.eq(ProjectApplication::getProjectVersion,project.getVersion())); | |||||
if(isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())){ | if(isApp && CollUtil.isNotEmpty(projectDto.getApplicationList())){ | ||||
//批量添加 | //批量添加 | ||||
List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | List<ProjectApplication> applications = projectDto.getApplicationList().stream().map(application -> { | ||||
@@ -1119,6 +1138,7 @@ 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); | ||||
} | } | ||||
projectApplication.setProjectVersion(project.getVersion()); | |||||
return projectApplication; | return projectApplication; | ||||
}).collect(Collectors.toList()); | }).collect(Collectors.toList()); | ||||
projectApplicationService.saveBatch(applications); | projectApplicationService.saveBatch(applications); | ||||
@@ -193,16 +193,16 @@ yxt: | |||||
#省局联审 请求信息 | #省局联审 请求信息 | ||||
provincial: | provincial: | ||||
# host: https://pms.zj.gov.cn/prometheus-zhejiang_foreign | |||||
host: https://pms.zj.gov.cn/prometheus-zhejiang_foreign | |||||
pushUrl: /api/v1/foreign/importantPro | |||||
detailUrl: /api/v1/foreign/importantProView | |||||
key: b5b2096953534a53991be4ea95f8cffa | |||||
secret: 1bec9b77134d4962ac466fbe9696b897 | |||||
# host: http://223.4.72.75/prometheus-zhejiang_foreign | |||||
# pushUrl: /api/v1/foreign/importantPro | # pushUrl: /api/v1/foreign/importantPro | ||||
# detailUrl: /api/v1/foreign/importantProView | # detailUrl: /api/v1/foreign/importantProView | ||||
# key: b5b2096953534a53991be4ea95f8cffa | # key: b5b2096953534a53991be4ea95f8cffa | ||||
# secret: 1bec9b77134d4962ac466fbe9696b897 | # secret: 1bec9b77134d4962ac466fbe9696b897 | ||||
host: http://223.4.72.75/prometheus-zhejiang_foreign | |||||
pushUrl: /api/v1/foreign/importantPro | |||||
detailUrl: /api/v1/foreign/importantProView | |||||
key: 7fb48b518c6044a5a44deddd11b445e3 | |||||
secret: ced8fff70018413c9516c58f95885624 | |||||
#天印服务器接口信息 | #天印服务器接口信息 | ||||
@@ -193,16 +193,16 @@ yxt: | |||||
#省局联审 请求信息 | #省局联审 请求信息 | ||||
provincial: | provincial: | ||||
# host: https://pms.zj.gov.cn/prometheus-zhejiang_foreign | |||||
host: https://pms.zj.gov.cn/prometheus-zhejiang_foreign | |||||
pushUrl: /api/v1/foreign/importantPro | |||||
detailUrl: /api/v1/foreign/importantProView | |||||
key: b5b2096953534a53991be4ea95f8cffa | |||||
secret: 1bec9b77134d4962ac466fbe9696b897 | |||||
# host: http://223.4.72.75/prometheus-zhejiang_foreign | |||||
# pushUrl: /api/v1/foreign/importantPro | # pushUrl: /api/v1/foreign/importantPro | ||||
# detailUrl: /api/v1/foreign/importantProView | # detailUrl: /api/v1/foreign/importantProView | ||||
# key: b5b2096953534a53991be4ea95f8cffa | # key: b5b2096953534a53991be4ea95f8cffa | ||||
# secret: 1bec9b77134d4962ac466fbe9696b897 | # secret: 1bec9b77134d4962ac466fbe9696b897 | ||||
host: http://223.4.72.75/prometheus-zhejiang_foreign | |||||
pushUrl: /api/v1/foreign/importantPro | |||||
detailUrl: /api/v1/foreign/importantProView | |||||
key: 7fb48b518c6044a5a44deddd11b445e3 | |||||
secret: ced8fff70018413c9516c58f95885624 | |||||
#天印服务器接口信息 | #天印服务器接口信息 | ||||