From 313d2757c07f569c337d868c549562839bc2f76f Mon Sep 17 00:00:00 2001 From: WendyYang Date: Thu, 12 Sep 2024 16:20:43 +0800 Subject: [PATCH] =?UTF-8?q?modify:=201.=20=E5=A2=9E=E5=8A=A0=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E3=80=81=E6=A0=87=E9=A1=B9=E7=8A=B6=E6=80=81=E5=8F=98?= =?UTF-8?q?=E6=9B=B4=E4=BF=AE=E6=94=B9;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../action/ProjectStateChangeAction.java | 4 +- .../action/TenderStateChangeAction.java | 4 +- .../model/vo/PreInsAcceptancePersonVO.java | 2 - .../controller/ProjectApplicationController.java | 41 ------- .../api/projectlib/manage/ApplicationManage.java | 123 --------------------- .../pm/api/projectlib/manage/ProjectLibManage.java | 8 +- 6 files changed, 6 insertions(+), 176 deletions(-) delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectApplicationController.java delete mode 100644 hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectStateChangeAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectStateChangeAction.java index 48c4dfc..be915cf 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectStateChangeAction.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/ProjectStateChangeAction.java @@ -137,10 +137,10 @@ public class ProjectStateChangeAction { project.setStatus(ProjectStatus.ON_ADAPTING.getCode()); } - @OnTransition(source = "ON_PURCHASING", target = "TO_BE_FIRST_INSPECTED") + @OnTransition(source = "ON_PURCHASING", target = "ACCEPTED") public void SUBMIT_PURCHASE_CONTRACT_RECORD_TO_FIRST_ACCEPT(Message message) { Project project = getProject(message); - project.setStatus(ProjectStatus.TO_BE_FIRST_INSPECTED.getCode()); + project.setStatus(ProjectStatus.ACCEPTED.getCode()); } @OnTransition(source = "ON_ADAPTING", target = "TO_BE_FIRST_INSPECTED") diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java index b4db656..0862379 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/common/statemachine/action/TenderStateChangeAction.java @@ -41,10 +41,10 @@ public class TenderStateChangeAction { * * @param message \ */ - @OnTransition(source = "TO_BE_SUBMIT_PURCHASE_CONSTRUCTION_INFO", target = "TO_BE_SUBMIT_FIRST_INSPECTED_INFO") + @OnTransition(source = "TO_BE_SUBMIT_PURCHASE_CONSTRUCTION_INFO", target = "FINALLY_INSPECTED_PASSED") public void SUBMIT_PURCHASE_CONSTRUCTION_INFO_SKIP_TO_FINAL_INSPECT(Message message) { Purchase purchase = getPurchaseInfo(message); - purchase.setStatus(TenderMainStatus.TO_BE_SUBMIT_FIRST_INSPECTED_INFO.getCode()); + purchase.setStatus(TenderMainStatus.FINALLY_INSPECTED_PASSED.getCode()); } /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/PreInsAcceptancePersonVO.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/PreInsAcceptancePersonVO.java index bff0840..ee23724 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/PreInsAcceptancePersonVO.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectdeclared/model/vo/PreInsAcceptancePersonVO.java @@ -1,10 +1,8 @@ package com.hz.pm.api.projectdeclared.model.vo; -import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; -import java.time.LocalDateTime; import java.util.Objects; /** diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectApplicationController.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectApplicationController.java deleted file mode 100644 index 5dd918e..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/controller/ProjectApplicationController.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.hz.pm.api.projectlib.controller; - -import com.hz.pm.api.projectlib.manage.ApplicationManage; -import com.hz.pm.api.projectlib.model.dto.ApplicationAppCodeSaveDTO; -import com.ningdatech.log.annotation.WebLog; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; - -import javax.validation.Valid; - -/** - * @Classname ProjectApplicationController - * @Description - * @Date 2023/6/27 11:32 - * @Author PoffyZhang - */ -@RestController -@RequiredArgsConstructor -@Api(tags = "项目应用控制器") -@RequestMapping("/api/v1/application") -public class ProjectApplicationController { - - private final ApplicationManage applicationManage; - - @GetMapping("/get-report/{appCode}") - @ApiOperation("获取应用 试运行报告") - @WebLog("获取应用 试运行报告") - public String getReport(@PathVariable String appCode) { - return applicationManage.getReport(appCode); - } - - @PostMapping("/save-appcode") - @ApiOperation("保存应用注册的appCode") - @WebLog("保存应用注册的appCode") - public String saveAppCode(@Valid @RequestBody ApplicationAppCodeSaveDTO dto) { - return applicationManage.saveAppCode(dto); - } - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java deleted file mode 100644 index a585b64..0000000 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ApplicationManage.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.hz.pm.api.projectlib.manage; - -import cn.hutool.core.collection.CollUtil; -import cn.hutool.core.lang.Assert; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import com.hz.pm.api.common.model.constant.BizConst; -import com.hz.pm.api.common.util.HmacAuthUtil; -import com.hz.pm.api.projectlib.model.dto.ApplicationAppCodeSaveDTO; -import com.hz.pm.api.projectlib.model.entity.ProjectApplication; -import com.hz.pm.api.projectlib.service.IProjectApplicationService; -import com.hz.pm.api.projectlib.service.IProjectService; -import com.hz.pm.api.user.util.LoginUserUtil; -import com.ningdatech.basic.exception.BizException; -import com.ningdatech.basic.model.ApiResponse; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.*; -import org.springframework.stereotype.Component; -import org.springframework.util.MultiValueMap; -import org.springframework.web.client.RestTemplate; - -import java.time.LocalDateTime; -import java.util.Map; -import java.util.Objects; - -/** - *

- * ApplicationManage - *

- * - * @author ZPF - * @since 14:19 2023/2/1 - */ -@Component -@RequiredArgsConstructor -@Slf4j -public class ApplicationManage { - - @Value("${irs.app-report.url:}") - private String url; - - @Value("${irs.app-report.appKey:}") - private String appKey; - - @Value("${irs.app-report.appScret:}") - private String appScret; - - private final IProjectApplicationService applicationService; - - private final IProjectService projectService; - - /** - * 保存 appCode - * - * @param dto - * @return - */ - public String saveAppCode(ApplicationAppCodeSaveDTO dto) { - Long userId = LoginUserUtil.getUserId(); - ProjectApplication app = applicationService.getById(dto.getId()); - Assert.notNull(app, "该应用不存在"); - app.setAppCode(dto.getAppCode()); - app.setUpdateOn(LocalDateTime.now()); - app.setUpdateBy(userId); - if (applicationService.updateById(app)) { - return BizConst.SAVE_SUCCESS; - } - return BizConst.SAVE_FAIL; - } - - /** - * 获取试运行报告 - * - * @param appCode - * @return - */ - public String getReport(String appCode) { - String method = HttpMethod.GET.name(); - String appUrl = url + "?appCode=" + appCode; - - Map header = HmacAuthUtil.generateHeader(appUrl, method, appKey, appScret); - //请求头 - HttpHeaders headers = new HttpHeaders(); - - for (Map.Entry entry : header.entrySet()) { - headers.add(entry.getKey(), entry.getValue()); - } - //封装请求头 - HttpEntity> formEntity = new HttpEntity<>(headers); - - RestTemplate restTemplate = new RestTemplate(); - ResponseEntity forEntity = restTemplate.exchange(appUrl, HttpMethod.GET, formEntity, ApiResponse.class); - - log.info("forEntity:{}", JSON.toJSONString(forEntity)); - log.info("body:{}", forEntity.getBody()); - ApiResponse body = forEntity.getBody(); - - if (!body.getCode().equals(HttpStatus.OK.value())) { - throw new BizException(body.getMessage()); - } - - Object data = body.getData(); - if (Objects.nonNull(data)) { - JSONObject dataJson = JSON.parseObject(JSON.toJSONString(data)); - JSONArray resourceList = dataJson.getJSONArray("resourceList"); - if (CollUtil.isNotEmpty(resourceList)) { - JSONObject resource = JSON.parseObject(JSON.toJSONString(resourceList.get(0))); - if (StringUtils.isBlank(resource.getString("reportOss"))) { - //暂时没有 appCode 所以先返回测试数据 - return "https://irs-yyyw.oss-cn-hangzhou-zwynet-d01-a.internet.cloud.zj.gov.cn/tmp/%E6%B8%A9%E5%B7%9E%E5%B8%82%E4%B9%90%E6%B8%85%E5%B8%82%E5%8C%BA%E5%9F%9F%E4%BD%93%E6%A3%80%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F_9cf0b901f2ca4fbf8ff274da359ad219.html?Expires=1687833685&OSSAccessKeyId=wMhEw2BhpIDc1xwO&Signature=UPAbMdDy23FI1sNemszg5WH%2BG40%3D"; - } else { - return resource.getString("reportOss"); - } - } - } - throw new BizException("获取报告失败!"); - } - -} diff --git a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java index 5d13e4e..41049ac 100644 --- a/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java +++ b/hz-pm-api/src/main/java/com/hz/pm/api/projectlib/manage/ProjectLibManage.java @@ -58,7 +58,6 @@ import com.hz.pm.api.projectlib.helper.ProjectManageUtil; import com.hz.pm.api.projectlib.model.constant.ProjectConstant; import com.hz.pm.api.projectlib.model.dto.GovSystemReplaceInfoDTO; import com.hz.pm.api.projectlib.model.dto.ProjectDTO; -import com.hz.pm.api.projectlib.model.dto.ProjectGovSystemReplaceInfosDTO; import com.hz.pm.api.projectlib.model.dto.ProjectPaymentPlanDTO; import com.hz.pm.api.projectlib.model.entity.*; import com.hz.pm.api.projectlib.model.enumeration.InstTypeEnum; @@ -751,8 +750,7 @@ public class ProjectLibManage { if (tmpPersons != null) { purchaseFullInfo.setFirstInspectedPersons(convertPersons(tmpPersons)); } - List replaceInfos = BeanUtil.copyToList(replaceInfosMap.get(k), ProjectGovSystemReplaceInfosDTO.class); - purchaseFullInfo.setSystemReplaceInfos(replaceInfos); + purchaseFullInfo.setSystemReplaceInfos(replaceInfosMap.get(k)); retProjectDetail.getPurchaseDetails().add(purchaseFullInfo); }); // 建设方案 @@ -1229,9 +1227,7 @@ public class ProjectLibManage { List childUnitIds = mhUnitCache.getViewChildIdsRecursion(user.getMhUnitId()); List viewUnitIdList = CollUtils.convert(childUnitIds, String::valueOf); //单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目 - query.and(q1 -> q1.in(Project::getBuildOrgCode, viewUnitIdList) - .or(q2 -> q2.eq(Project::getStage, ProjectStatus.NOT_APPROVED.getCode()) - .in(Project::getSuperOrgCode, viewUnitIdList))); + query.in(Project::getBuildOrgCode, viewUnitIdList); break; case SUPER_ADMIN: //超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员