|
@@ -8,16 +8,21 @@ import com.ruoyi.common.core.domain.BasePo;
|
|
|
import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.sd.business.entity.order.dto.OrderFlowExampleDto;
|
|
|
import com.sd.business.entity.order.dto.OrderInfoDto;
|
|
|
+import com.sd.business.entity.order.dto.OrderSkuDto;
|
|
|
import com.sd.business.entity.order.enums.OrderStatusEnum;
|
|
|
import com.sd.business.entity.order.po.OrderFlowExample;
|
|
|
import com.sd.business.entity.order.po.OrderInfo;
|
|
|
import com.sd.business.service.order.OrderFlowExampleService;
|
|
|
import com.sd.business.service.order.OrderService;
|
|
|
import com.sd.business.service.production.ProductionWorkOrderService;
|
|
|
+import com.sd.mq.config.ArtworkConfig;
|
|
|
+import com.sd.mq.entity.TempArtworkMessage;
|
|
|
+import com.sd.mq.util.RabbitMqUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Date;
|
|
|
+import java.util.List;
|
|
|
|
|
|
/**
|
|
|
* 发起采购流程
|
|
@@ -88,6 +93,8 @@ public class OrderFlow extends FlowDelegate {
|
|
|
.set(BasePo::getUpdateTime, new Date())
|
|
|
.set(BasePo::getUpdateUser, SecurityUtils.getUserId()));
|
|
|
|
|
|
+ sendMq(dto);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -127,4 +134,23 @@ public class OrderFlow extends FlowDelegate {
|
|
|
returnToOriginator(flowId, businessId, flowStatus);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ private void sendMq(OrderInfoDto dto) {
|
|
|
+
|
|
|
+ List<OrderSkuDto> orderSkuList = dto.getOrderSkuList();
|
|
|
+
|
|
|
+ for (OrderSkuDto orderSkuDto : orderSkuList) {
|
|
|
+
|
|
|
+ if (orderSkuDto.getArtworkLibraryId() == null || orderSkuDto.getArtworkLibraryId() == 0L) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ TempArtworkMessage tempArtworkMessage = new TempArtworkMessage();
|
|
|
+ tempArtworkMessage.setImgUrl(orderSkuDto.getBlueprint());
|
|
|
+ tempArtworkMessage.setFileUrl(orderSkuDto.getProductionDocument());
|
|
|
+
|
|
|
+ RabbitMqUtil.send(ArtworkConfig.DIRECT_EXCHANGE_NAME, ArtworkConfig.TEMP_ARTWORK_QUEUE_NAME, tempArtworkMessage);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|