|
|
@@ -49,7 +49,6 @@ import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* @功能:商机详情
|
|
|
* @author:Arisono
|
|
|
@@ -58,8 +57,8 @@ import java.util.Map;
|
|
|
*/
|
|
|
public class BusinessDetailInfoActivity extends BaseActivity implements View.OnClickListener {
|
|
|
|
|
|
- private static final int LOAD_JIEDUAN =0x21 ;
|
|
|
- private static final int LOAD_STAGEPOINT =0x22 ;
|
|
|
+ private static final int LOAD_JIEDUAN = 0x21;
|
|
|
+ private static final int LOAD_STAGEPOINT = 0x22;
|
|
|
@ViewInject(R.id.bt_fenpei)
|
|
|
private Button bt_fenpei;
|
|
|
@ViewInject(R.id.bt_qiang)
|
|
|
@@ -115,21 +114,22 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
|
|
|
@ViewInject(R.id.stepsView)
|
|
|
private StepsView mStepsView;
|
|
|
-
|
|
|
- @ViewInject(R.id. lv_business)
|
|
|
+
|
|
|
+ @ViewInject(R.id.lv_business)
|
|
|
private StickyListHeadersListView mList;
|
|
|
-
|
|
|
+
|
|
|
private StickyListAdapter mAapter;
|
|
|
-
|
|
|
+
|
|
|
private int type = 0;
|
|
|
private String formCondition;
|
|
|
private String gridCondition;
|
|
|
private String en_code;
|
|
|
|
|
|
- private String[] labels;
|
|
|
+ private String[] labels;
|
|
|
|
|
|
private final static int BUSINESS_FAILURE_REQUEST = 99;
|
|
|
private final static int BUSINESS_FOLLOW_REQUEST = 100;
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@@ -183,22 +183,22 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
}
|
|
|
|
|
|
|
|
|
- List<SimpleData> hasHeaderIdList = new ArrayList<SimpleData>();
|
|
|
- int groupId = 1;
|
|
|
- for (int i = 0; i < 25; i++) {
|
|
|
- SimpleData item = new SimpleData();
|
|
|
- item.setLeft("左边"+i);
|
|
|
- item.setRight("右边"+i);
|
|
|
- item.setGroupId(groupId);
|
|
|
- item.setGroup("组名" + groupId);
|
|
|
- if (i % 5 == 0) {
|
|
|
- groupId++;
|
|
|
- }
|
|
|
- hasHeaderIdList.add(item);
|
|
|
+ List<SimpleData> hasHeaderIdList = new ArrayList<SimpleData>();
|
|
|
+ int groupId = 1;
|
|
|
+ for (int i = 0; i < 25; i++) {
|
|
|
+ SimpleData item = new SimpleData();
|
|
|
+ item.setLeft("左边" + i);
|
|
|
+ item.setRight("右边" + i);
|
|
|
+ item.setGroupId(groupId);
|
|
|
+ item.setGroup("组名" + groupId);
|
|
|
+ if (i % 5 == 0) {
|
|
|
+ groupId++;
|
|
|
}
|
|
|
- mAapter=new StickyListAdapter(mContext,hasHeaderIdList);
|
|
|
+ hasHeaderIdList.add(item);
|
|
|
+ }
|
|
|
+ mAapter = new StickyListAdapter(mContext, hasHeaderIdList);
|
|
|
mList.setAdapter(mAapter);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private void initListener() {
|
|
|
@@ -221,7 +221,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
showPopupWindow(v.findViewById(R.id.bt_manage_go));
|
|
|
break;
|
|
|
case R.id.bt_manage_date:
|
|
|
- isEnableClick(bt_code,5);
|
|
|
+ isEnableClick(bt_code, 5);
|
|
|
break;
|
|
|
case R.id.bt_qiang:
|
|
|
progressDialog.show();
|
|
|
@@ -289,14 +289,14 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
.putExtra("type", 1)
|
|
|
.putExtra("code", bt_code)
|
|
|
.putExtra("process", bt_process)
|
|
|
- .putExtra("doman", bt_doman),BUSINESS_FAILURE_REQUEST);
|
|
|
+ .putExtra("doman", bt_doman), BUSINESS_FAILURE_REQUEST);
|
|
|
break;
|
|
|
case 3:
|
|
|
startActivityForResult(new Intent(BusinessDetailInfoActivity.this, BusinessLessActivity.class)
|
|
|
.putExtra("type", 2)
|
|
|
.putExtra("code", bt_code)
|
|
|
.putExtra("process", bt_process)
|
|
|
- .putExtra("doman", bt_doman),BUSINESS_FOLLOW_REQUEST);
|
|
|
+ .putExtra("doman", bt_doman), BUSINESS_FOLLOW_REQUEST);
|
|
|
break;
|
|
|
/* case 4:
|
|
|
startActivity(new Intent(BusinessDetailInfoActivity.this, BusinessTransferActivity.class)
|
|
|
@@ -304,11 +304,11 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
break;*/
|
|
|
case 4:
|
|
|
startActivity(new Intent(BusinessDetailInfoActivity.this, CustomerAddActivity.class)
|
|
|
- .putExtra("companyname",bc_custname.getText().toString().trim())
|
|
|
- .putExtra("companyaddress",bc_address.getText().toString().trim())
|
|
|
- .putExtra("contact",bc_contact.getText().toString().trim())
|
|
|
- .putExtra("position",bc_position.getText().toString().trim())
|
|
|
- .putExtra("telephone",bt_tel.getText().toString().trim())
|
|
|
+ .putExtra("companyname", bc_custname.getText().toString().trim())
|
|
|
+ .putExtra("companyaddress", bc_address.getText().toString().trim())
|
|
|
+ .putExtra("contact", bc_contact.getText().toString().trim())
|
|
|
+ .putExtra("position", bc_position.getText().toString().trim())
|
|
|
+ .putExtra("telephone", bt_tel.getText().toString().trim())
|
|
|
);
|
|
|
break;
|
|
|
case 5:
|
|
|
@@ -399,9 +399,8 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
bt_doman = root.getString("bc_doman");
|
|
|
bt_code = root.getString("bc_code");
|
|
|
bt_process = root.getString("bc_currentprocess");
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
loadJieDuan();
|
|
|
loadStagePoints();
|
|
|
@@ -409,16 +408,16 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
case BUSINESS_QIANG:
|
|
|
Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
|
|
|
progressDialog.dismiss();
|
|
|
- Crouton.makeText(activity,45,"成功抢得此商机,\n" +
|
|
|
+ Crouton.makeText(activity, 45, "成功抢得此商机,\n" +
|
|
|
"请到商机跟进中查看商机!\n",
|
|
|
getResources().getColor(R.color.light_green),
|
|
|
5000).show();
|
|
|
- new Handler().postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- finish();
|
|
|
- }
|
|
|
- },5000);
|
|
|
+ new Handler().postDelayed(new Runnable() {
|
|
|
+ @Override
|
|
|
+ public void run() {
|
|
|
+ finish();
|
|
|
+ }
|
|
|
+ }, 5000);
|
|
|
// startActivity(new Intent(ct, BusinessDetailActivty.class).putExtra("bt_type",1));
|
|
|
break;
|
|
|
case BUSINESS_FENPEI:
|
|
|
@@ -427,7 +426,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
crm_ll_followup.setVisibility(View.GONE);
|
|
|
crm_ll_qiang.setVisibility(View.GONE);
|
|
|
crm_ll_manage.setVisibility(View.GONE);
|
|
|
- // finish();
|
|
|
+ // finish();
|
|
|
// startActivity(new Intent(ct, BusinessDetailActivty.class).putExtra("bt_type",2));
|
|
|
break;
|
|
|
case BUSINESS_RELEASE:
|
|
|
@@ -449,15 +448,15 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
}
|
|
|
case 5:
|
|
|
progressDialog.dismiss();
|
|
|
- result = JSON.parseObject(msg.getData().getString("result"));
|
|
|
- JSONArray items=result.getJSONArray("result");
|
|
|
- if (items!=null){
|
|
|
- if (items.size()>0){
|
|
|
+ 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{
|
|
|
+ } else {
|
|
|
Intent intent = new Intent(ct, TaskAddActivity.class);
|
|
|
intent.putExtra("type", 1);
|
|
|
- intent.putExtra("from","BusinessDetailInfo");
|
|
|
+ intent.putExtra("from", "BusinessDetailInfo");
|
|
|
intent.putExtra("data", bt_code);
|
|
|
startActivityForResult(intent, 0x11);
|
|
|
}
|
|
|
@@ -474,25 +473,25 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
|
|
|
String json = msg.getData().getString("result");
|
|
|
JSONArray array = JSON.parseObject(json).getJSONArray("stages");
|
|
|
- labels=new String[array.size()];
|
|
|
+ labels = new String[array.size()];
|
|
|
if (!array.isEmpty()) {
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
- // lists.add(array.getJSONObject(i).getString("BS_NAME"));
|
|
|
- labels[i]=array.getJSONObject(i).getString("BS_NAME");
|
|
|
+ // lists.add(array.getJSONObject(i).getString("BS_NAME"));
|
|
|
+ labels[i] = array.getJSONObject(i).getString("BS_NAME");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (labels!=null){
|
|
|
- int position=0;
|
|
|
- for (int i=0;i<labels.length;i++){
|
|
|
- if (labels[i].equals(bc_currentprocess.getText().toString())){
|
|
|
- position=i;
|
|
|
+ if (labels != null) {
|
|
|
+ int position = 0;
|
|
|
+ for (int i = 0; i < labels.length; i++) {
|
|
|
+ if (labels[i].equals(bc_currentprocess.getText().toString())) {
|
|
|
+ position = i;
|
|
|
}
|
|
|
}
|
|
|
LogUtil.d(JSON.toJSONString(labels));
|
|
|
LogUtil.d(JSON.toJSONString(position));
|
|
|
LogUtil.d(bc_currentprocess.getText().toString());
|
|
|
- mStepsView.setCompletedPosition(position%labels.length)
|
|
|
+ mStepsView.setCompletedPosition(position % labels.length)
|
|
|
.setLabels(labels)
|
|
|
.setBarColorIndicator(
|
|
|
ct.getResources().getColor(R.color.light_gray))
|
|
|
@@ -502,11 +501,11 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
}
|
|
|
break;
|
|
|
case LOAD_STAGEPOINT:
|
|
|
- progressDialog.dismiss();
|
|
|
- Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
|
|
|
- json = msg.getData().getString("result");
|
|
|
- LogUtil.d(JSON.toJSONString(json));
|
|
|
-
|
|
|
+ progressDialog.dismiss();
|
|
|
+ Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
|
|
|
+ json = msg.getData().getString("result");
|
|
|
+ LogUtil.d(JSON.toJSONString(json));
|
|
|
+
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -540,7 +539,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
if (StringUtils.isEmpty(emname)) {
|
|
|
emname = MyApplication.getInstance().mLoginUser.getNickName().trim();
|
|
|
}
|
|
|
- params.put("bc_doman",emname);
|
|
|
+ params.put("bc_doman", emname);
|
|
|
params.put("bc_domancode", CommonUtil.getSharedPreferences(ct, "erp_username"));
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
@@ -563,7 +562,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
|
|
|
}
|
|
|
|
|
|
- public void isEnableClick(String bt_code,int what){
|
|
|
+ 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<>();
|
|
|
@@ -577,7 +576,7 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
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) {
|
|
|
@@ -590,13 +589,13 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
sendHttpBusinessFenpei(BUSINESS_FENPEI, bt_code, bt_doman, en_code);
|
|
|
break;
|
|
|
case BUSINESS_FAILURE_REQUEST:
|
|
|
- if (data == null){
|
|
|
+ if (data == null) {
|
|
|
return;
|
|
|
}
|
|
|
this.finish();
|
|
|
break;
|
|
|
case BUSINESS_FOLLOW_REQUEST:
|
|
|
- if (data == null){
|
|
|
+ if (data == null) {
|
|
|
return;
|
|
|
}
|
|
|
this.finish();
|
|
|
@@ -622,8 +621,6 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* @desc:加载阶段
|
|
|
* @author:Arison on 2016/7/20
|
|
|
@@ -637,16 +634,16 @@ public class BusinessDetailInfoActivity extends BaseActivity implements View.OnC
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, LOAD_JIEDUAN, null, null, "post");
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- public void loadStagePoints(){
|
|
|
+
|
|
|
+
|
|
|
+ public void loadStagePoints() {
|
|
|
progressDialog.show();
|
|
|
String url = Constants.getAppBaseUrl(ct) + "mobile/crm/getStagePoints.action";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
params.put("bccode", "2016120035");
|
|
|
params.put("currentStep", "testpoints");
|
|
|
- params.put("master", CommonUtil.getSharedPreferences(mContext,"erp_master"));
|
|
|
-
|
|
|
+ params.put("master", CommonUtil.getSharedPreferences(mContext, "erp_master"));
|
|
|
+
|
|
|
LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
|
|
|
headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
|
|
|
ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, LOAD_STAGEPOINT, null, null, "post");
|