|
|
@@ -378,7 +378,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
//给角色为派工的人发送消息
|
|
|
R<String> clientDeptIds = sysClient.getRoleIds(AuthUtil.getTenantId(), "库管");
|
|
|
if (clientDeptIds.isSuccess() && StringUtils.isNotBlank(clientDeptIds.getData())) {
|
|
|
- R<List<User>> userList = userClient.listUserByRoleId(clientDeptIds.getData(), AuthUtil.getTenantId(), item.getSalesCompanyId()+"");
|
|
|
+ R<List<User>> userList = userClient.listUserByRoleId(clientDeptIds.getData(), AuthUtil.getTenantId(), item.getSalesCompanyId() + "");
|
|
|
if (userList.isSuccess() && CollectionUtils.isNotEmpty(userList.getData())) {
|
|
|
for (User datum : userList.getData()) {
|
|
|
//循环发送消息
|
|
|
@@ -409,7 +409,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
R<String> clientDeptIds = sysClient.getRoleIds(AuthUtil.getTenantId(), "客服");
|
|
|
StringBuilder openIds = new StringBuilder();
|
|
|
if (clientDeptIds.isSuccess() && StringUtils.isNotBlank(clientDeptIds.getData())) {
|
|
|
- R<List<User>> userList = userClient.listUserByRoleId(clientDeptIds.getData(), AuthUtil.getTenantId(), rwShip.getSalesCompanyId()+"");
|
|
|
+ R<List<User>> userList = userClient.listUserByRoleId(clientDeptIds.getData(), AuthUtil.getTenantId(), rwShip.getSalesCompanyId() + "");
|
|
|
if (userList.isSuccess() && CollectionUtils.isNotEmpty(userList.getData())) {
|
|
|
for (User datum : userList.getData()) {
|
|
|
if (ObjectUtils.isNotNull(datum.getOaOpenId())) {
|
|
|
@@ -914,7 +914,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
//给角色为派工的人发送消息
|
|
|
R<String> clientDeptIds = sysClient.getRoleIds(AuthUtil.getTenantId(), "库管");
|
|
|
if (clientDeptIds.isSuccess() && StringUtils.isNotBlank(clientDeptIds.getData())) {
|
|
|
- R<List<User>> userList = userClient.listUserByRoleId(clientDeptIds.getData(), AuthUtil.getTenantId(), item.getSalesCompanyId()+"");
|
|
|
+ R<List<User>> userList = userClient.listUserByRoleId(clientDeptIds.getData(), AuthUtil.getTenantId(), item.getSalesCompanyId() + "");
|
|
|
if (userList.isSuccess() && CollectionUtils.isNotEmpty(userList.getData())) {
|
|
|
for (User datum : userList.getData()) {
|
|
|
//循环发送消息
|
|
|
@@ -1044,12 +1044,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
stockDesc.setGoodsTypeName(goodsType.getCname());
|
|
|
}
|
|
|
}
|
|
|
- if (ObjectUtil.isNotEmpty(storageDesc)) {
|
|
|
- stockDesc.setStorageId(storageDesc.getId());
|
|
|
- stockDesc.setStorageName(storageDesc.getCname());
|
|
|
- } else {
|
|
|
- throw new RuntimeException("仓库数据异常");
|
|
|
- }
|
|
|
stockDesc.setGoodsId(goodsDesc.getId());
|
|
|
stockDesc.setCode(item.getGoodsNo());
|
|
|
stockDesc.setCname(goodsDesc.getCname());
|
|
|
@@ -1076,6 +1070,12 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
&& ObjectUtils.isNull(e.getDot())).findFirst().orElse(null);
|
|
|
}
|
|
|
if (stockOne == null) {
|
|
|
+ if (ObjectUtil.isNotEmpty(storageDesc)) {
|
|
|
+ stockDesc.setStorageId(storageDesc.getId());
|
|
|
+ stockDesc.setStorageName(storageDesc.getCname());
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("仓库数据异常");
|
|
|
+ }
|
|
|
stockDesc.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
stockDesc.setCreateTime(new Date());
|
|
|
stockDesc.setCreateUser(AuthUtil.getUserId());
|
|
|
@@ -1125,7 +1125,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
throw new RuntimeException("商品数据异常");
|
|
|
}
|
|
|
/* ----------------------修改上架库存---------------------- */
|
|
|
- List<PjStockDesc> stockDescList = pjStockDescList.stream().filter(e -> e.getGoodsId().equals(goodsDesc.getId())).collect(Collectors.toList());
|
|
|
+ /* List<PjStockDesc> stockDescList = pjStockDescList.stream().filter(e -> e.getGoodsId().equals(goodsDesc.getId())).collect(Collectors.toList());
|
|
|
|
|
|
//库存总数量
|
|
|
BigDecimal balanceQuantity = stockDescList.stream().map(PjStockDesc::getBalanceQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
@@ -1138,8 +1138,14 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
e.setInventory(balanceQuantity);
|
|
|
pjProductLaunchList.add(e);
|
|
|
}
|
|
|
+ }*/
|
|
|
+ PjProductLaunch pjProductLaunches = productLaunch.stream()
|
|
|
+ .filter(i -> i.getGoodsId().equals(goodsDesc.getId())).findFirst().orElse(null);
|
|
|
+ //修改上架数量
|
|
|
+ if (pjProductLaunches != null) {
|
|
|
+ pjProductLaunches.setInventory(pjProductLaunches.getInventory().add(item.getSendNum()));
|
|
|
+ pjProductLaunchList.add(pjProductLaunches);
|
|
|
}
|
|
|
-
|
|
|
/* ----------------------修改上架库存---------------------- */
|
|
|
}
|
|
|
R res = productLaunchService.updateBatchById(pjProductLaunchList);
|
|
|
@@ -1476,7 +1482,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
|
|
|
for (PjShipItems item : ship.getShipItemsList()) {
|
|
|
/* ----------------------修改上架库存---------------------- */
|
|
|
- List<PjStockDesc> stockDescList = pjStockDescList.stream().filter(e -> e.getGoodsId().equals(item.getGoodsId())).collect(Collectors.toList());
|
|
|
+// List<PjStockDesc> stockDescList = pjStockDescList.stream().filter(e -> e.getGoodsId().equals(item.getGoodsId())).collect(Collectors.toList());
|
|
|
PjOrderItems orderItems = pjOrderItems.stream().filter(e -> e.getId().equals(item.getSrcItemId())).findFirst().orElse(null);
|
|
|
if (orderItems != null) {
|
|
|
orderItems.setSendNum(orderItems.getSendNum().subtract(item.getSendNum()));
|
|
|
@@ -1485,7 +1491,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
throw new RuntimeException("数据异常请联系管理员");
|
|
|
}
|
|
|
|
|
|
- //库存总数量
|
|
|
+ /*//库存总数量
|
|
|
BigDecimal balanceQuantity = stockDescList.stream().map(PjStockDesc::getBalanceQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
|
|
|
List<PjProductLaunch> pjProductLaunches = productLaunch.stream().filter(e -> e.getGoodsId().equals(item.getGoodsId())).collect(Collectors.toList());
|
|
|
@@ -1495,6 +1501,13 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
e.setInventory(balanceQuantity);
|
|
|
pjProductLaunchList.add(e);
|
|
|
}
|
|
|
+ }*/
|
|
|
+ PjProductLaunch pjProductLaunches = productLaunch.stream()
|
|
|
+ .filter(i -> i.getGoodsId().equals(item.getId())).findFirst().orElse(null);
|
|
|
+ //修改上架数量
|
|
|
+ if (pjProductLaunches != null) {
|
|
|
+ pjProductLaunches.setInventory(pjProductLaunches.getInventory().subtract(item.getSendNum()));
|
|
|
+ pjProductLaunchList.add(pjProductLaunches);
|
|
|
}
|
|
|
/* ----------------------修改上架库存---------------------- */
|
|
|
}
|