|
|
@@ -9,12 +9,15 @@ import android.util.Log;
|
|
|
import android.view.Menu;
|
|
|
import android.view.MenuItem;
|
|
|
import android.view.View;
|
|
|
+import android.widget.Toast;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.andreabaccega.widget.FormEditText;
|
|
|
import com.common.LogUtil;
|
|
|
import com.common.data.DateFormatUtil;
|
|
|
+import com.common.data.JSONUtil;
|
|
|
+import com.common.data.ListUtils;
|
|
|
import com.common.data.StringUtil;
|
|
|
import com.core.app.Constants;
|
|
|
import com.core.app.MyApplication;
|
|
|
@@ -22,10 +25,14 @@ import com.core.base.BaseActivity;
|
|
|
import com.core.model.SelectBean;
|
|
|
import com.core.net.http.ViewUtil;
|
|
|
import com.core.utils.CommonUtil;
|
|
|
+import com.core.utils.ToastUtil;
|
|
|
import com.core.utils.time.wheel.DatePicker;
|
|
|
import com.core.widget.SingleDialog;
|
|
|
import com.core.widget.view.Activity.SelectActivity;
|
|
|
-import com.lidroid.xutils.ViewUtils;
|
|
|
+import com.me.network.app.http.HttpClient;
|
|
|
+import com.me.network.app.http.Method;
|
|
|
+import com.me.network.app.http.rx.Result2Listener;
|
|
|
+import com.me.network.app.http.rx.ResultSubscriber;
|
|
|
import com.uas.appworks.R;
|
|
|
|
|
|
import org.json.JSONException;
|
|
|
@@ -38,6 +45,8 @@ import java.util.HashMap;
|
|
|
import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.regex.Matcher;
|
|
|
+import java.util.regex.Pattern;
|
|
|
|
|
|
/**
|
|
|
* @功能:商机添加
|
|
|
@@ -64,8 +73,9 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
private FormEditText et_company_planmoney;
|
|
|
private FormEditText et_company_plantime;
|
|
|
private FormEditText et_company_depart;
|
|
|
- private FormEditText et_bc_factory;
|
|
|
- private FormEditText et_bc_tel;
|
|
|
+ private FormEditText et_bc_factory;
|
|
|
+ private FormEditText et_bc_tel;
|
|
|
+ private MenuItem saveMenu;
|
|
|
|
|
|
private List<String> lists = new ArrayList<String>();
|
|
|
private int et_business_enterCode;
|
|
|
@@ -80,6 +90,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
private static final int GET_BC_ID = 6;
|
|
|
private JSONArray jsons;
|
|
|
private JSONArray enterArray;
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@@ -89,6 +100,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
initData();
|
|
|
initListener();
|
|
|
}
|
|
|
+
|
|
|
private Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
@@ -101,12 +113,19 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
case Constants.HTTP_SUCCESS_INIT:
|
|
|
progressDialog.dismiss();
|
|
|
ViewUtil.ToastMessage(activity, getString(R.string.business_add_success));
|
|
|
- mHandler.postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- finish();
|
|
|
- }
|
|
|
- }, 3000);
|
|
|
+ //保存商机成功
|
|
|
+ //TODO 2017-09-22 需求修改
|
|
|
+// mHandler.postDelayed(new Runnable() {
|
|
|
+// @Override
|
|
|
+// public void run() {
|
|
|
+// finish();
|
|
|
+// }
|
|
|
+// }, 3000);
|
|
|
+ //TODO 2017-09-22 需求修改
|
|
|
+// if (saveMenu != null) {
|
|
|
+// saveMenu.setTitle(R.string.common_submit_button);
|
|
|
+// }
|
|
|
+ submit();
|
|
|
break;
|
|
|
case LOAD_BUSINESS://商机库
|
|
|
progressDialog.dismiss();
|
|
|
@@ -189,9 +208,45 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
break;
|
|
|
+ case 0x14:
|
|
|
+ String message = msg.getData().getString("result");
|
|
|
+ if (!StringUtil.isEmpty(message) && JSONUtil.validate(message)) {
|
|
|
+ com.alibaba.fastjson.JSONObject o = JSON.parseObject(message);
|
|
|
+ JSONArray assigns = JSONUtil.getJSONArray(o, "assigns");
|
|
|
+ if (!ListUtils.isEmpty(assigns)) {
|
|
|
+ o = assigns.getJSONObject(0);
|
|
|
+ String noid = "";
|
|
|
+ if (o != null && o.containsKey("JP_NODEID")) {
|
|
|
+ noid = o.getString("JP_NODEID");
|
|
|
+ }
|
|
|
+ JSONArray data = null;
|
|
|
+ if (o != null && o.containsKey("JP_CANDIDATES")) {
|
|
|
+ data = o.getJSONArray("JP_CANDIDATES");
|
|
|
+ }
|
|
|
+ if (!StringUtil.isEmpty(noid) && data != null && data.size() > 0) {
|
|
|
+ sendToSelect(noid, data);
|
|
|
+ } else {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 0x15:
|
|
|
+ progressDialog.dismiss();
|
|
|
+ finish();
|
|
|
+ Toast.makeText(MyApplication.getInstance(), R.string.submit_success, Toast.LENGTH_SHORT).show();
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
+
|
|
|
private void initIDS() {
|
|
|
et_business_no = (FormEditText) findViewById(R.id.et_business_no);
|
|
|
et_business_name = (FormEditText) findViewById(R.id.et_business_name);
|
|
|
@@ -199,18 +254,18 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
et_business = (FormEditText) findViewById(R.id.et_business);
|
|
|
et_business_jieDuan = (FormEditText) findViewById(R.id.et_business_jieDuan);
|
|
|
et_business_enterMan = (FormEditText) findViewById(R.id.et_business_enterMan);
|
|
|
- et_business_remark = (FormEditText) findViewById(R.id.et_business_remark);
|
|
|
+ et_business_remark = (FormEditText) findViewById(R.id.et_business_remark);
|
|
|
et_business_type = (FormEditText) findViewById(R.id.et_business_type);
|
|
|
et_company_name = (FormEditText) findViewById(R.id.et_company_name);
|
|
|
et_company_address = (FormEditText) findViewById(R.id.et_company_address);
|
|
|
et_company_man = (FormEditText) findViewById(R.id.et_company_man);
|
|
|
et_company_position = (FormEditText) findViewById(R.id.et_company_position);
|
|
|
- et_company_tele= (FormEditText) findViewById(R.id.et_company_tel);
|
|
|
- et_company_businesslicense= (FormEditText) findViewById(R.id.et_company_businesslicense);
|
|
|
- et_company_planmoney= (FormEditText) findViewById(R.id.et_company_planmoney);
|
|
|
+ et_company_tele = (FormEditText) findViewById(R.id.et_company_tel);
|
|
|
+ et_company_businesslicense = (FormEditText) findViewById(R.id.et_company_businesslicense);
|
|
|
+ et_company_planmoney = (FormEditText) findViewById(R.id.et_company_planmoney);
|
|
|
et_company_plantime = (FormEditText) findViewById(R.id.et_company_plantime);
|
|
|
et_company_depart = (FormEditText) findViewById(R.id.et_company_depart);
|
|
|
- et_bc_factory= (FormEditText) findViewById(R.id.et_bc_factory);
|
|
|
+ et_bc_factory = (FormEditText) findViewById(R.id.et_bc_factory);
|
|
|
et_bc_tel = (FormEditText) findViewById(R.id.et_bt_tel);
|
|
|
}
|
|
|
|
|
|
@@ -259,48 +314,55 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- if (v.getId() == R.id.et_business){
|
|
|
+ if (v.getId() == R.id.et_business) {
|
|
|
loadBusiness();
|
|
|
- }else if (v.getId() == R.id.et_business_source){
|
|
|
+ } else if (v.getId() == R.id.et_business_source) {
|
|
|
loadSource();
|
|
|
- }else if (v.getId() == R.id.et_business_enterMan){
|
|
|
+ } else if (v.getId() == R.id.et_business_enterMan) {
|
|
|
loadManGenJin();
|
|
|
- }else if (v.getId() == R.id.et_business_jieDuan){
|
|
|
+ } else if (v.getId() == R.id.et_business_jieDuan) {
|
|
|
loadJieDuan();
|
|
|
- }else if (v.getId() == R.id.et_business_type){
|
|
|
+ } else if (v.getId() == R.id.et_business_type) {
|
|
|
onPopupButtonClick(v);
|
|
|
- }else if (v.getId() == R.id.et_company_plantime){
|
|
|
+ } else if (v.getId() == R.id.et_company_plantime) {
|
|
|
showDateDialog((FormEditText) v.findViewById(R.id.et_company_plantime));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
getMenuInflater().inflate(R.menu.main_btn_submit, menu);
|
|
|
- menu.findItem(R.id.btn_save).setTitle(getString(R.string.common_save_button));
|
|
|
+ saveMenu = menu.findItem(R.id.btn_save);
|
|
|
+ saveMenu.setTitle(getString(R.string.common_save_button));
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
@Override
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
if (item.getItemId() == R.id.btn_save) {
|
|
|
- if (et_business_name.testValidity() &&
|
|
|
- et_business_source.testValidity() &&
|
|
|
- et_business.testValidity() &&
|
|
|
- et_business_jieDuan.testValidity() &&
|
|
|
- et_company_tele.testValidity() &&
|
|
|
- et_company_businesslicense.testValidity() &&
|
|
|
- et_company_address.testValidity() &&
|
|
|
- et_company_name.testValidity() &&
|
|
|
- et_bc_tel.testValidity() &&
|
|
|
- et_bc_factory.testValidity()) {
|
|
|
- sendHttpResquest();
|
|
|
+ if (getString(R.string.common_submit_button).equals(item.getTitle())) {
|
|
|
+ submit();
|
|
|
+ } else {
|
|
|
+ if (et_business_name.testValidity() &&
|
|
|
+ et_business_source.testValidity() &&
|
|
|
+ et_business.testValidity() &&
|
|
|
+ et_business_jieDuan.testValidity() &&
|
|
|
+ et_company_tele.testValidity() &&
|
|
|
+ et_company_businesslicense.testValidity() &&
|
|
|
+ et_company_address.testValidity() &&
|
|
|
+ et_company_name.testValidity() &&
|
|
|
+ et_bc_tel.testValidity() &&
|
|
|
+ et_bc_factory.testValidity()) {
|
|
|
+ sendHttpResquest();
|
|
|
+ }
|
|
|
}
|
|
|
- }else if (item.getItemId() == android.R.id.home) {
|
|
|
+ } else if (item.getItemId() == android.R.id.home) {
|
|
|
onBackPressed();
|
|
|
}
|
|
|
- return true;
|
|
|
- }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
private String getEditText(FormEditText et) {
|
|
|
String temp = "";
|
|
|
@@ -309,6 +371,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
return temp;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* @desc:保存商机
|
|
|
* @author:Arison on 2016/7/20
|
|
|
@@ -336,8 +399,8 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
String bc_planmoney = getEditText(et_company_planmoney);//预计成交时间
|
|
|
String bc_depart = getEditText(et_company_depart);//部门
|
|
|
String bc_linecse = getEditText(et_company_businesslicense);//营业执照
|
|
|
- String bc_factory=getEditText(et_bc_factory);//工厂地址
|
|
|
- String bc_tel=getEditText(et_bc_tel);//公司总机
|
|
|
+ String bc_factory = getEditText(et_bc_factory);//工厂地址
|
|
|
+ String bc_tel = getEditText(et_bc_tel);//公司总机
|
|
|
String enterCode = null;
|
|
|
if (et_business_enterCode == 0) {//不可编辑 为空
|
|
|
enterCode = "";
|
|
|
@@ -350,19 +413,25 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
|
|
|
}
|
|
|
LogUtil.e("commonbcid", mBcId + "");
|
|
|
+ String status = "在录入";
|
|
|
+ String statusCode = "ENTERING";
|
|
|
+// if ("(贝腾)贝腾科技".equals("公司名称")) {
|
|
|
+// status = "已提交";
|
|
|
+// statusCode = "COMMITED";
|
|
|
+// }
|
|
|
String formStore =
|
|
|
"{\n" +
|
|
|
"\"bc_id\":" + mBcId + "," +
|
|
|
- "\"bc_position\":\"" + bc_factory+ "\"," +//工厂地址
|
|
|
+ "\"bc_position\":\"" + bc_factory + "\"," +//工厂地址
|
|
|
"\"bc_desc1\":\"" + bc_tel + "\"," +//公司总机
|
|
|
"\"bc_date7\":\"" + bc_plantime + "\"," +
|
|
|
"\"bc_desc8\":\"" + bc_planmoney + "\"," +
|
|
|
"\"bc_desc4\":\"" + bc_depart + "\"," +
|
|
|
"\"bc_desc6\":\"" + bc_linecse + "\"," +
|
|
|
"\"bc_code\":\"" + et_business_no.getText().toString() + "\"," + //商机名称
|
|
|
- "\"bc_status\":\"" + "已审核" + "\"," +
|
|
|
+ "\"bc_status\":\"" + status + "\"," +
|
|
|
"\"bc_domancode\":\"" + enterCode + "\"," +
|
|
|
- "\"bc_statuscode\":\"" + "AUDITED" + "\"," +
|
|
|
+ "\"bc_statuscode\":\"" + statusCode + "\"," +
|
|
|
"\"bc_description\":\"" + name + "\"," + //商机名称
|
|
|
"\"bc_from\":\"" + from + "\"," + //商机来源
|
|
|
"\"bc_nichehouse\":\"" + bc_nichehouse + "\"," + //商机库
|
|
|
@@ -387,6 +456,104 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, Constants.HTTP_SUCCESS_INIT, null, null, "post");
|
|
|
}
|
|
|
|
|
|
+ private void submit() {
|
|
|
+ if (mBcId <= 0) return;
|
|
|
+ HttpClient httpClient = new HttpClient.Builder(CommonUtil.getAppBaseUrl(ct)).isDebug(true)
|
|
|
+ .connectTimeout(5000)
|
|
|
+ .readTimeout(5000)
|
|
|
+ .build();
|
|
|
+ httpClient.Api().send(new HttpClient.Builder()
|
|
|
+ .url("crm/chance/submitBusinessChance.action")
|
|
|
+ .add("caller", "BusinessChance")
|
|
|
+ .header("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(MyApplication.getInstance(), "sessionId"))
|
|
|
+ .add("master", CommonUtil.getSharedPreferences(ct, "erp_master"))
|
|
|
+ .add("sessionUser", CommonUtil.getSharedPreferences(ct, "erp_username"))
|
|
|
+ .add("sessionId", CommonUtil.getSharedPreferences(ct, "sessionId"))
|
|
|
+ .add("id", mBcId)
|
|
|
+ .method(Method.POST)
|
|
|
+ .build(), new ResultSubscriber<>(new Result2Listener<Object>() {
|
|
|
+ @Override
|
|
|
+ public void onResponse(Object t) {
|
|
|
+ String message = t.toString();
|
|
|
+ LogUtil.i("message=" + message);
|
|
|
+ judgeApprovers();
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFailure(Object t) {
|
|
|
+ String message = t.toString();
|
|
|
+ ToastUtil.showToast(ct, message);
|
|
|
+ }
|
|
|
+ }));
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private void judgeApprovers() {
|
|
|
+ progressDialog.show();
|
|
|
+ String url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + "common/getMultiNodeAssigns.action";
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ param.put("caller", "BusinessChance");
|
|
|
+ param.put("id", mBcId);
|
|
|
+ LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+ headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
+ ViewUtil.httpSendRequest(ct, url, param, mHandler, headers, 0x14, null, null, "post");
|
|
|
+ }
|
|
|
+
|
|
|
+ private String noid;
|
|
|
+
|
|
|
+ private void sendToSelect(String noid, JSONArray data) {
|
|
|
+ this.noid = noid;
|
|
|
+ ArrayList<SelectBean> beans = new ArrayList<>();
|
|
|
+ SelectBean bean = null;
|
|
|
+ for (int i = 0; i < data.size(); i++) {
|
|
|
+ bean = new SelectBean();
|
|
|
+ bean.setName(data.getString(i));
|
|
|
+ bean.setClick(false);
|
|
|
+ beans.add(bean);
|
|
|
+ }
|
|
|
+ Intent intent = new Intent(ct, SelectActivity.class);
|
|
|
+ intent.putExtra("type", 2);
|
|
|
+ intent.putParcelableArrayListExtra("data", beans);
|
|
|
+ intent.putExtra("title", getString(R.string.select_approvel_people));
|
|
|
+ startActivityForResult(intent, 0x25);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getEmnameByReturn(String text) {
|
|
|
+ if (StringUtil.isEmpty(text)) {
|
|
|
+ finish();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Pattern pattern = Pattern.compile("(?<=\\()(.+?)(?=\\))");
|
|
|
+ Matcher matcher = pattern.matcher(text);
|
|
|
+ if (matcher.find()) {
|
|
|
+ String name = matcher.group();
|
|
|
+ if (!StringUtil.isEmpty(name)) {
|
|
|
+ selectApprovers(name);
|
|
|
+ } else {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void selectApprovers(String emName) {
|
|
|
+ progressDialog.show();
|
|
|
+ String url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + "common/takeOverTask.action";
|
|
|
+ Map<String, Object> param = new HashMap<>();
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("em_code", emName);
|
|
|
+ params.put("nodeId", noid);
|
|
|
+ param.put("_noc", 1);
|
|
|
+ param.put("params", JSONUtil.map2JSON(params));
|
|
|
+ LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
+ headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
+ ViewUtil.httpSendRequest(ct, url, param, mHandler, headers, 0x15, null, null, "post");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
private void getCodeByNet() {
|
|
|
String url = CommonUtil.getAppBaseUrl(ct) + "common/getCodeString.action";
|
|
|
final Map<String, Object> param = new HashMap<>();
|
|
|
@@ -543,7 +710,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
@Override
|
|
|
public void onListItemClick(int position, String value) {
|
|
|
if (StringUtil.isEmpty(value)) return;
|
|
|
- if (et.getId() == R.id.et_business_enterMan){
|
|
|
+ if (et.getId() == R.id.et_business_enterMan) {
|
|
|
et.setText(value);
|
|
|
for (int i = 0; i < enterArray.size(); i++) {
|
|
|
if (value.equals(enterArray.getJSONObject(i).getString("BC_DOMAN"))) {
|
|
|
@@ -551,9 +718,9 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
enterManCode = enterArray.getJSONObject(i).getString("EM_CODE");
|
|
|
}
|
|
|
}
|
|
|
- }else if (et.getId() == R.id.et_business_source){
|
|
|
+ } else if (et.getId() == R.id.et_business_source) {
|
|
|
et.setText(value);
|
|
|
- }else if (et.getId() == R.id.et_business){
|
|
|
+ } else if (et.getId() == R.id.et_business) {
|
|
|
et.setText(value);
|
|
|
for (int i = 0; i < jsons.size(); i++) {
|
|
|
if (jsons.getJSONObject(i).getString("BD_NAME").equals(value)) {
|
|
|
@@ -575,7 +742,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
et.setText(value);
|
|
|
}
|
|
|
}
|
|
|
@@ -609,7 +776,7 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
|
|
|
public void onPopupButtonClick(View button) {
|
|
|
popup = new PopupMenu(this, button);
|
|
|
- if (button.getId() == R.id.et_business_type){
|
|
|
+ if (button.getId() == R.id.et_business_type) {
|
|
|
getMenuInflater().inflate(R.menu.menu_business_type, popup.getMenu());
|
|
|
}
|
|
|
popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
|
|
@@ -633,47 +800,63 @@ public class BusinessAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
|
|
|
@Override
|
|
|
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
|
|
+ LogUtil.i("requestCode=" + requestCode);
|
|
|
+
|
|
|
+
|
|
|
switch (resultCode) {
|
|
|
case 0x20://单选
|
|
|
- if (data == null) return;
|
|
|
- SelectBean b = data.getParcelableExtra("data");
|
|
|
- LogUtil.d(JSON.toJSONString(b));
|
|
|
- if (b == null || StringUtil.isEmpty(b.getJson())) return;
|
|
|
- switch (requestCode) {
|
|
|
- case 0x21://来源
|
|
|
- et_business_source.setText(b.getName());
|
|
|
- break;
|
|
|
- case 0x24://商机库
|
|
|
- et_business.setText(b.getName());
|
|
|
-
|
|
|
- String bd_prop = JSON.parseObject(b.getJson()).getString("BD_PROP");
|
|
|
- if (bd_prop.equals(getString(R.string.business_common)) || bd_prop.equals(getString(R.string.business_get_split))) {
|
|
|
- //跟进人不可编辑,不可点击
|
|
|
- et_business_enterMan.setClickable(false);
|
|
|
- et_business_enterMan.setEnabled(false);
|
|
|
- et_business_enterMan.setText("");
|
|
|
- et_business_enterCode = 0;
|
|
|
- } else {
|
|
|
- //跟进人可编辑
|
|
|
- et_business_enterCode = 1;
|
|
|
- et_business_enterMan.setEnabled(true);
|
|
|
- et_business_enterMan.setClickable(true);
|
|
|
- // jsons.getJSONObject(i).getString("BD_PROP");
|
|
|
- // et_business_enterMan.setText(MyApplication.getInstance().mLoginUser.getNickName());
|
|
|
- }
|
|
|
- break;
|
|
|
- case 0x23://跟进入
|
|
|
- // enterManCode
|
|
|
- enterManCode = JSON.parseObject(b.getJson()).getString("em_code");
|
|
|
- et_business_enterMan.setText(b.getName());
|
|
|
- break;
|
|
|
- case 0x22://当前阶段
|
|
|
- et_business_jieDuan.setText(b.getName());
|
|
|
- break;
|
|
|
+ SelectBean b = null;
|
|
|
+ if (data != null) {
|
|
|
+ b = data.getParcelableExtra("data");
|
|
|
+ }
|
|
|
+ if (b == null) {
|
|
|
+ if (requestCode == 0x25) {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (StringUtil.isEmpty(b.getJson())) {
|
|
|
+ b.setJson("{}");
|
|
|
+ }
|
|
|
+ LogUtil.d(JSON.toJSONString(b));
|
|
|
+ switch (requestCode) {
|
|
|
+ case 0x21://来源
|
|
|
+ et_business_source.setText(b.getName());
|
|
|
+ break;
|
|
|
+ case 0x24://商机库
|
|
|
+ et_business.setText(b.getName());
|
|
|
+ String bd_prop = JSON.parseObject(b.getJson()).getString("BD_PROP");
|
|
|
+ if (bd_prop.equals(getString(R.string.business_common)) || bd_prop.equals(getString(R.string.business_get_split))) {
|
|
|
+ //跟进人不可编辑,不可点击
|
|
|
+ et_business_enterMan.setClickable(false);
|
|
|
+ et_business_enterMan.setEnabled(false);
|
|
|
+ et_business_enterMan.setText("");
|
|
|
+ et_business_enterCode = 0;
|
|
|
+ } else {
|
|
|
+ //跟进人可编辑
|
|
|
+ et_business_enterCode = 1;
|
|
|
+ et_business_enterMan.setEnabled(true);
|
|
|
+ et_business_enterMan.setClickable(true);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 0x23://跟进入
|
|
|
+ enterManCode = JSON.parseObject(b.getJson()).getString("em_code");
|
|
|
+ et_business_enterMan.setText(b.getName());
|
|
|
+ break;
|
|
|
+ case 0x22://当前阶段
|
|
|
+ et_business_jieDuan.setText(b.getName());
|
|
|
+ break;
|
|
|
+ case 0x25:
|
|
|
+ String name = StringUtil.isEmpty(b.getName()) ? "" : b.getName();
|
|
|
+ getEmnameByReturn(name);
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
break;
|
|
|
+ default:
|
|
|
+ if (requestCode == 0x25) {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
}
|