|
@@ -2,7 +2,6 @@ package com.yc.ship.module.product.api;
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
|
|
import com.yc.ship.framework.common.util.collection.CollectionUtils;
|
|
import com.yc.ship.framework.common.util.collection.CollectionUtils;
|
|
|
import com.yc.ship.framework.common.util.collection.MapUtils;
|
|
import com.yc.ship.framework.common.util.collection.MapUtils;
|
|
|
import com.yc.ship.framework.common.util.object.BeanUtils;
|
|
import com.yc.ship.framework.common.util.object.BeanUtils;
|
|
@@ -598,8 +597,10 @@ public class VoyageApiImpl implements VoyageApi {
|
|
|
roomUsedDO.setOrderId(orderId);
|
|
roomUsedDO.setOrderId(orderId);
|
|
|
roomUsedDO.setVoyageId(voyageId);
|
|
roomUsedDO.setVoyageId(voyageId);
|
|
|
OrderRoomUseDTO roomRespDTO = roomIdMap.get(item.getRoomId());
|
|
OrderRoomUseDTO roomRespDTO = roomIdMap.get(item.getRoomId());
|
|
|
- roomUsedDO.setRoomModelId(roomRespDTO.getRoomModelId());
|
|
|
|
|
- roomUsedDO.setFloor(roomRespDTO.getFloor());
|
|
|
|
|
|
|
+ if(roomRespDTO!=null) {
|
|
|
|
|
+ roomUsedDO.setRoomModelId(roomRespDTO.getRoomModelId());
|
|
|
|
|
+ roomUsedDO.setFloor(roomRespDTO.getFloor());
|
|
|
|
|
+ }
|
|
|
roomUsedDO.setRoomId(item.getRoomId());
|
|
roomUsedDO.setRoomId(item.getRoomId());
|
|
|
roomUsedDO.setNum(item.getNum());
|
|
roomUsedDO.setNum(item.getNum());
|
|
|
roomUsedDO.setStatus(orderStatus);
|
|
roomUsedDO.setStatus(orderStatus);
|
|
@@ -714,8 +715,9 @@ public class VoyageApiImpl implements VoyageApi {
|
|
|
if (item.getNum() == null) {
|
|
if (item.getNum() == null) {
|
|
|
item.setNum(BigDecimal.ZERO);
|
|
item.setNum(BigDecimal.ZERO);
|
|
|
}
|
|
}
|
|
|
- item.setNum(item.getNum().add(totalNumMap.get(key)));
|
|
|
|
|
- item.setBookNum(item.getBookNum().subtract(totalNumMap.get(key)));
|
|
|
|
|
|
|
+ BigDecimal totalNum = MapUtils.getBigDecimal(totalNumMap, key);
|
|
|
|
|
+ item.setNum(item.getNum().add(totalNum));
|
|
|
|
|
+ item.setBookNum(item.getBookNum().subtract(totalNum));
|
|
|
if (item.getBookNum().compareTo(BigDecimal.ZERO) < 0) {
|
|
if (item.getBookNum().compareTo(BigDecimal.ZERO) < 0) {
|
|
|
item.setBookNum(BigDecimal.ZERO);
|
|
item.setBookNum(BigDecimal.ZERO);
|
|
|
}
|
|
}
|
|
@@ -749,7 +751,7 @@ public class VoyageApiImpl implements VoyageApi {
|
|
|
//门店ID
|
|
//门店ID
|
|
|
Long storeId = reqDTO.getStoreId();
|
|
Long storeId = reqDTO.getStoreId();
|
|
|
//总共使用房间数量
|
|
//总共使用房间数量
|
|
|
- BigDecimal totalUseNum = reqDTO.getUseRoomNum();
|
|
|
|
|
|
|
+ BigDecimal totalUseNum = reqDTO.getUseRoomNum()==null?BigDecimal.ZERO:reqDTO.getUseRoomNum();
|
|
|
Long orderId = reqDTO.getOrderId();
|
|
Long orderId = reqDTO.getOrderId();
|
|
|
Integer orderStatus = reqDTO.getOrderStatus();
|
|
Integer orderStatus = reqDTO.getOrderStatus();
|
|
|
|
|
|
|
@@ -1009,8 +1011,10 @@ public class VoyageApiImpl implements VoyageApi {
|
|
|
roomUsedDO.setOrderId(orderId);
|
|
roomUsedDO.setOrderId(orderId);
|
|
|
roomUsedDO.setVoyageId(voyageId);
|
|
roomUsedDO.setVoyageId(voyageId);
|
|
|
OrderRoomUseDTO roomRespDTO = roomIdMap.get(item.getRoomId());
|
|
OrderRoomUseDTO roomRespDTO = roomIdMap.get(item.getRoomId());
|
|
|
- roomUsedDO.setRoomModelId(roomRespDTO.getRoomModelId());
|
|
|
|
|
- roomUsedDO.setFloor(roomRespDTO.getFloor());
|
|
|
|
|
|
|
+ if(roomRespDTO!=null) {
|
|
|
|
|
+ roomUsedDO.setRoomModelId(roomRespDTO.getRoomModelId());
|
|
|
|
|
+ roomUsedDO.setFloor(roomRespDTO.getFloor());
|
|
|
|
|
+ }
|
|
|
roomUsedDO.setRoomId(item.getRoomId());
|
|
roomUsedDO.setRoomId(item.getRoomId());
|
|
|
roomUsedDO.setNum(item.getNum());
|
|
roomUsedDO.setNum(item.getNum());
|
|
|
roomUsedDO.setStatus(orderStatus);
|
|
roomUsedDO.setStatus(orderStatus);
|