|
...
|
...
|
@@ -23,6 +23,7 @@ import com.lframework.starter.common.utils.ObjectUtil; |
|
23
|
23
|
import com.lframework.starter.web.core.annotations.oplog.OpLog;
|
|
24
|
24
|
import com.lframework.starter.common.utils.Assert;
|
|
25
|
25
|
import com.lframework.starter.web.inner.components.oplog.OtherOpLogType;
|
|
|
26
|
+import com.lframework.xingyun.sc.handlers.MessageHandler;
|
|
26
|
27
|
import com.lframework.xingyun.sc.service.order.PurchaseOrderInfoService;
|
|
27
|
28
|
import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanDetailService;
|
|
28
|
29
|
import com.lframework.xingyun.sc.service.shipments.ShipmentsPlanService;
|
|
...
|
...
|
@@ -74,6 +75,9 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr |
|
74
|
75
|
private RequestCarTicketService requestCarTicketService;
|
|
75
|
76
|
@Resource
|
|
76
|
77
|
private RedisHandler redisHandler;
|
|
|
78
|
+ @Resource
|
|
|
79
|
+ private MessageHandler messageHandler;
|
|
|
80
|
+
|
|
77
|
81
|
|
|
78
|
82
|
|
|
79
|
83
|
@Override
|
|
...
|
...
|
@@ -309,6 +313,7 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr |
|
309
|
313
|
if (CollectionUtils.isEmpty(shipmentsOrderDetailList)) {
|
|
310
|
314
|
throw new DefaultClientException("发货单明细不存在!");
|
|
311
|
315
|
}
|
|
|
316
|
+ List<String> orderIds = new ArrayList<>();
|
|
312
|
317
|
List<String> partShipmentsOrderIds = new ArrayList<>();
|
|
313
|
318
|
List<String> shipmentsOrderIds = new ArrayList<>();
|
|
314
|
319
|
List<ShipmentsPlanDetail> dataList = new ArrayList<>();
|
|
...
|
...
|
@@ -333,6 +338,9 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr |
|
333
|
338
|
partShipmentsOrderIds.add(info.getOrderId());
|
|
334
|
339
|
}
|
|
335
|
340
|
dataList.add(detail);
|
|
|
341
|
+ if (!orderIds.contains(info.getOrderId())) {
|
|
|
342
|
+ orderIds.add(detail.getOrderId());
|
|
|
343
|
+ }
|
|
336
|
344
|
}
|
|
337
|
345
|
// 更新发货明细
|
|
338
|
346
|
shipmentsPlanDetailService.updateBatchById(dataList);
|
|
...
|
...
|
@@ -341,6 +349,27 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr |
|
341
|
349
|
// 更新订货单状态
|
|
342
|
350
|
purchaseOrderInfoService.updateStatus(shipmentsOrderIds, "SHIPPED");
|
|
343
|
351
|
purchaseOrderInfoService.updateStatus(partShipmentsOrderIds, "TRANSIT");
|
|
|
352
|
+ // 消息通知
|
|
|
353
|
+ String type = vo.getType();
|
|
|
354
|
+ List<PurchaseOrderInfo> orderInfoList = purchaseOrderInfoService.listByIds(orderIds);
|
|
|
355
|
+ if (CollectionUtils.isNotEmpty(orderInfoList)) {
|
|
|
356
|
+ List<String> userIds = new ArrayList<>();
|
|
|
357
|
+ StringBuilder orderNoBuilder = new StringBuilder();
|
|
|
358
|
+ for (PurchaseOrderInfo info : orderInfoList) {
|
|
|
359
|
+ userIds.add(info.getContractCreateById());
|
|
|
360
|
+ orderNoBuilder.append(info.getOrderNo()).append("、");
|
|
|
361
|
+ }
|
|
|
362
|
+ if (orderNoBuilder.length() > 0) {
|
|
|
363
|
+ orderNoBuilder.setLength(orderNoBuilder.length() - 1);
|
|
|
364
|
+ }
|
|
|
365
|
+ String title = "订货单:" + orderNoBuilder + ",";
|
|
|
366
|
+ if ("ALL".equals(type)) {
|
|
|
367
|
+ title += "已全部发货!";
|
|
|
368
|
+ } else if ("PART".equals(type)) {
|
|
|
369
|
+ title += "已部分发货!";
|
|
|
370
|
+ }
|
|
|
371
|
+ messageHandler.sendMsg(userIds, title, "", "", null);
|
|
|
372
|
+ }
|
|
344
|
373
|
}
|
|
345
|
374
|
|
|
346
|
375
|
@Override
|
...
|
...
|
|