Commit 650cf755 by 王志超

feat: 商品变更,增加供应商绑定

parent 3a741225
...@@ -188,6 +188,13 @@ public class ChangeFlowBiz { ...@@ -188,6 +188,13 @@ public class ChangeFlowBiz {
private String createProductChangeFlow(ChangeFlowCreateReq changeFlowCreateReq, String uid, String name) { private String createProductChangeFlow(ChangeFlowCreateReq changeFlowCreateReq, String uid, String name) {
// 商品变更:校验商品不能为空 // 商品变更:校验商品不能为空
Assert.isTrue(StringUtils.isNotBlank(changeFlowCreateReq.getChangeItems()), "变更商品不可为空"); Assert.isTrue(StringUtils.isNotBlank(changeFlowCreateReq.getChangeItems()), "变更商品不可为空");
// 商品变更需要关联供应商
if (CreateSourceEnum.TONG_ZHOU.getType().equals(changeFlowCreateReq.getCreateSource())) {
// 供应商发起:取当前人为供应商
changeFlowCreateReq.setChangeSupplier(uid);
} else {
Assert.isTrue(StringUtils.isNotBlank(changeFlowCreateReq.getChangeSupplier()), "变更供应商不可为空");
}
// 解析商品ID列表 // 解析商品ID列表
List<Long> itemIds = parseItemIds(changeFlowCreateReq.getChangeItems()); List<Long> itemIds = parseItemIds(changeFlowCreateReq.getChangeItems());
// 执行公共创建流程(内部已处理邮件逻辑) // 执行公共创建流程(内部已处理邮件逻辑)
...@@ -539,6 +546,8 @@ public class ChangeFlowBiz { ...@@ -539,6 +546,8 @@ public class ChangeFlowBiz {
// 当变更类型是商品时有值 // 当变更类型是商品时有值
changeRecord.setChangeItem(changeFlowCreateReq.getChangeItems()); changeRecord.setChangeItem(changeFlowCreateReq.getChangeItems());
changeRecord.setChangeSku(changeFlowCreateReq.getChangeSkus()); changeRecord.setChangeSku(changeFlowCreateReq.getChangeSkus());
// 商品变更需要关联供应商
changeRecord.setChangeSupplier(changeFlowCreateReq.getChangeSupplier());
} }
if (ChangeSubjectEnum.SUPPLIER.getType().equals(changeFlowCreateReq.getChangeSubject())) { if (ChangeSubjectEnum.SUPPLIER.getType().equals(changeFlowCreateReq.getChangeSubject())) {
changeRecord.setChangeSupplier(changeFlowCreateReq.getChangeSupplier()); changeRecord.setChangeSupplier(changeFlowCreateReq.getChangeSupplier());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment