| | |
| | | import com.zt.common.service.BaseService; |
| | | import com.zt.common.utils.CommonUtils; |
| | | import com.zt.life.export.service.WordFileService; |
| | | import com.zt.life.modules.baselineRelease.dto.BaselineDto; |
| | | import com.zt.life.modules.baselineRelease.model.BaselineRelease; |
| | | import com.zt.life.modules.baselineRelease.model.BaselineReleaseRemark; |
| | | import com.zt.life.modules.configAuditReport.dao.ConfigAuditReportDao; |
| | | import com.zt.life.modules.configAuditReport.dto.ConfigAuditDto; |
| | | import com.zt.life.modules.configAuditReport.model.ConfigAuditReport; |
| | | import com.zt.life.modules.configAuditReport.model.ConfigAuditReportContent; |
| | | import com.zt.life.modules.configAuditReport.model.ConfigAuditReportProblem; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseCmAudit; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseConfigItem; |
| | | import com.zt.life.modules.configItemWarehouse.model.WarehouseQaAudit; |
| | |
| | | import com.zt.life.modules.configItemWarehouse.service.WarehouseQaAuditService; |
| | | import com.zt.life.modules.mainPart.utils.GetFilesPath; |
| | | import com.zt.life.modules.mainPart.utils.GetShowDictList; |
| | | import com.zt.life.modules.project.model.Project; |
| | | import com.zt.life.modules.project.model.SoftwareTestOrderDeliverable; |
| | | import com.zt.life.modules.project.model.SoftwareTestOrderMeasured; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | | import com.zt.life.modules.testCheckOrder.model.TestCheckOrder; |
| | | import com.zt.life.modules.testCheckOrder.service.TestCheckOrderService; |
| | | import com.zt.life.sys.dto.OssDto; |
| | | import com.zt.life.sys.service.SysOssConfigService; |
| | | import com.zt.modules.coderule.service.SysCodeRuleService; |
| | | import com.zt.modules.oss.service.SysOssService; |
| | | import com.zt.modules.workflow.dto.FlowInfoDto; |
| | | import com.zt.modules.workflow.service.WorkflowService; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | 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.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private ConfigAuditReportContentService contentService; |
| | | |
| | | @Autowired |
| | | private ConfigAuditReportProblemService problemService; |
| | | |
| | | @Autowired |
| | | private GetShowDictList getShowDictList; |
| | |
| | | public void delete(Long[] ids) { |
| | | super.deleteLogic(ids); |
| | | } |
| | | /* |
| | | public ConfigAuditDto getDto(Long projectId, Long reportId) { |
| | | |
| | | ConfigAuditDto data = new ConfigAuditDto(); |
| | | if (reportId != null) { |
| | | data.setId(reportId); |
| | | ConfigAuditReport auditReport = this.get(reportId); |
| | | data.setAuditReport(auditReport); |
| | | if (auditReport != null && projectId == null) { |
| | | projectId = auditReport.getProjectId(); |
| | | } |
| | | List<ConfigAuditReportProblem> problemList = problemService.getList(reportId); |
| | | List<ConfigAuditReportContent> contentList = contentService.getList(reportId); |
| | | data.setContentList(contentList); |
| | | data.setProblemList(problemList); |
| | | } else { |
| | | ConfigAuditReport auditReport = new ConfigAuditReport(); |
| | | data.setAuditReport(auditReport); |
| | | List<ConfigAuditReportContent> contentList = contentService.dictList("config_check_item"); |
| | | data.setContentList( contentList); |
| | | } |
| | | if (projectId != null) { |
| | | data.setProjectId(projectId); |
| | | data.setProject(projectService.get(projectId)); |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | public Boolean save(ConfigAuditDto configAuditDto) { |
| | | Long warehouseId = configItemDto.getConfigItemWarehouse().getId(); |
| | | if (warehouseId != null) |
| | | baseDao.updateById(configItemDto.getConfigItemWarehouse()); |
| | | Long reportId = configAuditDto.getAuditReport().getId(); |
| | | if (reportId != null) |
| | | baseDao.updateById(configAuditDto.getAuditReport()); |
| | | else { |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("funCode", "config_item_warehouse"); |
| | | map.put("projectId", configItemDto.getProjectId().toString()); |
| | | configItemDto.getConfigItemWarehouse().setProjectId(configItemDto.getProjectId()); |
| | | configItemDto.getConfigItemWarehouse().setCode(sysCodeRuleService.getNewCode(map)); |
| | | baseDao.insert(configItemDto.getConfigItemWarehouse()); |
| | | warehouseId = configItemDto.getConfigItemWarehouse().getId(); |
| | | map.put("funCode", "config_audit_report"); |
| | | map.put("projectId", configAuditDto.getProjectId().toString()); |
| | | configAuditDto.getAuditReport().setProjectId(configAuditDto.getProjectId()); |
| | | configAuditDto.getAuditReport().setCode(sysCodeRuleService.getNewCode(map)); |
| | | baseDao.insert(configAuditDto.getAuditReport()); |
| | | reportId = configAuditDto.getAuditReport().getId(); |
| | | } |
| | | |
| | | for (WarehouseConfigItem configItem : configItemDto.getConfigItemList()) { |
| | | configItem.setWarehouseId(warehouseId); |
| | | if (configItem.getId() != null) { |
| | | WarehouseConfigItem configItem2 = configItemService.get(configItem.getId()); |
| | | if (CommonUtils.isActureChangeData(configItem,configItem2)) { |
| | | configItemService.update(configItem); |
| | | } |
| | | if(CommonUtils.isActureChangeData(configItemDto.getConfigItemWarehouse().getLibraryType(),configItem.getLibraryType())){ |
| | | configItem.setLibraryType(configItemDto.getConfigItemWarehouse().getLibraryType()); |
| | | configItemService.update(configItem); |
| | | for (ConfigAuditReportContent content : configAuditDto.getContentList()) { |
| | | content.setReportId(reportId); |
| | | if (content.getId() != null) { |
| | | ConfigAuditReportContent content2 = contentService.get(content.getId()); |
| | | if (CommonUtils.isActureChangeData(content,content2)) { |
| | | contentService.update(content); |
| | | } |
| | | } else { |
| | | Map<String, String> map = new HashMap<>(); |
| | | String pageCode = configItem.getPageCode(); |
| | | if (StringUtils.isNotBlank(pageCode) && "plan,explain,record,report".contains(pageCode)) { |
| | | map.put("funCode", "test_" + pageCode); |
| | | configItem.setItemIdentify(sysCodeRuleService.getNewCode(map)); |
| | | } |
| | | configItem.setLibraryType(configItemDto.getConfigItemWarehouse().getLibraryType()); |
| | | configItem.setWarehouseId(warehouseId); |
| | | configItem.setProjectId(configItemDto.getConfigItemWarehouse().getProjectId()); |
| | | configItemService.insert(configItem); |
| | | content.setProjectId(configAuditDto.getAuditReport().getProjectId()); |
| | | contentService.insert(content); |
| | | } |
| | | Long checkId = configItem.getCheckId(); |
| | | if (checkId != null) { |
| | | TestCheckOrder testCheckOrder = testCheckOrderService.get(checkId); |
| | | if (testCheckOrder.getConfigItemId() == null) { |
| | | Long configItemId = configItem.getId(); |
| | | testCheckOrder.setConfigItemId(configItemId); |
| | | testCheckOrder.setConfigOrderId(warehouseId); |
| | | testCheckOrderService.update(testCheckOrder); |
| | | } |
| | | } |
| | | sysOssConfigService.updateOss(configItem.getId(), configItem.getFiles());// 保存附件 |
| | | } |
| | | |
| | | for (WarehouseCmAudit cmAudit : configItemDto.getCmAuditList()) { |
| | | cmAudit.setWarehouseId(warehouseId); |
| | | if (cmAudit.getId() != null) { |
| | | cmAuditService.update(cmAudit); |
| | | for (ConfigAuditReportProblem problem : configAuditDto.getProblemList()) { |
| | | problem.setReportId(reportId); |
| | | if (problem.getId() != null) { |
| | | problemService.update(problem); |
| | | } else { |
| | | cmAudit.setWarehouseId(warehouseId); |
| | | cmAuditService.insert(cmAudit); |
| | | problemService.insert(problem); |
| | | } |
| | | } |
| | | |
| | | for (WarehouseQaAudit qaAudit : configItemDto.getQaAuditList()) { |
| | | qaAudit.setWarehouseId(warehouseId); |
| | | if (qaAudit.getId() != null) { |
| | | qaAuditService.update(qaAudit); |
| | | } else { |
| | | qaAudit.setWarehouseId(warehouseId); |
| | | qaAuditService.insert(qaAudit); |
| | | } |
| | | } |
| | | |
| | | Long bizId = configItemDto.getConfigItemWarehouse().getId(); |
| | | FlowInfoDto flowInfoDto = configItemDto.getFlowInfoDto(); |
| | | |
| | | if (flowInfoDto != null && flowInfoDto.getSubmitType() != null && "tj,bl".contains(flowInfoDto.getSubmitType())) { |
| | | if ("tj".equals(flowInfoDto.getSubmitType())) { |
| | | workflowService.startFlow(flowInfoDto.getFlowCode(), bizId); |
| | | } |
| | | workflowService.approvePass(flowInfoDto.getFlowCode(), bizId, flowInfoDto.getStepIdMark()); |
| | | } |
| | | return true; |
| | | }*/ |
| | | } |
| | | } |