| | |
| | | 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.configAuditReport.dao.ConfigAuditReportDao; |
| | | import com.zt.life.modules.configAuditReport.dto.ConfigAuditDto; |
| | | import com.zt.life.modules.configAuditReport.model.ConfigAuditReport; |
| | | 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.service.ProjectService; |
| | | import com.zt.life.modules.testCheckOrder.model.TestCheckOrder; |
| | | import com.zt.life.modules.testCheckOrder.service.TestCheckOrderService; |
| | | 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 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.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 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) { |
| | | |
| | | } |
| | | |
| | | public Boolean save(ConfigAuditDto configAuditDto) { |
| | | Long warehouseId = configItemDto.getConfigItemWarehouse().getId(); |
| | | if (warehouseId != null) |
| | | baseDao.updateById(configItemDto.getConfigItemWarehouse()); |
| | | 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(); |
| | | } |
| | | |
| | | 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); |
| | | } |
| | | } 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); |
| | | } |
| | | 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); |
| | | } else { |
| | | cmAudit.setWarehouseId(warehouseId); |
| | | cmAuditService.insert(cmAudit); |
| | | } |
| | | } |
| | | |
| | | 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; |
| | | }*/ |
| | | } |