Commit 1b46a0487dac3809a39cc52a1e223fae618f47f3

Authored by yeqianyong
1 parent b5f96c99

楚江ERP-1、发货单详情增加签收单据文件ID、名称;2、订货单变更列表bug修复;3、发货单录入是发数据后消息通知

... ... @@ -102,6 +102,18 @@ public class GetShipmentsOrderInfoBo extends BaseBo<ShipmentsOrderInfo> {
102 102 private String status;
103 103
104 104 /**
  105 + * 签收单据文件ID
  106 + */
  107 + @ApiModelProperty("签收单据文件ID")
  108 + private String fileId;
  109 +
  110 + /**
  111 + * 签收单据文件名称
  112 + */
  113 + @ApiModelProperty("签收单据文件名称")
  114 + private String fileName;
  115 +
  116 + /**
105 117 * 发货明细数据
106 118 */
107 119 @ApiModelProperty("发货明细数据")
... ... @@ -149,6 +161,7 @@ public class GetShipmentsOrderInfoBo extends BaseBo<ShipmentsOrderInfo> {
149 161
150 162 @Override
151 163 protected void afterInit(ShipmentsOrderInfo dto) {
152   -
  164 + this.fileId = dto.getReceiptsId();
  165 + this.fileName = dto.getReceiptsName();
153 166 }
154 167 }
... ...
... ... @@ -184,7 +184,7 @@ public class ShipmentsOrderInfoController extends DefaultBaseController {
184 184 */
185 185 @ApiOperation("明细数据补充录入")
186 186 @HasPermission({"shipping-plan-manage:shipping-plan:query"})
187   - @GetMapping("/dataReplenishInput")
  187 + @PostMapping("/dataReplenishInput")
188 188 public InvokeResult<Void> dataReplenishInput(@Valid @RequestBody ShipmentsOrderVo vo) {
189 189 shipmentsOrderInfoService.dataReplenishInput(vo);
190 190 return InvokeResultBuilder.success();
... ...
... ... @@ -382,7 +382,13 @@ public class OrderChangeRecordServiceImpl extends BaseMpServiceImpl<OrderChangeR
382 382 .eq(OrderInfoChangeRecord::getId, id);
383 383 getBaseMapper().update(updateWrapper);
384 384 // 消息通知
385   - messageHandler.sendMsg(record.getCreateById(), Collections.singletonList("jybjhy"), "SPEC_CHANGE_SUBMIT", null);
  385 + List<String> roleCodes = new ArrayList<>();
  386 + // 各个分厂经营办计划员
  387 + roleCodes.add("yfcjybjhy");
  388 + roleCodes.add("efcjybjhy");
  389 + roleCodes.add("sfcjybjhy");
  390 + roleCodes.add("ztfcjybjhy");
  391 + messageHandler.sendMsg(record.getCreateById(), roleCodes, "SPEC_CHANGE_SUBMIT", null);
386 392 }
387 393
388 394 @Override
... ...
... ... @@ -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
... ...
... ... @@ -22,6 +22,15 @@ public class ShipmentsOrderVo implements BaseVo, Serializable {
22 22 @NotBlank(message = "id不能为空!")
23 23 private String id;
24 24
  25 + /**
  26 + * 类型
  27 + * ALL:全部发货
  28 + * PART:部分发货
  29 + */
  30 + @ApiModelProperty(value = "type", required = true)
  31 + @NotBlank(message = "类型不能为空!")
  32 + private String type;
  33 +
25 34
26 35 @ApiModelProperty(value = "发货单明细")
27 36 @NotEmpty(message = "发货单明细不能为空!")
... ...
... ... @@ -75,6 +75,7 @@
75 75 tb.customer_credit_id,
76 76 cc.company_suggested_category AS customer_tier,
77 77 tb.total_quantity,
  78 + tb.output,
78 79 tb.create_by_id,
79 80 tb.create_by,
80 81 tb.update_by_id,
... ...