for (String string : list) { if(string.equals(ids)){ int res = JOptionPane.showConfirmDialog(null, "此特位还有预约尚未完成,确定删除?", "警告", JOptionPane.YES_NO_OPTION); if (res == JOptionPane.YES_OPTION) {// 点击“是”后执行这个代码块 order.set_state(0); specialguardService.save(order); status.put("status", 200); } else { order.set_state(1); specialguardService.save(order); status.put("status", 200); } break; }else{ order.set_state(0); specialguardService.save(order); status.put("status", 200); } }