| | |
| | | public PageResult<OrderDetailVO> getPendingApprovalOrderPageWithProductConditions(OrderQueryDTO queryDTO) { |
| | | // 根据产品条件查询产品ID列表 |
| | | List<String> productIds = null; |
| | | if (StringUtils.hasText(queryDTO.getIndustryId()) || StringUtils.hasText(queryDTO.getUnitProjectId()) || |
| | | if (StringUtils.hasText(queryDTO.getIndustryId()) || queryDTO.getUnitProjectId() != null || |
| | | StringUtils.hasText(queryDTO.getProductTypeId()) || StringUtils.hasText(queryDTO.getProductSubTypeId())) { |
| | | productIds = reportResultSubmissionMapper.selectProductIdsByConditions( |
| | | queryDTO.getIndustryId(), queryDTO.getUnitProjectId(), |
| | | queryDTO.getIndustryId(), queryDTO.getUnitProjectId(), queryDTO.getImportantDistrictId(), |
| | | queryDTO.getProductTypeId(), queryDTO.getProductSubTypeId() |
| | | ); |
| | | |
| | |
| | | |
| | | // 根据产品条件查询产品ID列表 |
| | | List<String> productIds = null; |
| | | if (StringUtils.hasText(queryDTO.getIndustryId()) || StringUtils.hasText(queryDTO.getUnitProjectId()) || |
| | | if (StringUtils.hasText(queryDTO.getIndustryId()) || queryDTO.getUnitProjectId() != null || |
| | | StringUtils.hasText(queryDTO.getProductTypeId()) || StringUtils.hasText(queryDTO.getProductSubTypeId())) { |
| | | productIds = reportResultSubmissionMapper.selectProductIdsByConditions( |
| | | queryDTO.getIndustryId(), queryDTO.getUnitProjectId(), |
| | | queryDTO.getIndustryId(), queryDTO.getUnitProjectId(), queryDTO.getImportantDistrictId(), |
| | | queryDTO.getProductTypeId(), queryDTO.getProductSubTypeId() |
| | | ); |
| | | |
| | |
| | | |
| | | // 根据产品条件查询产品ID列表 |
| | | List<String> productIds = null; |
| | | if (StringUtils.hasText(queryDTO.getIndustryId()) || StringUtils.hasText(queryDTO.getUnitProjectId()) || |
| | | if (StringUtils.hasText(queryDTO.getIndustryId()) || queryDTO.getUnitProjectId()!= null || |
| | | StringUtils.hasText(queryDTO.getProductTypeId()) || StringUtils.hasText(queryDTO.getProductSubTypeId())) { |
| | | productIds = reportResultSubmissionMapper.selectProductIdsByConditions( |
| | | queryDTO.getIndustryId(), queryDTO.getUnitProjectId(), |
| | | queryDTO.getIndustryId(), queryDTO.getUnitProjectId(), queryDTO.getImportantDistrictId(), |
| | | queryDTO.getProductTypeId(), queryDTO.getProductSubTypeId() |
| | | ); |
| | | |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Long uploadOrderAttachment(String orderId, String fileName, String originalName, |
| | | String fileType, Long fileSize, String fileUrl, |
| | | String bucketName, String objectName, Long uploadUserId, |
| | | String bucketName, String objectName, String uploadUserId, |
| | | String uploadUserName, String attachmentType, String description) { |
| | | // 参数校验 |
| | | if (!StringUtils.hasText(orderId)) { |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean addOrderEvaluation(String orderId, Long evaluatorId, String evaluatorName, |
| | | public boolean addOrderEvaluation(String orderId, String evaluatorId, String evaluatorName, |
| | | String evaluatorType, String content, Integer rating, |
| | | Integer serviceRating, Integer qualityRating, Integer deliveryRating, |
| | | Boolean isAnonymous) { |
| | |
| | | // 根据审批结果调用提交或驳回接口 |
| | | String comment = orderApprovalDTO.getApprovalResult().contains("驳回") ? "审核驳回" : "审核通过"; |
| | | if ("审核驳回".equals(comment)) { |
| | | rejectWorkflowTask(orderApprovalDTO.getTaskId(), String.valueOf(orderApprovalDTO.getApproverId()), comment); |
| | | rejectWorkflowTask(orderApprovalDTO.getTaskId(), String.valueOf(orderApprovalDTO.getApproverId()), orderApprovalDTO.getApprovalOpinion()); |
| | | } else { |
| | | completeWorkflowTask(orderApprovalDTO.getTaskId(), String.valueOf(orderApprovalDTO.getApproverId()), comment); |
| | | completeWorkflowTask(orderApprovalDTO.getTaskId(), String.valueOf(orderApprovalDTO.getApproverId()), orderApprovalDTO.getApprovalOpinion()); |
| | | } |
| | | |
| | | log.info("审批记录添加成功,订单ID: {}, 审批类型: {}, 审批结果: {}, 审批人: {}, 审批意见: {}", |
| | |
| | | try { |
| | | // 1. 删除订单附件(包括MinIO文件和数据库记录) |
| | | log.info("开始删除订单附件,订单ID: {}", orderId); |
| | | List<OrderAttachment> attachments = orderAttachmentMapper.selectByOrderId(orderId); |
| | | for (OrderAttachment attachment : attachments) { |
| | | try { |
| | | // 删除MinIO中的文件 |
| | | if (StringUtils.hasText(attachment.getObjectName())) { |
| | | log.info("删除MinIO文件,对象名称: {}", attachment.getObjectName()); |
| | | minioService.deleteFile(attachment.getObjectName()); |
| | | } |
| | | // 删除数据库记录 |
| | | orderAttachmentMapper.deleteById(attachment.getId()); |
| | | log.info("删除附件记录成功,附件ID: {}", attachment.getId()); |
| | | } catch (Exception e) { |
| | | log.error("删除附件失败,附件ID: {}, 错误: {}", attachment.getId(), e.getMessage()); |
| | | // 继续删除其他附件,不中断整个流程 |
| | | } |
| | | } |
| | | // List<OrderAttachment> attachments = orderAttachmentMapper.selectByOrderId(orderId); |
| | | // for (OrderAttachment attachment : attachments) { |
| | | // try { |
| | | // // 删除MinIO中的文件 |
| | | // if (StringUtils.hasText(attachment.getObjectName())) { |
| | | // log.info("删除MinIO文件,对象名称: {}", attachment.getObjectName()); |
| | | // minioService.deleteFile(attachment.getObjectName()); |
| | | // } |
| | | // // 删除数据库记录 |
| | | // orderAttachmentMapper.deleteById(attachment.getId()); |
| | | // log.info("删除附件记录成功,附件ID: {}", attachment.getId()); |
| | | // } catch (Exception e) { |
| | | // log.error("删除附件失败,附件ID: {}, 错误: {}", attachment.getId(), e.getMessage()); |
| | | // // 继续删除其他附件,不中断整个流程 |
| | | // } |
| | | // } |
| | | |
| | | // 2. 逻辑删除订单详情 |
| | | log.info("开始逻辑删除订单详情,订单ID: {}", orderId); |
| | | // log.info("开始逻辑删除订单详情,订单ID: {}", orderId); |
| | | // 先查询订单详情列表,然后逐个逻辑删除 |
| | | List<OrderDetail> orderDetails = orderDetailMapper.selectByOrderId(orderId); |
| | | int detailDeleted = 0; |
| | | for (OrderDetail detail : orderDetails) { |
| | | int result = orderDetailMapper.deleteById(detail.getId()); |
| | | if (result > 0) { |
| | | detailDeleted++; |
| | | } |
| | | } |
| | | log.info("逻辑删除订单详情完成,影响行数: {}", detailDeleted); |
| | | // List<OrderDetail> orderDetails = orderDetailMapper.selectByOrderId(orderId); |
| | | // int detailDeleted = 0; |
| | | // for (OrderDetail detail : orderDetails) { |
| | | // int result = orderDetailMapper.deleteById(detail.getId()); |
| | | // if (result > 0) { |
| | | // detailDeleted++; |
| | | // } |
| | | // } |
| | | // log.info("逻辑删除订单详情完成,影响行数: {}", detailDeleted); |
| | | |
| | | // 3. 删除订单信息(逻辑删除) |
| | | log.info("开始删除订单信息,订单ID: {}", orderId); |
| | | int orderDeleted = this.baseMapper.deleteById(orderId); |
| | | log.info("删除订单信息完成,影响行数: {}", orderDeleted); |
| | | // log.info("开始删除订单信息,订单ID: {}", orderId); |
| | | // int orderDeleted = this.baseMapper.deleteById(orderId); |
| | | // log.info("删除订单信息完成,影响行数: {}", orderDeleted); |
| | | // 更新订单状态为已完成 |
| | | orderInfo.setOrderStatus("已取消"); |
| | | orderInfo.setUpdatedAt(LocalDateTime.now()); |
| | | int orderDeleted = this.baseMapper.updateById(orderInfo); |
| | | |
| | | if (orderDeleted > 0) { |
| | | log.info("订单取消成功,订单ID: {}", orderId); |
| | | return true; |
| | | } else { |
| | | log.error("删除订单信息失败,影响行数为0,订单ID: {}", orderId); |
| | | log.error("更新订单信息失败,影响行数为0,订单ID: {}", orderId); |
| | | throw new BusinessException("删除订单信息失败"); |
| | | } |
| | | } catch (Exception e) { |