|
|
@@ -15,6 +15,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
|
|
import com.common.LogUtil;
|
|
|
import com.common.data.JSONUtil;
|
|
|
import com.core.app.Constants;
|
|
|
+import com.core.app.MyApplication;
|
|
|
import com.core.base.activity.BaseMVPActivity;
|
|
|
import com.core.utils.CommonUtil;
|
|
|
import com.me.network.app.base.HttpCallback;
|
|
|
@@ -42,6 +43,7 @@ import java.util.Map;
|
|
|
public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPresenter> implements View.OnClickListener, HttpCallback {
|
|
|
private final int CUSTOMER_INQUIRY_REPLY = 0x14;
|
|
|
private final int CUSTOMER_INQUIRY_DETAIL = 0x15;
|
|
|
+ private final int PUBLIC_INQUIRY_DETAIL = 0x16;
|
|
|
|
|
|
private RecyclerView mDataRecyclerView, mQuoteRecyclerView;
|
|
|
private ImageView mAddImageView;
|
|
|
@@ -99,12 +101,11 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
|
|
|
JSONObject detailObject = JSON.parseObject(mJson);
|
|
|
JSONObject inquiryObject = detailObject.getJSONObject("inquiry");
|
|
|
String checked = JSONUtil.getText(inquiryObject, "checked");
|
|
|
- long endDate = inquiryObject.getLongValue("endDate");
|
|
|
- long currentDate = System.currentTimeMillis();
|
|
|
- if ("1".equals(checked) || currentDate > endDate) {
|
|
|
- initEditable(false, View.GONE);
|
|
|
- } else {
|
|
|
+ String overdue = JSONUtil.getText(inquiryObject, "overdue");
|
|
|
+ if (!"1".equals(checked) || "0".equals(overdue)) {
|
|
|
initEditable(true, View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ initEditable(false, View.GONE);
|
|
|
}
|
|
|
} else {
|
|
|
initEditable(false, View.GONE);
|
|
|
@@ -126,10 +127,17 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
|
|
|
getSupportActionBar().setTitle(R.string.str_invalid);
|
|
|
initEditable(false, View.GONE);
|
|
|
break;
|
|
|
+ case Constants.FLAG.STATE_CUSTOMER_INQUIRY_ABANDONED:
|
|
|
+ getSupportActionBar().setTitle(R.string.str_abandoned);
|
|
|
+ initEditable(false, View.GONE);
|
|
|
+ break;
|
|
|
case Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO:
|
|
|
getSupportActionBar().setTitle(R.string.str_wait_quoted);
|
|
|
initEditable(true, View.VISIBLE);
|
|
|
break;
|
|
|
+ default:
|
|
|
+ initEditable(false, View.GONE);
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -160,6 +168,29 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
|
|
|
if (mJson != null && JSONUtil.validate(mJson)) {
|
|
|
initDetailData(mJson);
|
|
|
} else {
|
|
|
+ showLoading(null);
|
|
|
+
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+ params.put("en_uu", mEnuu);
|
|
|
+ params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
|
|
|
+ params.put("id", mId);
|
|
|
+ params.put("itemId", mId);
|
|
|
+
|
|
|
+ String host = "http://192.168.253.102:8090/platform-b2b/";
|
|
|
+ String url = "mobile/sale/inquiry/" + mId + "/info";
|
|
|
+ int flag = CUSTOMER_INQUIRY_DETAIL;
|
|
|
+ if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
|
|
|
+ host = "http://218.17.158.219:24000/";
|
|
|
+ url = "inquiry/sale/publicInquiry/detail";
|
|
|
+ flag = PUBLIC_INQUIRY_DETAIL;
|
|
|
+ }
|
|
|
+ HttpRequest.getInstance().sendRequest(host
|
|
|
+ , new HttpParams.Builder()
|
|
|
+ .url(url)
|
|
|
+ .method(Method.GET)
|
|
|
+ .flag(flag)
|
|
|
+ .setHeaders(new HashMap<String, Object>())
|
|
|
+ .setParams(params).build(), this);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
@@ -192,8 +223,8 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
|
|
|
String title = JSONUtil.getText(productObject, "title");
|
|
|
String spec = JSONUtil.getText(productObject, "spec");
|
|
|
String code = JSONUtil.getText(productObject, "code");
|
|
|
- material = title + (TextUtils.isEmpty(spec) ? "" : ("," + spec)
|
|
|
- + (TextUtils.isEmpty(code) ? "" : ("," + code)));//物料
|
|
|
+ material = title + (TextUtils.isEmpty(spec) ? "" : (",\n" + spec)
|
|
|
+ + (TextUtils.isEmpty(code) ? "" : (",\n" + code)));//物料
|
|
|
}
|
|
|
|
|
|
String currency = JSONUtil.getText(detailObject, "currency");//币别
|
|
|
@@ -321,10 +352,8 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
|
|
|
String repliesJson = JSON.toJSONString(replies);
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
-// params.put("en_uu", mEnuu);
|
|
|
- params.put("en_uu", 10041559);
|
|
|
-// params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
|
|
|
- params.put("user_tel", "15671616315");
|
|
|
+ params.put("en_uu", mEnuu);
|
|
|
+ params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
|
|
|
params.put("inquiryItemId", mId);
|
|
|
params.put("replies", repliesJson);
|
|
|
params.put("leadtime", leadtime);
|
|
|
@@ -358,19 +387,26 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
|
|
|
if (flag == CUSTOMER_INQUIRY_REPLY) {
|
|
|
getSupportActionBar().setTitle(R.string.str_quoted_price);
|
|
|
toast(getString(R.string.quote_success));
|
|
|
+ String publicId = "";
|
|
|
if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
|
|
|
setResult(Constants.FLAG.RESULT_PUBLIC_INQUIRY);
|
|
|
initEditable(false, View.GONE);
|
|
|
+ if (JSONUtil.validate(result)) {
|
|
|
+ JSONObject publicObject = JSON.parseObject(result);
|
|
|
+ publicId = JSONUtil.getText(publicObject, "content");
|
|
|
+ }
|
|
|
} else {
|
|
|
setResult(Constants.FLAG.RESULT_CUSTOMER_INQUIRY);
|
|
|
}
|
|
|
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
-// params.put("en_uu", mEnuu);
|
|
|
- params.put("en_uu", 10041559);
|
|
|
-// params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
|
|
|
- params.put("user_tel", "15671616315");
|
|
|
- params.put("itemId", mId);
|
|
|
+ params.put("en_uu", mEnuu);
|
|
|
+ params.put("user_tel", MyApplication.getInstance().mLoginUser.getTelephone());
|
|
|
+ if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
|
|
|
+ params.put("itemId", publicId);
|
|
|
+ } else {
|
|
|
+ params.put("itemId", mId);
|
|
|
+ }
|
|
|
|
|
|
String url = "mobile/sale/inquiry/" + mId + "/info";
|
|
|
String host = "http://192.168.253.102:8090/platform-b2b/";
|
|
|
@@ -388,9 +424,10 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
|
|
|
} else if (flag == CUSTOMER_INQUIRY_DETAIL) {
|
|
|
hideLoading();
|
|
|
|
|
|
- if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
|
|
|
-
|
|
|
- } else if (result != null && JSONUtil.validate(result)) {
|
|
|
+ if (result != null && JSONUtil.validate(result)
|
|
|
+ && (Constants.FLAG.STATE_CUSTOMER_INQUIRY_TODO.equals(mState)
|
|
|
+ || Constants.FLAG.STATE_CUSTOMER_INQUIRY_DONE.equals(mState)
|
|
|
+ || Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState))) {
|
|
|
JSONObject contentObject = JSON.parseObject(result);
|
|
|
JSONObject inquiryObject = contentObject.getJSONObject("inquiry");
|
|
|
String checked = JSONUtil.getText(inquiryObject, "checked");
|
|
|
@@ -406,11 +443,11 @@ public class CustomerInquiryDetailActivity extends BaseMVPActivity<WorkPlatPrese
|
|
|
}
|
|
|
initDetailData(result);
|
|
|
|
|
|
- if (Constants.FLAG.STATE_PUBLIC_INQUIRY_TODO.equals(mState)) {
|
|
|
- setResult(Constants.FLAG.RESULT_PUBLIC_INQUIRY);
|
|
|
- } else {
|
|
|
- setResult(Constants.FLAG.RESULT_CUSTOMER_INQUIRY);
|
|
|
- }
|
|
|
+ } else if (flag == PUBLIC_INQUIRY_DETAIL) {
|
|
|
+ hideLoading();
|
|
|
+
|
|
|
+ initEditable(true, View.VISIBLE);
|
|
|
+ initDetailData(result);
|
|
|
}
|
|
|
}
|
|
|
|