|
|
@@ -22,6 +22,7 @@ import android.widget.TextView;
|
|
|
import com.afollestad.materialdialogs.GravityEnum;
|
|
|
import com.afollestad.materialdialogs.MaterialDialog;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.lidroid.xutils.ViewUtils;
|
|
|
import com.lidroid.xutils.view.annotation.ViewInject;
|
|
|
@@ -57,8 +58,8 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
private Button bt_manage_date;
|
|
|
@ViewInject(R.id.bt_zhuanyi)
|
|
|
private Button bt_zhuanyi;
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
@ViewInject(R.id.bt_manage_go)
|
|
|
private Button bt_manage_go;
|
|
|
@ViewInject(R.id.crm_ll_followup)
|
|
|
@@ -80,27 +81,27 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
@ViewInject(R.id.bc_code)
|
|
|
private TextView bc_code;
|
|
|
@ViewInject(R.id.bc_description)
|
|
|
- private TextView bc_description;
|
|
|
+ private TextView bc_description;
|
|
|
@ViewInject(R.id.bc_nichehouse)
|
|
|
private TextView bc_nichehouse;
|
|
|
@ViewInject(R.id.bc_type)
|
|
|
- private TextView bc_type;
|
|
|
+ private TextView bc_type;
|
|
|
@ViewInject(R.id.bc_currentprocess)
|
|
|
- private TextView bc_currentprocess;
|
|
|
+ private TextView bc_currentprocess;
|
|
|
@ViewInject(R.id.bc_lastdate)
|
|
|
- private TextView bc_lastdate;
|
|
|
+ private TextView bc_lastdate;
|
|
|
@ViewInject(R.id.bc_doman)
|
|
|
- private TextView bc_doman;
|
|
|
+ private TextView bc_doman;
|
|
|
@ViewInject(R.id.bc_custname)
|
|
|
- private TextView bc_custname;
|
|
|
+ private TextView bc_custname;
|
|
|
@ViewInject(R.id.bc_address)
|
|
|
- private TextView bc_address;
|
|
|
+ private TextView bc_address;
|
|
|
@ViewInject(R.id.bc_contact)
|
|
|
private TextView bc_contact;
|
|
|
@ViewInject(R.id.bc_position)
|
|
|
- private TextView bc_position;
|
|
|
+ private TextView bc_position;
|
|
|
@ViewInject(R.id.bt_tel)
|
|
|
- private TextView bt_tel;
|
|
|
+ private TextView bt_tel;
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
@@ -168,16 +169,13 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
showPopupWindow(v.findViewById(R.id.bt_manage_go));
|
|
|
break;
|
|
|
case R.id.bt_manage_date:
|
|
|
- Intent intent = new Intent(ct, TaskAddActivity.class);
|
|
|
- intent.putExtra("type", 1);
|
|
|
- intent.putExtra("data", bt_code);
|
|
|
- startActivityForResult(intent, 0x11);
|
|
|
+ isEnableClick(bt_code,5);
|
|
|
break;
|
|
|
case R.id.bt_qiang:
|
|
|
progressDialog.show();
|
|
|
String url = Constants.getAppBaseUrl(ct) + "mobile/crm/ifoverrecv.action";
|
|
|
- Map<String,Object> stringMap = new HashMap<String, Object>();
|
|
|
- stringMap.put("emcode",CommonUtil.getSharedPreferences(ct, "erp_username"));
|
|
|
+ Map<String, Object> stringMap = new HashMap<String, Object>();
|
|
|
+ stringMap.put("emcode", CommonUtil.getSharedPreferences(ct, "erp_username"));
|
|
|
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
@@ -338,7 +336,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
bc_lastdate.setText(root.getString("bc_lastdate"));
|
|
|
bc_recorder.setText(root.getString("bc_recorder"));
|
|
|
bc_remark.setText(root.getString("bc_remark"));
|
|
|
-
|
|
|
+
|
|
|
bc_doman.setText(root.getString("bc_doman"));
|
|
|
bc_code.setText(root.getString("bc_code"));
|
|
|
bc_address.setText(root.getString("bc_address"));
|
|
|
@@ -348,7 +346,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
bc_description.setText(root.getString("bc_description"));
|
|
|
bc_currentprocess.setText(root.getString("bc_currentprocess"));
|
|
|
bc_type.setText(root.getString("bc_type"));
|
|
|
-
|
|
|
+
|
|
|
bt_doman = root.getString("bc_doman");
|
|
|
bt_code = root.getString("bc_code");
|
|
|
bt_process = root.getString("bc_currentprocess");
|
|
|
@@ -377,15 +375,28 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
case CAN_QIANG_NOT:
|
|
|
JSONObject result = JSON.parseObject(msg.getData().getString("result"));
|
|
|
String isok = result.getString("isok");
|
|
|
- if ("0".equals(isok)){
|
|
|
+ if ("0".equals(isok)) {
|
|
|
Log.i("qiang", isok);
|
|
|
sendHttpBusinessQiang(BUSINESS_QIANG, bt_code, bt_doman);
|
|
|
- }else if ("1".equals(isok)){
|
|
|
- Log.i("qiang",isok);
|
|
|
+ } else if ("1".equals(isok)) {
|
|
|
+ Log.i("qiang", isok);
|
|
|
progressDialog.dismiss();
|
|
|
Crouton.makeText(BusinessDetailInfoActivity.this, "您已超出最大获取商机数!", 0xffff4444, 2000).show();
|
|
|
}
|
|
|
-
|
|
|
+ case 5:
|
|
|
+ result = JSON.parseObject(msg.getData().getString("result"));
|
|
|
+ JSONArray items=result.getJSONArray("result");
|
|
|
+ if (items!=null){
|
|
|
+ if (items.size()>0){
|
|
|
+ Crouton.makeText(BusinessDetailInfoActivity.this, "不能重复添加到日程!", 0xffff4444, 2000).show();
|
|
|
+ }else{
|
|
|
+ Intent intent = new Intent(ct, TaskAddActivity.class);
|
|
|
+ intent.putExtra("type", 1);
|
|
|
+ intent.putExtra("data", bt_code);
|
|
|
+ startActivityForResult(intent, 0x11);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ break;
|
|
|
case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
progressDialog.dismiss();
|
|
|
Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
|
|
|
@@ -397,7 +408,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
|
|
|
private void jumpToStateActivity() {
|
|
|
Intent intent = new Intent();
|
|
|
- intent.setClass(BusinessDetailInfoActivity.this,BusinessStateActivity.class);
|
|
|
+ intent.setClass(BusinessDetailInfoActivity.this, BusinessStateActivity.class);
|
|
|
startActivity(intent);
|
|
|
}
|
|
|
|
|
|
@@ -406,7 +417,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
String url = Constants.getAppBaseUrl(ct) + "mobile/common/getPanel.action";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("caller", "BusinessChance");
|
|
|
- if (type==0)formCondition="bc_id"+formCondition;
|
|
|
+ if (type == 0) formCondition = "bc_id" + formCondition;
|
|
|
params.put("formCondition", formCondition);
|
|
|
params.put("gridCondition", gridCondition);
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
@@ -442,6 +453,17 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public void isEnableClick(String bt_code,int what){
|
|
|
+ String url = Constants.getAppBaseUrl(ct) + "mobile/crm/getSchedule.action";
|
|
|
+ progressDialog.show();
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("bccode", bt_code);
|
|
|
+ params.put("emname", MyApplication.getInstance().mLoginUser.getNickName());
|
|
|
+ LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+ headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
+ ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, what, null, null, "post");
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
switch (requestCode) {
|