From 906df84cc340d514b8890527e52ac23170a022ca Mon Sep 17 00:00:00 2001 From: jinlin <jinlin> Date: 星期三, 22 十一月 2023 08:50:12 +0800 Subject: [PATCH] Changes --- modules/mainPart/src/main/java/com/zt/life/modules/project/service/EnvironService.java | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/modules/mainPart/src/main/java/com/zt/life/modules/project/service/EnvironService.java b/modules/mainPart/src/main/java/com/zt/life/modules/project/service/EnvironService.java index 3347e6f..91bd749 100644 --- a/modules/mainPart/src/main/java/com/zt/life/modules/project/service/EnvironService.java +++ b/modules/mainPart/src/main/java/com/zt/life/modules/project/service/EnvironService.java @@ -2,7 +2,7 @@ import com.zt.common.service.BaseService; import com.zt.life.modules.project.dao.EnvironDao; -import com.zt.life.modules.project.dto.SoftwareTestOrderDto; +import com.zt.life.modules.project.dto.EnvironDto; import com.zt.life.modules.project.model.*; import com.zt.life.modules.sysBaseInfo.model.TestAgencyInfo; import com.zt.life.modules.sysBaseInfo.service.TestAgencyInfoService; @@ -51,8 +51,8 @@ private TestAgencyInfoService testAgencyInfoService; - public SoftwareTestOrderDto getDto(Long environId, Long projectId) { - SoftwareTestOrderDto data = new SoftwareTestOrderDto(); + public EnvironDto getDto(Long environId, Long projectId) { + EnvironDto data = new EnvironDto(); if (environId != null) { Environ environ = this.get(environId); data.setEnviron(environ); @@ -100,25 +100,25 @@ super.deleteLogic(ids); } - public Boolean save(SoftwareTestOrderDto softwareTestOrderDto) { - Long environId = softwareTestOrderDto.getEnviron().getId(); + public Boolean save(EnvironDto environDto) { + Long environId = environDto.getEnviron().getId(); if (environId != null) - baseDao.updateById(softwareTestOrderDto.getEnviron()); + baseDao.updateById(environDto.getEnviron()); else { SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); String year = sdf.format(new Date()); Map<String, String> map = new HashMap<>(); map.put("funCode", "environ"); - map.put("year",year); - softwareTestOrderDto.getEnviron().setYear(year); - softwareTestOrderDto.getEnviron().setProjectId(softwareTestOrderDto.getProjectId()); - softwareTestOrderDto.getEnviron().setCode(sysCodeRuleService.getNewCode(map)); - baseDao.insert(softwareTestOrderDto.getEnviron()); - environId = softwareTestOrderDto.getEnviron().getId(); + map.put("projectId",environDto.getProjectId().toString()); + environDto.getEnviron().setYear(year); + environDto.getEnviron().setProjectId(environDto.getProjectId()); + environDto.getEnviron().setCode(sysCodeRuleService.getNewCode(map)); + baseDao.insert(environDto.getEnviron()); + environId = environDto.getEnviron().getId(); } int i = 0; - for (EnvironSoftwareResources environSoftwareResources : softwareTestOrderDto.getSoftwareResourcesList()) { + for (EnvironSoftwareResources environSoftwareResources : environDto.getSoftwareResourcesList()) { environSoftwareResources.setEnvironId(environId); if (environSoftwareResources.getId() != null) { environSoftwareResourcesService.update(environSoftwareResources); @@ -130,7 +130,7 @@ } } i = 0; - for (EnvironHardwareResources environHardwareResources : softwareTestOrderDto.getHardwareResourcesList()) { + for (EnvironHardwareResources environHardwareResources : environDto.getHardwareResourcesList()) { environHardwareResources.setEnvironId(environId); if (environHardwareResources.getId() != null) { environHardwareResourcesService.update(environHardwareResources); @@ -143,7 +143,7 @@ } i = 0; - for (EnvironAnalysis environAnalysis : softwareTestOrderDto.getEnvironAnalysisList()) { + for (EnvironAnalysis environAnalysis : environDto.getEnvironAnalysisList()) { environAnalysis.setEnvironId(environId); if (environAnalysis.getId() != null) { environAnalysisService.update(environAnalysis); @@ -154,13 +154,13 @@ environAnalysisService.insert(environAnalysis); } } - if (softwareTestOrderDto.getTestAgencyInfo().getId() == 10000) { - softwareTestOrderDto.getTestAgencyInfo().setId(environId); - testAgencyInfoService.insert(softwareTestOrderDto.getTestAgencyInfo()); + if (environDto.getTestAgencyInfo().getId() == 10000) { + environDto.getTestAgencyInfo().setId(environId); + testAgencyInfoService.insert(environDto.getTestAgencyInfo()); } else { - testAgencyInfoService.update(softwareTestOrderDto.getTestAgencyInfo()); + testAgencyInfoService.update(environDto.getTestAgencyInfo()); } - sysOssConfigService.updateOss(softwareTestOrderDto.getEnviron().getId(), softwareTestOrderDto.getFiles());// 淇濆瓨闄勪欢 + sysOssConfigService.updateOss(environDto.getEnviron().getId(), environDto.getFiles());// 淇濆瓨闄勪欢 return true; } } -- Gitblit v1.9.1