|
|
@@ -16,6 +16,7 @@ import android.widget.ImageView;
|
|
|
import android.widget.LinearLayout;
|
|
|
import android.widget.RadioButton;
|
|
|
import android.widget.RadioGroup;
|
|
|
+import android.widget.RelativeLayout;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.afollestad.materialdialogs.MaterialDialog;
|
|
|
@@ -63,6 +64,7 @@ import com.modular.booking.model.SeatsStateModel;
|
|
|
import com.modular.booking.widget.AddSubUtils;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
+import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
@@ -111,6 +113,7 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
private LinearLayout llPanelBusiness;
|
|
|
private TextView tvSeatsLeft;
|
|
|
private TextView tvSeatsRight;
|
|
|
+ private RelativeLayout notes_rl;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
@@ -182,6 +185,7 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
tvSeatsRight=findViewById(R.id.tvSeatsRight);
|
|
|
llPanelWait=(LinearLayout)findViewById(R.id.llPanelWait);
|
|
|
llPanelBusiness=(LinearLayout)findViewById(R.id.llPanelBusiness);
|
|
|
+ notes_rl =(RelativeLayout)findViewById(R.id.notes_rl);
|
|
|
|
|
|
submit_btn.setOnClickListener(this);
|
|
|
et_book_name.setText(CommonUtil.getName());
|
|
|
@@ -265,6 +269,11 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
tvSeatsRight.setTextColor(mContext.getResources().getColor(R.color.blue_seats_num));
|
|
|
llPanelBusiness.setVisibility(View.VISIBLE);
|
|
|
llPanelWait.setVisibility(View.GONE);
|
|
|
+ try {
|
|
|
+ getSteatListStates(JSON.parseObject(dataService ).getString("sb_companyid"));//获取餐饮类别状态信息
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -988,7 +997,12 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
map.put("sb_spname", tv_food_rooms.getText());
|
|
|
}else{
|
|
|
//选桌位
|
|
|
- map.put("sb_stname", tv_food_seats.getTag(R.id.tag_id));
|
|
|
+ if (((Integer)tv_food_seats.getTag(R.id.tag_id2))>0) {
|
|
|
+ map.put("sb_stname", tv_food_seats.getTag(R.id.tag_id));
|
|
|
+ }else{
|
|
|
+ ToastMessage("已无剩余桌位!");
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
}
|
|
|
@@ -1150,7 +1164,17 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
if (!isEdited) {
|
|
|
et_book_phone.setText(data.getString("sb_telephone"));
|
|
|
et_book_name.setText(data.getString("sb_recordor"));
|
|
|
- et_book_notes.setText(data.getString("sb_remark"));
|
|
|
+ if ("0".equals(data.getString("sb_sex"))){
|
|
|
+ rg_sex.check(rg_sex.getChildAt(0).getId());
|
|
|
+ }else if("1".equals(data.getString("sb_sex"))){
|
|
|
+ rg_sex.check(rg_sex.getChildAt(1).getId());
|
|
|
+ }
|
|
|
+ if (!StringUtil.isEmpty(data.getString("sb_remark"))){
|
|
|
+ et_book_notes.setText(data.getString("sb_remark"));
|
|
|
+ notes_rl.setVisibility(View.VISIBLE);
|
|
|
+ }else{
|
|
|
+ notes_rl.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
et_book_phone.setKeyListener(null);
|
|
|
et_book_name.setEnabled(false);
|
|
|
et_book_notes.setEnabled(false);
|
|
|
@@ -1159,6 +1183,7 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
case "餐饮"://餐饮
|
|
|
findViewById(R.id.ll_food).setVisibility(View.VISIBLE);
|
|
|
if (isEdited) {
|
|
|
+ searchSeatNumbers(DateFormatUtil.getStrDate4Date(new Date(),"yyyy-MM-dd HH:ss"),model.getCompanyid());
|
|
|
tv_food_times.setOnClickListener(this);
|
|
|
tv_food_rooms.setOnClickListener(this);
|
|
|
tv_food_peoples.setOnClickListener(this);
|
|
|
@@ -1175,6 +1200,12 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
|
|
|
searchSeatNumbers(tv_food_times.getText().toString(),data.getString("sb_companyid"));
|
|
|
getSteatListStates(data.getString("sb_companyid"));//获取餐饮类别状态信息
|
|
|
+
|
|
|
+ if(StringUtil.isEmpty(data.getString("sb_stname"))){
|
|
|
+ tv_food_rooms.setText("无");
|
|
|
+ }else{
|
|
|
+ tv_food_rooms.setText(data.getString("sb_stname"));
|
|
|
+ }
|
|
|
tv_food_rooms.setText(data.getString("sb_stname"));
|
|
|
tv_food_peoples.setText(data.getString("sb_person"));
|
|
|
tv_food_peoples.setVisibility(View.VISIBLE);
|
|
|
@@ -1315,11 +1346,12 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
case "10003"://餐饮
|
|
|
findViewById(R.id.ll_food).setVisibility(View.VISIBLE);
|
|
|
if (isEdited) {
|
|
|
+ searchSeatNumbers(DateFormatUtil.getStrDate4Date(new Date(),"yyyy-MM-dd HH:ss"),model.getCompanyid());
|
|
|
tv_food_times.setOnClickListener(this);
|
|
|
tv_food_rooms.setOnClickListener(this);
|
|
|
tv_food_peoples.setOnClickListener(this);
|
|
|
- addSubUtils.setVisibility(View.VISIBLE);
|
|
|
tv_food_peoples.setVisibility(View.GONE);
|
|
|
+ addSubUtils.setVisibility(View.VISIBLE);
|
|
|
tvSeatsRight.setVisibility(View.GONE);
|
|
|
} else {
|
|
|
if (StringUtil.isEmpty(data.getString("sb_starttime"))) {
|
|
|
@@ -1328,8 +1360,14 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
tv_food_times.setText(data.getString("sb_starttime").substring(0, 10) + " "
|
|
|
+ data.getString("sb_starttime").substring(11, 16) + "-" + data.getString("sb_endtime").substring(11, 16));
|
|
|
}
|
|
|
+
|
|
|
searchSeatNumbers(tv_food_times.getText().toString(),data.getString("sb_companyid"));
|
|
|
- tv_food_rooms.setText(data.getString("sb_spname"));
|
|
|
+ if(StringUtil.isEmpty(data.getString("sb_stname"))){
|
|
|
+ tv_food_rooms.setText("无");
|
|
|
+ }else{
|
|
|
+ tv_food_rooms.setText(data.getString("sb_stname"));
|
|
|
+ }
|
|
|
+ tv_food_rooms.setText(data.getString("sb_stname"));
|
|
|
tv_food_peoples.setText(data.getString("sb_person"));
|
|
|
tv_food_peoples.setVisibility(View.VISIBLE);
|
|
|
addSubUtils.setVisibility(View.GONE);
|
|
|
@@ -1624,8 +1662,14 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
CommonUtil.textSpanForStyle(tvDSeatsNum,"前方"+number+"桌",number,ct.getResources().getColor(R.color.blue_seats_num));
|
|
|
}
|
|
|
if (asType.equals(king)){
|
|
|
+ if (bookednumber<=0){
|
|
|
+ bookednumber=0;
|
|
|
+ ToastMessage("已无剩余桌量!");
|
|
|
+ }
|
|
|
tv_food_seats.setTag(R.id.tag_id,deskcode);
|
|
|
+ tv_food_seats.setTag(R.id.tag_id2,bookednumber);//桌位数量
|
|
|
CommonUtil.textSpanForStyle(tv_food_seats,"仅剩"+bookednumber+"桌",String.valueOf(bookednumber),ct.getResources().getColor(R.color.blue_seats_num));
|
|
|
+ isEnter=false;
|
|
|
}else{
|
|
|
isEnter=true;//置空,下面循环会进入指定逻辑代码
|
|
|
}
|
|
|
@@ -1645,10 +1689,15 @@ public class BServiceAddActivity extends OABaseActivity implements View.OnClickL
|
|
|
if (ListUtils.isEmpty(deskbook)) {
|
|
|
if (as_type.equals(asType)||isEnter) {
|
|
|
//tv_food_seats.setText("仅剩"+as_number+"桌");
|
|
|
+ if (bookNum<=0){
|
|
|
+ bookNum=0;
|
|
|
+ ToastMessage("已无剩余桌量!");
|
|
|
+ }
|
|
|
CommonUtil.textSpanForStyle(tv_food_seats,"仅剩"+bookNum+"桌",String.valueOf(bookNum),ct.getResources().getColor(R.color.blue_seats_num));
|
|
|
LogUtil.d(TAG,"as_number:"+as_number+" as_deskcode:"+as_deskcode);
|
|
|
// tv_food_seats.setTag(0,as_number);
|
|
|
tv_food_seats.setTag(R.id.tag_id,as_deskcode+"01");//桌位编号
|
|
|
+ tv_food_seats.setTag(R.id.tag_id2,bookNum);//桌位数量
|
|
|
}
|
|
|
LogUtil.d(TAG,"桌:"+as_type+":前方"+as_number+"桌");
|
|
|
if ("小桌".equals(as_type)){
|