|
@@ -1092,6 +1092,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
}
|
|
}
|
|
|
item.setTotalAmount(totalAmount);
|
|
item.setTotalAmount(totalAmount);
|
|
|
if (item.getId() == null) {
|
|
if (item.getId() == null) {
|
|
|
|
|
+ item.setStatus("录入");
|
|
|
item.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
item.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
|
|
|
item.setCreateTime(new Date());
|
|
item.setCreateTime(new Date());
|
|
|
item.setCreateUser(AuthUtil.getUserId());
|
|
item.setCreateUser(AuthUtil.getUserId());
|
|
@@ -1264,7 +1265,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
stockOne.setBalanceQuantity(item.getSendNum());
|
|
stockOne.setBalanceQuantity(item.getSendNum());
|
|
|
- stockOne.setBalanceQuantityHave(item.getSendNum());
|
|
|
|
|
|
|
+ stockOne.setBalanceQuantityHave(item.getSendNumHave());
|
|
|
stockOne.setStoreInventory(stockOne.getBalanceQuantity());
|
|
stockOne.setStoreInventory(stockOne.getBalanceQuantity());
|
|
|
stockOne.setInventoryAmount(item.getSubTotalMoney());
|
|
stockOne.setInventoryAmount(item.getSubTotalMoney());
|
|
|
stockOne.setRebateInventoryAmount(item.getSendNum().multiply(stockOne.getRebatePrice()));
|
|
stockOne.setRebateInventoryAmount(item.getSendNum().multiply(stockOne.getRebatePrice()));
|
|
@@ -1825,7 +1826,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
.eq(PjShip::getOrdId, order.getId())
|
|
.eq(PjShip::getOrdId, order.getId())
|
|
|
.eq(PjShip::getBizTypeName, "TKFHRW"));
|
|
.eq(PjShip::getBizTypeName, "TKFHRW"));
|
|
|
if (ObjectUtils.isNotNull(pjShip) && (ObjectUtils.isNull(pjShip.getSendTotalNum()) || new BigDecimal("0.00").compareTo(pjShip.getSendTotalNum()) == 0)) {
|
|
if (ObjectUtils.isNotNull(pjShip) && (ObjectUtils.isNull(pjShip.getSendTotalNum()) || new BigDecimal("0.00").compareTo(pjShip.getSendTotalNum()) == 0)) {
|
|
|
- shipMapper.deleteById(pjShip.getId());
|
|
|
|
|
|
|
+ pjShip.setIsDeleted(1);
|
|
|
|
|
+// shipMapper.deleteById(pjShip.getId());
|
|
|
|
|
+ shipMapper.updateById(pjShip);
|
|
|
shipMapper.deleteByTaskId(pjShip.getId());
|
|
shipMapper.deleteByTaskId(pjShip.getId());
|
|
|
} else {
|
|
} else {
|
|
|
throw new RuntimeException("出库已完成,禁止撤销!");
|
|
throw new RuntimeException("出库已完成,禁止撤销!");
|
|
@@ -2050,7 +2053,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
.eq(PjShip::getOrdId, order.getId())
|
|
.eq(PjShip::getOrdId, order.getId())
|
|
|
.eq(PjShip::getBizTypeName, "THSHRW"));
|
|
.eq(PjShip::getBizTypeName, "THSHRW"));
|
|
|
if (ObjectUtils.isNotNull(pjShip) && (ObjectUtils.isNull(pjShip.getSendTotalNum()) || new BigDecimal("0.00").compareTo(pjShip.getSendTotalNum()) == 0)) {
|
|
if (ObjectUtils.isNotNull(pjShip) && (ObjectUtils.isNull(pjShip.getSendTotalNum()) || new BigDecimal("0.00").compareTo(pjShip.getSendTotalNum()) == 0)) {
|
|
|
- shipMapper.deleteById(pjShip.getId());
|
|
|
|
|
|
|
+// shipMapper.deleteById(pjShip.getId());
|
|
|
|
|
+ pjShip.setIsDeleted(1);
|
|
|
|
|
+ shipMapper.updateById(pjShip);
|
|
|
shipMapper.deleteByTaskId(pjShip.getId());
|
|
shipMapper.deleteByTaskId(pjShip.getId());
|
|
|
} else {
|
|
} else {
|
|
|
throw new RuntimeException("入库已完成,禁止撤销!");
|
|
throw new RuntimeException("入库已完成,禁止撤销!");
|
|
@@ -3016,6 +3021,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public R revokeWarehouse(PjOrder detatil) {
|
|
public R revokeWarehouse(PjOrder detatil) {
|
|
|
PjOrder order = baseMapper.selectById(detatil.getId());
|
|
PjOrder order = baseMapper.selectById(detatil.getId());
|
|
|
|
|
+ if ("1".equals(order.getWhetherRedeem())) {
|
|
|
|
|
+ throw new RuntimeException("单据已赎回,撤销失败");
|
|
|
|
|
+ }
|
|
|
order.setConfirmWarehouse("0");
|
|
order.setConfirmWarehouse("0");
|
|
|
order.setUpdateUserName(AuthUtil.getUserName());
|
|
order.setUpdateUserName(AuthUtil.getUserName());
|
|
|
order.setUpdateUser(AuthUtil.getUserId());
|
|
order.setUpdateUser(AuthUtil.getUserId());
|
|
@@ -3310,6 +3318,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
&& ObjectUtils.isNull(e.getDot())).findFirst().orElse(null);
|
|
&& ObjectUtils.isNull(e.getDot())).findFirst().orElse(null);
|
|
|
}
|
|
}
|
|
|
if (stockOne != null) {
|
|
if (stockOne != null) {
|
|
|
|
|
+ if (stockOne.getBalanceQuantityHave().compareTo(item.getRedeemNum()) < 0) {
|
|
|
|
|
+ throw new RuntimeException("商品:" + goodsDesc.getCname() + " 剩余自有库存" + stockOne.getBalanceQuantityHave() + "小于赎回数量" + item.getRedeemNum() + ",撤销失败");
|
|
|
|
|
+ }
|
|
|
stockOne.setBalanceQuantityHave(stockOne.getBalanceQuantityHave().subtract(item.getRedeemNum()));
|
|
stockOne.setBalanceQuantityHave(stockOne.getBalanceQuantityHave().subtract(item.getRedeemNum()));
|
|
|
stockOne.setBalanceQuantityFinancing(stockOne.getBalanceQuantityFinancing().add(item.getRedeemNum()));
|
|
stockOne.setBalanceQuantityFinancing(stockOne.getBalanceQuantityFinancing().add(item.getRedeemNum()));
|
|
|
stockOne.setVersion(stockOne.getVersion());
|
|
stockOne.setVersion(stockOne.getVersion());
|
|
@@ -6278,7 +6289,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
if ("已完成".equals(pjShip.getStatusName())) {
|
|
if ("已完成".equals(pjShip.getStatusName())) {
|
|
|
throw new RuntimeException("出库已完成,禁止撤销!");
|
|
throw new RuntimeException("出库已完成,禁止撤销!");
|
|
|
} else {
|
|
} else {
|
|
|
- shipMapper.deleteById(pjShip.getId());
|
|
|
|
|
|
|
+ pjShip.setIsDeleted(1);
|
|
|
|
|
+ shipMapper.updateById(pjShip);
|
|
|
|
|
+// shipMapper.deleteById(pjShip.getId());
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
throw new RuntimeException("出库已完成,禁止撤销!");
|
|
throw new RuntimeException("出库已完成,禁止撤销!");
|
|
@@ -6290,7 +6303,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
if ("已出库".equals(ship.getStatusName())) {
|
|
if ("已出库".equals(ship.getStatusName())) {
|
|
|
throw new RuntimeException("出库已完成,禁止撤销!");
|
|
throw new RuntimeException("出库已完成,禁止撤销!");
|
|
|
} else {
|
|
} else {
|
|
|
- shipMapper.deleteById(ship.getId());
|
|
|
|
|
|
|
+// shipMapper.deleteById(ship.getId());
|
|
|
|
|
+ ship.setIsDeleted(1);
|
|
|
|
|
+ shipMapper.updateById(ship);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
pjOrder.setTaskWhetherAdopt("录入");
|
|
pjOrder.setTaskWhetherAdopt("录入");
|
|
@@ -6328,6 +6343,11 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
productLaunchListNew.add(pjProductLaunch);
|
|
productLaunchListNew.add(pjProductLaunch);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ e.setSendNum(new BigDecimal("0.00"));
|
|
|
|
|
+ e.setUpdateTime(new Date());
|
|
|
|
|
+ e.setUpdateUser(AuthUtil.getUserId());
|
|
|
|
|
+ e.setSendNumHave(new BigDecimal("0.00"));
|
|
|
|
|
+ e.setSendNumFinancing(new BigDecimal("0.00"));
|
|
|
});
|
|
});
|
|
|
String stata = sysClient.paramServiceValue(AuthUtil.getTenantId(), "whether.open.share");
|
|
String stata = sysClient.paramServiceValue(AuthUtil.getTenantId(), "whether.open.share");
|
|
|
if (!productLaunchListNew.isEmpty() && "1".equals(stata)) {
|
|
if (!productLaunchListNew.isEmpty() && "1".equals(stata)) {
|
|
@@ -7373,7 +7393,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
if ("已完成".equals(pjShip.getStatusName())) {
|
|
if ("已完成".equals(pjShip.getStatusName())) {
|
|
|
throw new RuntimeException("入库已完成,禁止撤销!");
|
|
throw new RuntimeException("入库已完成,禁止撤销!");
|
|
|
} else {
|
|
} else {
|
|
|
- shipMapper.deleteById(pjShip.getId());
|
|
|
|
|
|
|
+// shipMapper.deleteById(pjShip.getId());
|
|
|
|
|
+ pjShip.setIsDeleted(1);
|
|
|
|
|
+ shipMapper.updateById(pjShip);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
PjShip ship = shipMapper.selectOne(new LambdaQueryWrapper<PjShip>().eq(PjShip::getIsDeleted, 0)
|
|
PjShip ship = shipMapper.selectOne(new LambdaQueryWrapper<PjShip>().eq(PjShip::getIsDeleted, 0)
|
|
@@ -7383,7 +7405,9 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
|
|
|
if ("已入库".equals(ship.getStatusName())) {
|
|
if ("已入库".equals(ship.getStatusName())) {
|
|
|
throw new RuntimeException("入库已完成,禁止撤销!");
|
|
throw new RuntimeException("入库已完成,禁止撤销!");
|
|
|
} else {
|
|
} else {
|
|
|
- shipMapper.deleteById(ship.getId());
|
|
|
|
|
|
|
+// shipMapper.deleteById(ship.getId());
|
|
|
|
|
+ ship.setIsDeleted(1);
|
|
|
|
|
+ shipMapper.updateById(ship);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
pjOrder.setVersion(pjOrder.getVersion() + 1);
|
|
pjOrder.setVersion(pjOrder.getVersion() + 1);
|