|
|
@@ -18,6 +18,7 @@ import com.lidroid.xutils.view.annotation.ViewInject;
|
|
|
import com.xzjmyk.pm.activity.R;
|
|
|
import com.xzjmyk.pm.activity.ui.base.BaseActivity;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.net.ViewUtil;
|
|
|
+import com.xzjmyk.pm.activity.ui.erp.util.CodeUtil;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.CommonUtil;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.Constants;
|
|
|
import com.xzjmyk.pm.activity.util.ToastUtil;
|
|
|
@@ -34,7 +35,7 @@ import java.util.Map;
|
|
|
* @param:
|
|
|
* @return:
|
|
|
*/
|
|
|
-public class BusinessLessActivity extends BaseActivity implements View.OnClickListener{
|
|
|
+public class BusinessLessActivity extends BaseActivity implements View.OnClickListener {
|
|
|
@ViewInject(R.id.ll_moment)
|
|
|
private LinearLayout ll_moment;
|
|
|
@ViewInject(R.id.ll_leader)
|
|
|
@@ -47,7 +48,9 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
|
|
|
@ViewInject(R.id.tv_leader)
|
|
|
private TextView tv_leader;
|
|
|
@ViewInject(R.id.tv_date)
|
|
|
- private TextView tv_date;
|
|
|
+ private TextView tv_date;
|
|
|
+
|
|
|
+ private String bcd_code = "";
|
|
|
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
@@ -72,13 +75,14 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
|
|
|
private String code;
|
|
|
private String process;
|
|
|
private String doman;
|
|
|
+
|
|
|
private void initData() {
|
|
|
Intent intent = getIntent();
|
|
|
if (intent != null) {
|
|
|
type = intent.getIntExtra("type", 1);
|
|
|
- code=intent.getStringExtra("code");
|
|
|
- process=intent.getStringExtra("process");
|
|
|
- doman=intent.getStringExtra("doman");
|
|
|
+ code = intent.getStringExtra("code");
|
|
|
+ process = intent.getStringExtra("process");
|
|
|
+ doman = intent.getStringExtra("doman");
|
|
|
}
|
|
|
|
|
|
switch (type) {
|
|
|
@@ -107,11 +111,19 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
|
|
|
public boolean onOptionsItemSelected(MenuItem item) {
|
|
|
switch (item.getItemId()) {
|
|
|
case R.id.btn_save:
|
|
|
- if (type==1) {
|
|
|
- sendHttpResquest(Constants.HTTP_SUCCESS_INIT,"失效");
|
|
|
+ if (type == 1) {
|
|
|
+ CodeUtil.getInstance().getCode(ct, "BusinessChanceData", new CodeUtil.OnCodeLinstener() {
|
|
|
+ @Override
|
|
|
+ public void callBack(String code) {
|
|
|
+ bcd_code = code;
|
|
|
+ sendHttpResquest(Constants.HTTP_SUCCESS_INIT, "失效");
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
- if (type==2){
|
|
|
- sendHttpResquest(Constants.HTTP_SUCCESS_INIT,"继续跟进");
|
|
|
+ if (type == 2) {
|
|
|
+ sendHttpResquest(Constants.HTTP_SUCCESS_INIT, "继续跟进");
|
|
|
+
|
|
|
}
|
|
|
break;
|
|
|
case android.R.id.home:
|
|
|
@@ -122,14 +134,19 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
|
|
|
}
|
|
|
|
|
|
|
|
|
- private Handler mHandler=new Handler(){
|
|
|
+ private Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
- switch (msg.what){
|
|
|
+ switch (msg.what) {
|
|
|
case Constants.HTTP_SUCCESS_INIT:
|
|
|
progressDialog.dismiss();
|
|
|
Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
|
|
|
ViewUtil.ToastMessage(ct, "操作成功!");
|
|
|
+ if (type == 2) {
|
|
|
+ updataSchedule(0x16);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 0x16:
|
|
|
jumpToStateActivity();
|
|
|
break;
|
|
|
case Constants.APP_SOCKETIMEOUTEXCEPTION:
|
|
|
@@ -140,7 +157,7 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
|
|
|
case 2:
|
|
|
progressDialog.dismiss();
|
|
|
Log.i(TAG, "handleMessage:" + msg.getData().getString("result"));
|
|
|
- String leader= JSON.parseObject(msg.getData().getString("result"))
|
|
|
+ String leader = JSON.parseObject(msg.getData().getString("result"))
|
|
|
.getJSONObject("data").getString("em_name");
|
|
|
tv_leader.setText(leader);
|
|
|
break;
|
|
|
@@ -154,39 +171,47 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
|
|
|
startActivity(intent);
|
|
|
}
|
|
|
|
|
|
- private void sendHttpResquest(int what,String type){
|
|
|
+ private void updataSchedule(int what) {
|
|
|
+ String url = Constants.getAppBaseUrl(ct) + "mobile/crm/updateSchedule.action";
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("code", code);
|
|
|
+ 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");
|
|
|
+ }
|
|
|
+
|
|
|
+ private void sendHttpResquest(int what, String type) {
|
|
|
progressDialog.show();
|
|
|
- String remark=et_remark.getText().toString();
|
|
|
- String gridSore="{\n" +
|
|
|
- "\"bcd_bccode\":\""+code+"\",\n" +
|
|
|
- "\"bcd_remark\":\""+remark+"\",\n" +
|
|
|
- "\"bcd_leader\":\""+tv_leader.getText().toString()+"\",\n" +
|
|
|
- "\"bcd_date\":\""+tv_date.getText().toString()+"\",\n" +
|
|
|
- "\"bcd_bsname\":\""+process+"\",\n" +
|
|
|
- "\"bcd_type\":\""+type+"\",\n" +
|
|
|
- "\"bcd_man\":\""+doman+"\""+
|
|
|
+ String remark = et_remark.getText().toString();
|
|
|
+ String gridSore = "{\n" +
|
|
|
+ "\"bcd_bccode\":\"" + code + "\",\n" +
|
|
|
+ "\"bcd_remark\":\"" + remark + "\",\n" +
|
|
|
+ "\"bcd_leader\":\"" + tv_leader.getText().toString() + "\",\n" +
|
|
|
+ "\"bcd_date\":\"" + tv_date.getText().toString() + "\",\n" +
|
|
|
+ "\"bcd_bsname\":\"" + process + "\",\n" +
|
|
|
+ "\"bcd_type\":\"" + type + "\",\n" +
|
|
|
+ "\"bcd_man\":\"" + doman + "\"" + (this.type == 1 ? ",\n\"bcd_code\":\"" + bcd_code + "\"\n" : "") +
|
|
|
"}";
|
|
|
- String url= Constants.getAppBaseUrl(ct)+"mobile/crm/updatebusinessChanceData.action";
|
|
|
-
|
|
|
- Map<String,Object> params=new HashMap<>();
|
|
|
+ String url = Constants.getAppBaseUrl(ct) + "mobile/crm/updatebusinessChanceData.action";
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
params.put("gridStore", gridSore);
|
|
|
params.put("caller", "BusinessChance");
|
|
|
- LinkedHashMap<String , Object> headers=new LinkedHashMap<>();
|
|
|
+ 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");
|
|
|
}
|
|
|
-
|
|
|
- private void loadLeader(int what){
|
|
|
- String url= Constants.getAppBaseUrl(ct)+"mobile/crm/getheadmanmsg.action";
|
|
|
- Map<String,Object> params=new HashMap<>();
|
|
|
+
|
|
|
+ private void loadLeader(int what) {
|
|
|
+ String url = Constants.getAppBaseUrl(ct) + "mobile/crm/getheadmanmsg.action";
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
params.put("emcode", CommonUtil.getSharedPreferences(ct, "erp_username"));
|
|
|
- LinkedHashMap<String , Object> headers=new LinkedHashMap<>();
|
|
|
+ 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");
|
|
|
}
|
|
|
-
|
|
|
- private void showDateWheel(final int resId){
|
|
|
- DatePicker picker = new DatePicker(this,DatePicker.YEAR_MONTH_DAY);
|
|
|
+
|
|
|
+ private void showDateWheel(final int resId) {
|
|
|
+ DatePicker picker = new DatePicker(this, DatePicker.YEAR_MONTH_DAY);
|
|
|
picker.setRange(1950, 2030);
|
|
|
//Calendar.getInstance().get(Calendar.DAY_OF_MONTH)
|
|
|
picker.setSelectedItem(
|
|
|
@@ -194,11 +219,11 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
|
|
|
Calendar.getInstance().get(Calendar.MONTH) + 1);
|
|
|
picker.setOnDatePickListener(new DatePicker.OnYearMonthDayPickListener() {
|
|
|
@Override
|
|
|
- public void onDatePicked(String year, String month,String day) {
|
|
|
+ public void onDatePicked(String year, String month, String day) {
|
|
|
switch (resId) {
|
|
|
case R.id.tv_date://排名
|
|
|
ToastUtil.showToast(ct, year + "-" + month);
|
|
|
- tv_date.setText(year + "-" + month+"-"+day);
|
|
|
+ tv_date.setText(year + "-" + month + "-" + day);
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
@@ -206,10 +231,10 @@ public class BusinessLessActivity extends BaseActivity implements View.OnClickLi
|
|
|
picker.show();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
|
- switch (v.getId()){
|
|
|
+ switch (v.getId()) {
|
|
|
case R.id.tv_leader:
|
|
|
loadLeader(2);
|
|
|
break;
|