|
|
@@ -926,14 +926,13 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Date date = new Date();
|
|
|
Calendar calendarDate = Calendar.getInstance();
|
|
|
calendarDate.setTime(date);
|
|
|
- calendarDate.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
+ calendarDate.add(Calendar.DAY_OF_MONTH, -90);
|
|
|
Date dateTime = calendarDate.getTime();
|
|
|
List<PjOrder> orderList = orderMapper.selectList(new LambdaQueryWrapper<PjOrder>()
|
|
|
.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjOrder::getIsDeleted, 0)
|
|
|
.eq(PjOrder::getWhetherFinancing, "1")
|
|
|
.eq(PjOrder::getBsType, "RZCG")
|
|
|
- .eq(PjOrder::getFundingPartyId, pjpfFunding.getFundingPartyId())
|
|
|
.ge(PjOrder::getBusinesDate, dateTime)
|
|
|
.apply("goods_total_ship_num > out_goods_total_ship_num")
|
|
|
.orderByAsc(PjOrder::getBusinesDate)
|
|
|
@@ -951,28 +950,31 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
.orderByAsc(PjOrderItems::getCreateTime)
|
|
|
);
|
|
|
if (!orderItemsList.isEmpty()) {
|
|
|
- if (pjpfFunding.getBondAmount().compareTo(pjpfFunding.getPaidAlreadyBondAmount()) > 0) {
|
|
|
- throw new RuntimeException("已缴保证金不足,出库失败");
|
|
|
- }
|
|
|
- BigDecimal amount = shipItemsList.stream().map(PjShipItems::getCostprie)
|
|
|
- .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
- if (pjpfFunding.getAvailableAmount().compareTo(amount) < 0) {
|
|
|
- throw new RuntimeException("剩余可用资金:" + pjpfFunding.getAvailableAmount() + "小于本次出库金额:" + amount + ",出库失败");
|
|
|
+ List<PjOrder> orders = orderList.stream().filter(e -> e.getWhetherRedeem().equals("0")).distinct().collect(Collectors.toList());
|
|
|
+ if (!orders.isEmpty()){
|
|
|
+ if (pjpfFunding.getBondAmount().compareTo(pjpfFunding.getPaidAlreadyBondAmount()) > 0) {
|
|
|
+ throw new RuntimeException("已缴保证金不足,出库失败");
|
|
|
+ }
|
|
|
+ BigDecimal amount = shipItemsList.stream().map(PjShipItems::getCostprie)
|
|
|
+ .filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ if (pjpfFunding.getAvailableAmount().compareTo(amount) < 0) {
|
|
|
+ throw new RuntimeException("剩余可用资金:" + pjpfFunding.getAvailableAmount() + "小于本次出库金额:" + amount + ",出库失败");
|
|
|
+ }
|
|
|
+ pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().subtract(amount));
|
|
|
+ PjpfFundingItem item = new PjpfFundingItem();
|
|
|
+ item.setPid(pjpfFunding.getId());
|
|
|
+ item.setTenantId(AuthUtil.getTenantId());
|
|
|
+ item.setCreateTime(new Date());
|
|
|
+ item.setCreateUser(AuthUtil.getUserId());
|
|
|
+ item.setCreateUserName(AuthUtil.getUserName());
|
|
|
+ item.setCreateDept(pjpfFunding.getCreateDept());
|
|
|
+ item.setCreateDeptName(pjpfFunding.getCreateDeptName());
|
|
|
+ item.setType("融资出库");
|
|
|
+ item.setSrcId(ship.getId());
|
|
|
+ item.setSrcNo(ship.getBillno());
|
|
|
+ item.setAmount(amount);
|
|
|
+ pjpfFundingItemService.save(item);
|
|
|
}
|
|
|
- pjpfFunding.setAvailableAmount(pjpfFunding.getAvailableAmount().subtract(amount));
|
|
|
- PjpfFundingItem item = new PjpfFundingItem();
|
|
|
- item.setPid(pjpfFunding.getId());
|
|
|
- item.setTenantId(AuthUtil.getTenantId());
|
|
|
- item.setCreateTime(new Date());
|
|
|
- item.setCreateUser(AuthUtil.getUserId());
|
|
|
- item.setCreateUserName(AuthUtil.getUserName());
|
|
|
- item.setCreateDept(pjpfFunding.getCreateDept());
|
|
|
- item.setCreateDeptName(pjpfFunding.getCreateDeptName());
|
|
|
- item.setType("融资出库");
|
|
|
- item.setSrcId(ship.getId());
|
|
|
- item.setSrcNo(ship.getBillno());
|
|
|
- item.setAmount(amount);
|
|
|
- pjpfFundingItemService.save(item);
|
|
|
}
|
|
|
List<FinancingShipItemDto> allList = new ArrayList<>();
|
|
|
List<ShipItemsRecord> recordList = new ArrayList<>();
|
|
|
@@ -983,6 +985,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
for (PjOrderItems orderItems1 : orderItemList) {
|
|
|
if (number.compareTo(new BigDecimal("0.00")) > 0) {
|
|
|
ShipItemsRecord shipItemsRecord = new ShipItemsRecord();
|
|
|
+ shipItemsRecord.setBillNo(ship.getBillno());
|
|
|
shipItemsRecord.setPid(shipItems.getPid());
|
|
|
shipItemsRecord.setItemId(shipItems.getId());
|
|
|
shipItemsRecord.setSrcId(orderItems1.getPid());
|
|
|
@@ -1057,7 +1060,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Date currentDate = new Date();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(currentDate);
|
|
|
- calendar.add(Calendar.DAY_OF_MONTH, -30);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
Date thirtyDayAgo = calendar.getTime();
|
|
|
BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
|
|
|
List<Long> itemIdList = allList.stream().filter(e -> e.getPid().equals(items.getId())).map(FinancingShipItemDto::getItemId).collect(Collectors.toList());
|
|
|
@@ -1342,7 +1345,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
List<PjOrder> orderList = orderMapper.selectList(new LambdaQueryWrapper<PjOrder>()
|
|
|
.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjOrder::getIsDeleted, 0)
|
|
|
- .eq(PjOrder::getFundingPartyId, pjpfFunding.getFundingPartyId())
|
|
|
.eq(PjOrder::getWhetherFinancing, "1")
|
|
|
.eq(PjOrder::getBsType, "RZCG")
|
|
|
);
|
|
|
@@ -1397,7 +1399,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Date currentDate = new Date();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(currentDate);
|
|
|
- calendar.add(Calendar.DAY_OF_MONTH, -30);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
Date thirtyDayAgo = calendar.getTime();
|
|
|
|
|
|
BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
|
|
|
@@ -1461,7 +1463,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Date currentDate = new Date();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(currentDate);
|
|
|
- calendar.add(Calendar.DAY_OF_MONTH, -30);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
Date thirtyDayAgo = calendar.getTime();
|
|
|
BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
|
|
|
List<Long> itemIdList = financingShipItemDtoList.stream().filter(e -> e.getPid().equals(items.getId())).map(FinancingShipItemDto::getId).collect(Collectors.toList());
|
|
|
@@ -2021,7 +2023,6 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
List<PjOrder> orderList = orderMapper.selectList(new LambdaQueryWrapper<PjOrder>()
|
|
|
.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjOrder::getIsDeleted, 0)
|
|
|
- .eq(PjOrder::getFundingPartyId, pjpfFunding.getFundingPartyId())
|
|
|
.eq(PjOrder::getWhetherFinancing, "1")
|
|
|
.eq(PjOrder::getBsType, "RZCG")
|
|
|
);
|
|
|
@@ -2076,7 +2077,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Date currentDate = new Date();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(currentDate);
|
|
|
- calendar.add(Calendar.DAY_OF_MONTH, -30);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
Date thirtyDayAgo = calendar.getTime();
|
|
|
|
|
|
BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
|
|
|
@@ -2140,7 +2141,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Date currentDate = new Date();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(currentDate);
|
|
|
- calendar.add(Calendar.DAY_OF_MONTH, -30);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
Date thirtyDayAgo = calendar.getTime();
|
|
|
BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
|
|
|
List<Long> itemIdList = financingShipItemDtoList.stream().filter(e -> e.getPid().equals(items.getId())).map(FinancingShipItemDto::getId).collect(Collectors.toList());
|
|
|
@@ -2606,14 +2607,13 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Date date = new Date();
|
|
|
Calendar calendarDate = Calendar.getInstance();
|
|
|
calendarDate.setTime(date);
|
|
|
- calendarDate.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
+ calendarDate.add(Calendar.DAY_OF_MONTH, -90);
|
|
|
Date dateTime = calendarDate.getTime();
|
|
|
List<PjOrder> orderList = orderMapper.selectList(new LambdaQueryWrapper<PjOrder>()
|
|
|
.eq(PjOrder::getTenantId, AuthUtil.getTenantId())
|
|
|
.eq(PjOrder::getIsDeleted, 0)
|
|
|
.eq(PjOrder::getWhetherFinancing, "1")
|
|
|
.eq(PjOrder::getBsType, "RZCG")
|
|
|
- .eq(PjOrder::getFundingPartyId, pjpfFunding.getFundingPartyId())
|
|
|
.ge(PjOrder::getBusinesDate, dateTime)
|
|
|
.apply("goods_total_ship_num > out_goods_total_ship_num")
|
|
|
.orderByAsc(PjOrder::getBusinesDate)
|
|
|
@@ -2663,6 +2663,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
for (PjOrderItems orderItems1 : orderItemList) {
|
|
|
if (number1.compareTo(new BigDecimal("0.00")) > 0) {
|
|
|
ShipItemsRecord shipItemsRecord = new ShipItemsRecord();
|
|
|
+ shipItemsRecord.setBillNo(ship.getBillno());
|
|
|
shipItemsRecord.setPid(shipItems.getPid());
|
|
|
shipItemsRecord.setItemId(shipItems.getId());
|
|
|
shipItemsRecord.setSrcId(orderItems1.getPid());
|
|
|
@@ -2737,7 +2738,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
Date currentDate = new Date();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(currentDate);
|
|
|
- calendar.add(Calendar.DAY_OF_MONTH, -30);
|
|
|
+ calendar.add(Calendar.DAY_OF_MONTH, -60);
|
|
|
Date thirtyDayAgo = calendar.getTime();
|
|
|
BigDecimal subAmount = items.getGoodsTotalShipAmount().subtract(items.getOutGoodsTotalShipAmount());
|
|
|
List<Long> itemIdList = allList.stream().filter(e -> e.getPid().equals(items.getId())).map(FinancingShipItemDto::getId).collect(Collectors.toList());
|
|
|
@@ -3639,6 +3640,7 @@ public class ShipServiceImpl extends ServiceImpl<ShipMapper, PjShip> implements
|
|
|
for (PjOrderItems orderItems1 : orderItemList) {
|
|
|
if (number1.compareTo(new BigDecimal("0.00")) > 0) {
|
|
|
ShipItemsRecord shipItemsRecord = new ShipItemsRecord();
|
|
|
+ shipItemsRecord.setBillNo(ship.getBillno());
|
|
|
shipItemsRecord.setPid(shipItems.getPid());
|
|
|
shipItemsRecord.setItemId(shipItems.getId());
|
|
|
shipItemsRecord.setSrcId(orderItems1.getPid());
|