|
|
@@ -52,7 +52,7 @@ import java.util.Map;
|
|
|
* @return:
|
|
|
*/
|
|
|
public class BusinessDetailActivty extends BaseActivity {
|
|
|
-
|
|
|
+
|
|
|
private BussinessDetailAdapter mAdapter;
|
|
|
@ViewInject(R.id.ll_top_state)
|
|
|
private LinearLayout ll_top_state;
|
|
|
@@ -69,6 +69,7 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
private EmptyLayout mEmptyLayout;
|
|
|
|
|
|
private final int CAN_QIANG_NOT = 34;
|
|
|
+
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@@ -86,7 +87,7 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
|
|
|
private void initView() {
|
|
|
ViewUtils.inject(this);
|
|
|
- mEmptyLayout = new EmptyLayout(this,mlist.getRefreshableView());
|
|
|
+ mEmptyLayout = new EmptyLayout(this, mlist.getRefreshableView());
|
|
|
mEmptyLayout.setShowLoadingButton(false);
|
|
|
mEmptyLayout.setShowEmptyButton(false);
|
|
|
mEmptyLayout.setShowErrorButton(false);
|
|
|
@@ -112,9 +113,9 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
final BussinessDetailAdapter.ViewHolder holder = (BussinessDetailAdapter.ViewHolder) view.getTag();
|
|
|
|
|
|
startActivity(new Intent(BusinessDetailActivty.this, BusinessDetailInfoActivity.class)
|
|
|
- .putExtra("type", holder.type)
|
|
|
- .putExtra("formCondition", formCondition + "=" + holder.bc_id)
|
|
|
- .putExtra("gridCondition", gridCondition + "=" + holder.bc_id)
|
|
|
+ .putExtra("type", holder.type)
|
|
|
+ .putExtra("formCondition", formCondition + "=" + holder.bc_id)
|
|
|
+ .putExtra("gridCondition", gridCondition + "=" + holder.bc_id)
|
|
|
);
|
|
|
}
|
|
|
});
|
|
|
@@ -149,7 +150,7 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
type = 0;
|
|
|
if (intent != null) {
|
|
|
type = intent.getIntExtra("bt_type", 0);
|
|
|
- business_steps=intent.getStringExtra("steps");
|
|
|
+ business_steps = intent.getStringExtra("steps");
|
|
|
}
|
|
|
if (type == 0) {
|
|
|
getSupportActionBar().setTitle("商机跟进");
|
|
|
@@ -160,7 +161,7 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
} else if (type == 2) {
|
|
|
getSupportActionBar().setTitle("商机分配");
|
|
|
ll_top_state.setVisibility(View.GONE);
|
|
|
- }else if(type==3){
|
|
|
+ } else if (type == 3) {
|
|
|
getSupportActionBar().setTitle("商机");
|
|
|
ll_top_state.setVisibility(View.GONE);
|
|
|
}
|
|
|
@@ -208,7 +209,7 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
holder.tv_phone = (TextView) convertView.findViewById(R.id.tv_crm_business_phone);
|
|
|
holder.tv_source = (TextView) convertView.findViewById(R.id.tv_crm_business_source);
|
|
|
// holder.tv_num= (TextView) convertView.findViewById(R.id.tv_crm_business_num);
|
|
|
- holder.tv_steps= (TextView) convertView.findViewById(R.id.tv_crm_business_steps);
|
|
|
+ holder.tv_steps = (TextView) convertView.findViewById(R.id.tv_crm_business_steps);
|
|
|
holder.iv_event = (ImageView) convertView.findViewById(R.id.iv_business_qiang);
|
|
|
convertView.setTag(holder);
|
|
|
} else {
|
|
|
@@ -231,12 +232,12 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
holder.iv_event.setVisibility(View.VISIBLE);
|
|
|
holder.iv_event.setImageResource(R.drawable.ic_qiang);
|
|
|
} else if (mdata.get(position).getType() == 2) {
|
|
|
- // holder.bt_event.setText("分配");
|
|
|
+ // holder.bt_event.setText("分配");
|
|
|
holder.iv_event.setVisibility(View.VISIBLE);
|
|
|
holder.iv_event.setImageResource(R.drawable.ic_fenpei);
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
holder.iv_event.setVisibility(View.GONE);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
// holder.tv_date.setText(mdata.get(position).getDate());
|
|
|
holder.iv_event.setOnClickListener(new View.OnClickListener() {
|
|
|
@@ -246,8 +247,8 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
bc_code = mdata.get(position).getNum();
|
|
|
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"));
|
|
|
@@ -323,7 +324,7 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
TextView tv_note;
|
|
|
TextView tv_datetv;
|
|
|
TextView tv_date;
|
|
|
-// Button bt_event;
|
|
|
+ // Button bt_event;
|
|
|
ImageView iv_event;
|
|
|
int type;
|
|
|
}
|
|
|
@@ -341,8 +342,8 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
|
|
|
formCondition = JSON.parseObject(msg.getData().getString("result")).getString("keyField");
|
|
|
gridCondition = JSON.parseObject(msg.getData().getString("result")).getString("pfField");
|
|
|
- if (StringUtils.isEmpty(formCondition))formCondition="bc_id";
|
|
|
- if (StringUtils.isEmpty(gridCondition))gridCondition="bc_id";
|
|
|
+ if (StringUtils.isEmpty(formCondition)) formCondition = "bc_id";
|
|
|
+ if (StringUtils.isEmpty(gridCondition)) gridCondition = "bc_id";
|
|
|
JSONArray array = JSON.parseObject(msg.getData().getString("result")).getJSONArray("listdata");
|
|
|
if (!array.isEmpty()) {
|
|
|
for (int i = 0; i < array.size(); i++) {
|
|
|
@@ -397,13 +398,13 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
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, bc_code, MyApplication.getInstance().mLoginUser.getNickName());
|
|
|
- }else if ("1".equals(isok)){
|
|
|
- Log.i("qiang",isok);
|
|
|
+ } else if ("1".equals(isok)) {
|
|
|
+ Log.i("qiang", isok);
|
|
|
progressDialog.dismiss();
|
|
|
- Crouton.makeText(BusinessDetailActivty.this,"您已超出最大获取商机数!",0xffff4444,2000).show();
|
|
|
+ Crouton.makeText(BusinessDetailActivty.this, "您已超出最大获取商机数!", 0xffff4444, 2000).show();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -411,31 +412,30 @@ public class BusinessDetailActivty extends BaseActivity {
|
|
|
|
|
|
private void sendHttpResquest(int what, int page) {
|
|
|
progressDialog.show();
|
|
|
- if (CommonUtil.isNetWorkConnected(this)){
|
|
|
+ if (CommonUtil.isNetWorkConnected(this)) {
|
|
|
String url = Constants.getAppBaseUrl(ct) + "mobile/common/list.action";
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
if (page == 1) mData.clear();
|
|
|
params.put("page", page);
|
|
|
- params.put("emcode", CommonUtil.getSharedPreferences(ct,"erp_username"));
|
|
|
- params.put("currentMaster", CommonUtil.getSharedPreferences(ct,"erp_master"));
|
|
|
+ params.put("emcode", CommonUtil.getSharedPreferences(ct, "erp_username"));
|
|
|
+ params.put("currentMaster", CommonUtil.getSharedPreferences(ct, "erp_master"));
|
|
|
params.put("pageSize", 10);
|
|
|
params.put("caller", "BusinessChance");
|
|
|
- if (type==1){//抢
|
|
|
+ if (type == 1) {//抢
|
|
|
params.put("condition", "nvl(bc_status,' ')<>'已失效' and nvl(bc_doman,' ')=' ' and bc_nichehouse in (select bd_name from BusinessDataBase where bd_prop='公有')");
|
|
|
- }else
|
|
|
- if (type==2){//分配
|
|
|
+ } else if (type == 2) {//分配
|
|
|
params.put("condition", "nvl(bc_status,' ')<>'已失效' and nvl(bc_doman,' ')=' ' and bc_nichehouse in (select bd_name from BusinessDataBase where bd_admincode=" +
|
|
|
- "'"+CommonUtil.getSharedPreferences(ct,"erp_username")+"')");
|
|
|
- }else if(type==3){//商机列表
|
|
|
- params.put("condition","bc_currentprocess='"+business_steps+"'");
|
|
|
- }else{//跟进
|
|
|
+ "'" + CommonUtil.getSharedPreferences(ct, "erp_username") + "')");
|
|
|
+ } else if (type == 3) {//商机列表
|
|
|
+ params.put("condition", "bc_currentprocess='" + business_steps + "'");
|
|
|
+ } else {//跟进
|
|
|
params.put("condition", "(bc_type='公有' or nvl(bc_type,' ')=' ')");
|
|
|
}
|
|
|
//bc_currentprocess=商机阶段
|
|
|
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");
|
|
|
- }else {
|
|
|
+ } else {
|
|
|
progressDialog.dismiss();
|
|
|
mEmptyLayout.setErrorMessage("网络未连接!");
|
|
|
mEmptyLayout.showError();
|