|
|
@@ -25,6 +25,9 @@ import com.xzjmyk.pm.activity.ui.erp.util.Constants;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.util.LogUtil;
|
|
|
import com.xzjmyk.pm.activity.ui.erp.view.SingleDialog;
|
|
|
|
|
|
+import org.json.JSONException;
|
|
|
+import org.json.JSONObject;
|
|
|
+
|
|
|
import java.net.URLEncoder;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
@@ -83,7 +86,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
|
|
|
private List<String> mLists = new ArrayList<String>();
|
|
|
private String et_cu_sellercode;
|
|
|
-
|
|
|
+ private int mCuId;
|
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
|
@@ -128,9 +131,11 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
if (type == 1) {
|
|
|
ll_infomal.setVisibility(View.VISIBLE);
|
|
|
getSupportActionBar().setTitle("客户录入");
|
|
|
+ CommonUtil.getCommonId(this,"PRECUSTOMER_SEQ",mHandler,GET_CU_ID);
|
|
|
} else {
|
|
|
ll_infomal.setVisibility(View.GONE);
|
|
|
getSupportActionBar().setTitle("客户预录入");
|
|
|
+ CommonUtil.getCommonId(this,"CUSTOMER_SEQ",mHandler,GET_CU_ID);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -157,6 +162,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
|
|
|
private void saveData() {
|
|
|
String formStore = "";
|
|
|
+ Log.i("commoncuid",mCuId+"");
|
|
|
if (type == 1) {
|
|
|
if (et_cu_code.testValidity() && et_cu_name.testValidity()
|
|
|
&& tv_cu_address.testValidity() && et_cu_kind.testValidity()
|
|
|
@@ -167,6 +173,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
&& tv_cu_businesscode.testValidity() && tv_cu_currency.testValidity()
|
|
|
&& tv_cu_taxrate.testValidity() && tv_cu_nichestep.testValidity()) {
|
|
|
formStore = "{\n" +
|
|
|
+ " \"cu_id\":" + mCuId + ",\n" +
|
|
|
" \"cu_code\":\"" + et_cu_code.getText().toString() + "\",\n" +
|
|
|
" \"cu_name\":\"" + et_cu_name.getText().toString() + "\",\n" +
|
|
|
" \"cu_shortname\":\"" + et_cu_shortname.getText().toString() + "\",\n" +
|
|
|
@@ -199,6 +206,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
&& tv_cu_contact.testValidity() && tv_cu_degree.testValidity()
|
|
|
&& tv_cu_mobile.testValidity() && tv_cu_email.testValidity()) {
|
|
|
formStore = "{\n" +
|
|
|
+ " \"cu_id\":" + mCuId + ",\n" +
|
|
|
" \"cu_code\":\"" + et_cu_code.getText().toString() + "\",\n" +
|
|
|
" \"cu_name\":\"" + et_cu_name.getText().toString() + "\",\n" +
|
|
|
" \"cu_shortname\":\"" + et_cu_shortname.getText().toString() + "\",\n" +
|
|
|
@@ -226,7 +234,7 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
private static final int PAY_METHODS = 22;
|
|
|
private static final int GET_CURRENCY = 23;
|
|
|
private static final int REQUEST_CLERK = 1;
|
|
|
-
|
|
|
+ private static final int GET_CU_ID = 25;
|
|
|
private Handler mHandler = new Handler() {
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
@@ -297,6 +305,17 @@ public class CustomerAddActivity extends BaseActivity implements View.OnClickLis
|
|
|
}
|
|
|
showSimpleDialog(tv_cu_currency, "币别");
|
|
|
break;
|
|
|
+ case GET_CU_ID:
|
|
|
+ String resultStr = msg.getData().getString("result");
|
|
|
+ try {
|
|
|
+ JSONObject resultJsonObject = new JSONObject(resultStr);
|
|
|
+ if (resultJsonObject != null && resultJsonObject.getBoolean("success")){
|
|
|
+ mCuId = resultJsonObject.getInt("id");
|
|
|
+ }
|
|
|
+ } catch (JSONException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
};
|