This commit is contained in:
zjf committed 2026-10-28 16:34:32 +08:00
1 parent f59e03ec02
commit b05616400b
1 file changed
+4 -2
@@ -964,8 +964,10 @@ public class SmHotelMidServiceImpl implements SmHotelMidService {
}
// 整数价:四舍五入后仍可能为 0(如 0.4),圣诺要求 cost≥1
int costInt = Math.max(1, price.setScale(0, java.math.RoundingMode.HALF_UP).intValue());
int amount = row.getRemainStock() == null ? 0 : Math.max(0, row.getRemainStock());
int open = Integer.valueOf(1).equals(row.getDailyStatus()) && amount > 0 ? 1 : 0;
// remainStock 是 exist=false 计算字段,库查询不会带;可售一律用 stock-sold(与环启/慧订一致)
int amount = huanqiRemainStock(row);
int statusOpen = row.getDailyStatus() == null ? 1 : row.getDailyStatus();
int open = statusOpen == 1 && amount > 0 ? 1 : 0;
pc.put("cost", costInt);
pc.put("amount", open == 1 ? Math.max(1, amount) : amount);
pc.put("status", open);