|
|
@@ -201,11 +201,11 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
|
|
|
public void run() {
|
|
|
JSONObject object = JSON.parseObject(message);
|
|
|
final List<Purchase> dataList = new ArrayList<>();
|
|
|
- dataList.add(getPurchase(object));
|
|
|
+ dataList.add(getPurchase(true, object));
|
|
|
JSONArray orderItems = JSONUtil.getJSONArray(object, "orderItems");
|
|
|
if (!ListUtils.isEmpty(orderItems)) {
|
|
|
for (int i = 0; i < orderItems.size(); i++) {
|
|
|
- dataList.add(getPurchase(orderItems.getJSONObject(i)));
|
|
|
+ dataList.add(getPurchase(false, orderItems.getJSONObject(i)));
|
|
|
}
|
|
|
}
|
|
|
OAHttpHelper.getInstance().post(new Runnable() {
|
|
|
@@ -219,18 +219,30 @@ public class PurchaseDetailsActivity extends BaseNetActivity implements OnSmartH
|
|
|
}
|
|
|
|
|
|
|
|
|
- private Purchase getPurchase(JSONObject object) {
|
|
|
+ private Purchase getPurchase(boolean first, JSONObject object) {
|
|
|
Purchase purchase = new Purchase();
|
|
|
int id = JSONUtil.getInt(object, "id");
|
|
|
String client = JSONUtil.getText(object, "receiveName");//客户
|
|
|
String address = JSONUtil.getText(object, "shipAddress");//收货地址
|
|
|
- String code = JSONUtil.getText(object, "code");//采购单号
|
|
|
String time = DateFormatUtil.long2Str(JSONUtil.getLong(object, "erpDate", "date"), DateFormatUtil.YMD_HMS);//单据时间
|
|
|
- String remarks = JSONUtil.getText(object, "remark");//备注
|
|
|
- String alls = JSONUtil.getText(object, "amount");//总额
|
|
|
String number = JSONUtil.getText(object, "qty");//数量
|
|
|
String date = DateFormatUtil.long2Str(JSONUtil.getLong(object, "replyDelivery", "delivery"), DateFormatUtil.YMD);//交货日期
|
|
|
String replyRemark = JSONUtil.getText(object, "replyRemark");//采购单号
|
|
|
+
|
|
|
+
|
|
|
+ String code;//采购单号
|
|
|
+ String remarks;//备注|产品
|
|
|
+ String alls ;//总额|产品规格
|
|
|
+ if (first) {
|
|
|
+ code = JSONUtil.getText(object, "code");//采购单号
|
|
|
+ remarks = JSONUtil.getText(object, "remark");//备注
|
|
|
+ alls = JSONUtil.getText(object, "amount");//总额
|
|
|
+ } else {
|
|
|
+ JSONObject product = JSONUtil.getJSONObject(object, "product");
|
|
|
+ code = JSONUtil.getText(product, "cmpCode");
|
|
|
+ remarks = JSONUtil.getText(product, "title");
|
|
|
+ alls = JSONUtil.getText(product, "spec");
|
|
|
+ }
|
|
|
purchase.setId(id);
|
|
|
purchase.setCode(code);
|
|
|
purchase.setCustomer(client);
|