| | |
| | | package com.zt.life.modules.configAuditReport.service; |
| | | |
| | | 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.WarehouseCmAuditService; |
| | | import com.zt.life.modules.configItemWarehouse.service.WarehouseConfigItemService; |
| | | 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; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Service |
| | | public class ConfigAuditReportService extends BaseService<ConfigAuditReportDao, ConfigAuditReport> { |
| | | @Autowired |
| | | private SysOssConfigService sysOssConfigService; |
| | | |
| | | @Autowired |
| | | private SysOssService sysOssService; |
| | | |
| | | @Autowired |
| | | private SysCodeRuleService sysCodeRuleService; |
| | | |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private ConfigAuditReportContentService contentService; |
| | | |
| | | @Autowired |
| | | private ConfigAuditReportProblemService problemService; |
| | | |
| | | @Autowired |
| | | private GetShowDictList getShowDictList; |
| | | |
| | | @Autowired |
| | | private WordFileService wordFileService; |
| | | |
| | | @Autowired |
| | | private GetFilesPath getFilesPath; |
| | | /** |
| | | * 分页查询 |
| | | * |
| | |
| | | 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<?> contentResult = contentService.dictList("config_check_item"); |
| | | List<?> contentList = contentResult; |
| | | data.setContentList((List<ConfigAuditReportContent>) contentList); |
| | | } |
| | | if (projectId != null) { |
| | | data.setProjectId(projectId); |
| | | data.setProject(projectService.get(projectId)); |
| | | } |
| | | return data; |
| | | } |
| | | |
| | | public Boolean save(ConfigAuditDto configAuditDto) { |
| | | Long reportId = configAuditDto.getAuditReport().getId(); |
| | | if (reportId != null) |
| | | baseDao.updateById(configAuditDto.getAuditReport()); |
| | | else { |
| | | Map<String, String> map = new HashMap<>(); |
| | | 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 (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 { |
| | | content.setProjectId(configAuditDto.getAuditReport().getProjectId()); |
| | | contentService.insert(content); |
| | | } |
| | | } |
| | | |
| | | for (ConfigAuditReportProblem problem : configAuditDto.getProblemList()) { |
| | | problem.setReportId(reportId); |
| | | if (problem.getId() != null) { |
| | | problemService.update(problem); |
| | | } else { |
| | | problemService.insert(problem); |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | | } |