| | |
| | | import com.zt.life.modules.project.dao.EnvironDao; |
| | | import com.zt.life.modules.project.dto.SoftwareTestOrderDto; |
| | | import com.zt.life.modules.project.model.*; |
| | | import com.zt.life.modules.sysBaseInfo.model.TestAgencyInfo; |
| | | import com.zt.life.modules.sysBaseInfo.service.TestAgencyInfoService; |
| | | import com.zt.life.sys.service.SysOssConfigService; |
| | | import com.zt.modules.coderule.service.SysCodeRuleService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.zt.common.db.query.QueryFilter; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | /** |
| | | * environ |
| | | * |
| | | * @author zt generator |
| | | * @author zt generator |
| | | * @since 1.0.0 2023-11-17 |
| | | */ |
| | | @Service |
| | | public class EnvironService extends BaseService<EnvironDao, Environ> { |
| | | @Autowired |
| | | private SoftwareTestOrder softwareTestOrder; |
| | | public class EnvironService extends BaseService<EnvironDao, Environ> { |
| | | |
| | | @Autowired |
| | | private EnvironSoftwareResourcesService environSoftwareResourcesService; |
| | |
| | | @Autowired |
| | | private EnvironAnalysisService environAnalysisService; |
| | | |
| | | public SoftwareTestOrderDto getDto(Long orderId, Long environId) { |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private TestAgencyInfoService testAgencyInfoService; |
| | | |
| | | |
| | | public SoftwareTestOrderDto getDto(Long environId, Long projectId) { |
| | | SoftwareTestOrderDto data = new SoftwareTestOrderDto(); |
| | | if (environId != null) { |
| | | data.setId(environId); |
| | | Environ environ = this.get(environId); |
| | | data.setEnviron(environ); |
| | | |
| | | orderId = softwareTestOrder.getId(); |
| | | projectId = environ.getProjectId(); |
| | | |
| | | List<EnvironSoftwareResources> softwareResourcesList = environSoftwareResourcesService.getList(environId); |
| | | data.setSoftwareResourcesList(softwareResourcesList); |
| | |
| | | List<EnvironAnalysis> environAnalysesList = environAnalysisService.getList(environId); |
| | | data.setEnvironAnalysisList(environAnalysesList); |
| | | } else { |
| | | SoftwareTestOrder softwareTestOrder = softwareTestOrderService.get(orderId); |
| | | Project project = projectService.get(projectId); |
| | | Environ environ = new Environ(); |
| | | data.setEnviron(environ); |
| | | data.getEnviron().setSoftwareName(project.getSoftwareName()); |
| | | data.getEnviron().setSoftwareIdentity(project.getSoftwareIdentity()); |
| | | } |
| | | |
| | | if (orderId != null) { |
| | | data.setOrderId(orderId); |
| | | data.setSoftwareTestOrder(softwareTestOrderService.get(orderId)); |
| | | } |
| | | if (data.getTestAgencyInfo() == null) |
| | | data.getEnviron().setAgencyName(testAgencyInfoService.get(10000L).getAgencyName()); |
| | | data.getEnviron().setSite(testAgencyInfoService.get(10000L).getSite()); |
| | | |
| | | return data; |
| | | } |
| | |
| | | else { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("funCode", "environ"); |
| | | softwareTestOrderDto.getEnviron().setOrderId(softwareTestOrderDto.getOrderId()); |
| | | softwareTestOrderDto.getEnviron().setProjectId(softwareTestOrderDto.getProjectId()); |
| | | softwareTestOrderDto.getEnviron().setCode(sysCodeRuleService.getNewCode(map)); |
| | | baseDao.insert(softwareTestOrderDto.getEnviron()); |
| | | environId = softwareTestOrderDto.getEnviron().getId(); |