|
|
@@ -102,7 +102,7 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
et_book_content = (EditText) findViewById(R.id.et_book_content);
|
|
|
|
|
|
tv_book_topic = (EditText) findViewById(R.id.tv_book_topic);
|
|
|
- gv_topic=(NScrollerGridView) findViewById(R.id.gv_topic);
|
|
|
+ gv_topic = (NScrollerGridView) findViewById(R.id.gv_topic);
|
|
|
tv_book_topic.setText("商务洽谈");
|
|
|
bt_commit = (Button) findViewById(R.id.submit_btn);
|
|
|
findViewById(R.id.submit_btn).setOnClickListener(this);
|
|
|
@@ -130,23 +130,23 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- dataStates=new ArrayList<>();
|
|
|
- for (String str:mTypes){
|
|
|
- DataState dataState=new DataState();
|
|
|
+ dataStates = new ArrayList<>();
|
|
|
+ for (String str : mTypes) {
|
|
|
+ DataState dataState = new DataState();
|
|
|
dataState.setValue(str);
|
|
|
dataStates.add(dataState);
|
|
|
}
|
|
|
-
|
|
|
- adapter=new GridDataAdapter(this,dataStates);
|
|
|
+
|
|
|
+ adapter = new GridDataAdapter(this, dataStates);
|
|
|
gv_topic.setAdapter(adapter);
|
|
|
-
|
|
|
+
|
|
|
gv_topic.setOnItemClickListener(new AdapterView.OnItemClickListener() {
|
|
|
@Override
|
|
|
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
|
|
|
- GridDataAdapter.ViewModle modle= (GridDataAdapter.ViewModle) view.getTag();
|
|
|
- tv_book_topic.setText( modle.tv_text.getText().toString());
|
|
|
+ GridDataAdapter.ViewModle modle = (GridDataAdapter.ViewModle) view.getTag();
|
|
|
+ tv_book_topic.setText(modle.tv_text.getText().toString());
|
|
|
tv_book_topic.setSelection(modle.tv_text.getText().toString().length());
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
@@ -170,7 +170,7 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
}
|
|
|
break;
|
|
|
case R.id.company_add_rl://时段
|
|
|
- if (!StringUtils.isEmpty(phone)) {
|
|
|
+ if (!StringUtils.isEmpty(tvBookObject.getText().toString())) {
|
|
|
startActivityForResult(new Intent(mContext, SelectCalendarActivity.class)
|
|
|
.putExtra("startDate", DateFormatUtil.getDateTimeStr())
|
|
|
.putExtra("endDate", DateFormatUtil.getDateTimeStr())
|
|
|
@@ -193,7 +193,7 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
poiParam.setDistanceTag(MyApplication.getInstance().getResources().getString(R.string.rice));
|
|
|
intent.putExtra("data", poiParam);
|
|
|
startActivityForResult(intent, 0x23);
|
|
|
-
|
|
|
+
|
|
|
break;
|
|
|
case R.id.rl_object://对象
|
|
|
if (model != null) {
|
|
|
@@ -221,10 +221,10 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
switch (requestCode) {
|
|
|
case 0x23://地址
|
|
|
PoiInfo poi = data.getParcelableExtra("resultKey");
|
|
|
- if (poi == null ) return;
|
|
|
- tvBookAddress.setText(poi.address);
|
|
|
- latitude =poi.location.latitude;
|
|
|
- longitude =poi.location.longitude;
|
|
|
+ if (poi == null) return;
|
|
|
+ tvBookAddress.setText(poi.address + poi.name);
|
|
|
+ latitude = poi.location.latitude;
|
|
|
+ longitude = poi.location.longitude;
|
|
|
// SelectAimModel entity = data.getParcelableExtra("data");
|
|
|
// tvBookAddress.setText(entity.getAddress());
|
|
|
// if (entity.getLatLng() != null) {
|
|
|
@@ -244,8 +244,9 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
case 0x01://对象
|
|
|
// SelectEmUser model = data.getParcelableExtra("data");
|
|
|
ContactsModel model = data.getParcelableExtra("data");
|
|
|
+ LogUtil.d("Test",JSON.toJSONString(model));
|
|
|
imId = Integer.valueOf(model.getImid());
|
|
|
- phone=model.getPhone();
|
|
|
+ phone = model.getPhone();
|
|
|
tvBookObject.setText(model.getName());
|
|
|
break;
|
|
|
case 0x11:
|
|
|
@@ -297,7 +298,7 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
String json = "{" +
|
|
|
"\"ab_bman\":\"" + tvBookObject.getText().toString() + "\"," +
|
|
|
"\"ab_bmanid\":\"" + imId + "\"," +
|
|
|
- "\"ab_btelephone\":\"" +phone + "\"," +
|
|
|
+ "\"ab_btelephone\":\"" + phone + "\"," +
|
|
|
"\"ab_starttime\":\"" + startTime + "\"," +
|
|
|
"\"ab_endtime\":\"" + endTime + "\"," +
|
|
|
"\"ab_recordid\":\"" + MyApplication.getInstance().mLoginUser.getUserId() + "\"," +
|
|
|
@@ -367,7 +368,7 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
String json = "{" +
|
|
|
"\"ab_bman\":\"" + tvBookObject.getText().toString() + "\"," +
|
|
|
"\"ab_bmanid\":\"" + imId + "\"," +
|
|
|
-
|
|
|
+
|
|
|
"\"ab_starttime\":\"" + startTime + "\"," +
|
|
|
"\"ab_endtime\":\"" + endTime + "\"," +
|
|
|
"\"ab_recordid\":\"" + model.getAb_recordid() + "\"," +
|
|
|
@@ -402,8 +403,12 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
String resutl = JSON.parseObject(msg.getData().getString("result")).getString("result");
|
|
|
if (resutl.equals("true")) {
|
|
|
ToastMessage("预约成功!");
|
|
|
- invite(phone,"6e554e51-08de-443c-9b6c-f0d6d0d07bb4");
|
|
|
- invite(phone,"fd4ac30e-b176-4410-ac0e-e39c8b71dfe0");
|
|
|
+ if (imId == 0) {
|
|
|
+ invite(phone, "6e554e51-08de-443c-9b6c-f0d6d0d07bb4");
|
|
|
+ invite(phone, "fd4ac30e-b176-4410-ac0e-e39c8b71dfe0");
|
|
|
+ } else {
|
|
|
+ invite(phone, "8636ba7f-a1b4-4062-8571-782035101167");
|
|
|
+ }
|
|
|
startActivity(new Intent(BookingAddActivity.this, BookingListActivity.class)
|
|
|
.putExtra("curDate", startTime));
|
|
|
} else {
|
|
|
@@ -420,7 +425,7 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
try {
|
|
|
if (JSON.parseObject(msg.getData().getString("result")).getString("result").equals("true")) {
|
|
|
ToastMessage(getString(R.string.make_adeal_success));
|
|
|
-
|
|
|
+
|
|
|
startActivity(new Intent(BookingAddActivity.this, BookingListActivity.class)
|
|
|
.putExtra("curDate", model.getAb_starttime())
|
|
|
);
|
|
|
@@ -463,7 +468,7 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
}
|
|
|
|
|
|
|
|
|
- public class GridDataAdapter extends BaseAdapter {
|
|
|
+ public class GridDataAdapter extends BaseAdapter {
|
|
|
|
|
|
private Context ct;
|
|
|
private List<DataState> mData = new ArrayList<>();
|
|
|
@@ -501,7 +506,7 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
|
|
|
@Override
|
|
|
public View getView(int position, View convertView, ViewGroup parent) {
|
|
|
- GridDataAdapter.ViewModle modle = null;
|
|
|
+ GridDataAdapter.ViewModle modle = null;
|
|
|
|
|
|
if (convertView == null) {
|
|
|
convertView = inflater.inflate(R.layout.item_simple_text, parent, false);
|
|
|
@@ -538,9 +543,9 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
}
|
|
|
|
|
|
|
|
|
- private void invite(String user,final String modeid) {
|
|
|
+ private void invite(String user, final String modeid) {
|
|
|
final String name = CommonUtil.getName();
|
|
|
- final String phone = user.trim().replaceAll(" ","");
|
|
|
+ final String phone = user.trim().replaceAll(" ", "");
|
|
|
if (!com.xzjmyk.pm.activity.util.StringUtils.isMobileNumber(phone)) {
|
|
|
showToast("选择人员电话号码为空或是格式不正确", R.color.load_submit);
|
|
|
return;
|
|
|
@@ -554,13 +559,13 @@ public class BookingAddActivity extends OABaseActivity implements HttpImp, View.
|
|
|
}, new StringJsonObjectRequest.Listener<AddAttentionResult>() {
|
|
|
@Override
|
|
|
public void onResponse(ObjectResult<AddAttentionResult> result) {
|
|
|
- showToast("短信发送成功", R.color.load_submit);
|
|
|
-
|
|
|
+ showToast("短信发送成功", R.color.load_submit);
|
|
|
+
|
|
|
}
|
|
|
}, AddAttentionResult.class, null) {
|
|
|
@Override
|
|
|
public byte[] getBody() throws AuthFailureError {
|
|
|
- String param = "{\"receiver\":\"" + phone + "\",\"params\":[\"" + name + "\"],\"templateId\":\""+modeid+"\"}";
|
|
|
+ String param = "{\"receiver\":\"" + phone + "\",\"params\":[\"" + name + "\"],\"templateId\":\"" + modeid + "\"}";
|
|
|
LogUtil.i("param=" + param);
|
|
|
return param.getBytes();
|
|
|
}
|