/** * 根据需求信息查询需求对应的阶段下的方案是否符合最终的提交要求 * * @param requirement 需求信息 * @param requirementSolution 用户的方案信息 * @return Boolean 返回检验信息 */ private Response<Boolean> checkReqStatusWithSol( Requirement requirement, RequirementSolution requirementSolution) { Response<Boolean> result = new Response<Boolean>(); // 是否是方案终投阶段 if (Objects.equal(RequirementStatus.SOL_END, RequirementStatus.from(requirement.getStatus()))) { // 技术领先、差异化必须要提交方案(solutionFile:上传的详细的方案文档)其它场景不需要 if (Objects.equal(Tactics.from(requirement.getTacticsId()), Tactics.TECHNOLOGY_NEW) || Objects.equal(Tactics.from(requirement.getTacticsId()), Tactics.DIFFERENTIATION)) { if (requirementSolution.getSolutionFile() == null || requirementSolution.getSolutionFile().isEmpty()) { log.error("jump to requirement solution end need send solution file."); result.setError("solution.file.null"); return result; } } // todo 添加判断用户是否已经提交报价单文档 // 模块方案信息 List<ModuleSolution> solutions = moduleSolutionDao.findAllSolutions(requirementSolution.getId()); // 模块报价信息 List<ModuleQuotation> quotations = moduleQuotationDao.findAllQuotations(requirementSolution.getId()); // 获取需求详细的模块数量 Integer actualModuleNum = requirement.getModuleNum(); // 判断模块的TQRD信息是否填写完整 if (!Objects.equal(actualModuleNum, solutions.size())) { log.error("send solution to end status, the module solution info must be enter."); result.setError("moduleSol.info.null"); return result; } // 判断是否填写完整的模块报价信息 if (!Objects.equal(actualModuleNum, quotations.size())) { log.error("send solution to end status, the module quotation info must be enter."); result.setError("moduleQuo.info.null"); return result; } // 验证TQRD数据是否已全部填写 for (ModuleSolution solution : solutions) { if (solution.getTechnology() == null || solution.getQuality() == null || solution.getReaction() == null || solution.getDelivery() == null) { log.error("send solution to end status, the module solution info must be enter."); result.setError("moduleSol.info.null"); return result; } } // 验证报价数据是否填写完整 for (ModuleQuotation quotation : quotations) { if (quotation.getSolutionId() == null || quotation.getModuleId() == null || quotation.getPrice() == null || Strings.isNullOrEmpty(quotation.getCoinType()) || quotation.getExchangeRate() == null) { log.error("send solution to end status, the module quotation info must be enter."); result.setError("moduleQuo.info.null"); return result; } } result.setResult(true); } else { log.error("requirement status don't allow requirement solution end."); result.setError("solution.status.not.end"); return result; } return result; }