| | |
| | | import com.ruoyi.common.utils.api.IfsApiUtils; |
| | | import com.ruoyi.framework.exception.ErrorException; |
| | | import com.ruoyi.inspect.dto.*; |
| | | import com.ruoyi.inspect.event.InsOrderDeletingEvent; |
| | | import com.ruoyi.inspect.mapper.*; |
| | | import com.ruoyi.inspect.pojo.*; |
| | | import com.ruoyi.inspect.service.InsOrderService; |
| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.context.ApplicationEventPublisher; |
| | | import org.springframework.transaction.annotation.Isolation; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | |
| | | private InsUnqualifiedRetestProductMapper insUnqualifiedRetestProductMapper; |
| | | private IfsApiUtils ifsApiUtils; |
| | | private SpotCheckQuarterItemMapper spotCheckQuarterItemMapper; |
| | | private ApplicationEventPublisher applicationEventPublisher; |
| | | private StandardProductListMapper standardProductListMapper; |
| | | private StructureItemParameterMapper structureItemParameterMapper; |
| | | |
| | |
| | | return insOrder.getId(); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public boolean deleteReturnedOrder(Integer insOrderId) { |
| | | InsOrder order = insOrderMapper.selectById(insOrderId); |
| | | if (order == null) { |
| | | throw new ErrorException("成品订单不存在"); |
| | | } |
| | | if (!(Integer.valueOf(2).equals(order.getState()) || Integer.valueOf(3).equals(order.getState()))) { |
| | | throw new ErrorException("只有退回或撤销订单才能删除"); |
| | | } |
| | | Integer operatorId = SecurityUtils.getUserId().intValue(); |
| | | applicationEventPublisher.publishEvent(new InsOrderDeletingEvent(insOrderId, operatorId, LocalDateTime.now())); |
| | | return removeById(insOrderId); |
| | | } |
| | | |
| | | /** |
| | | * 添加检验项 |
| | | * |