Ejemplo n.º 1
0
 /**
  * 修理厂申请列表
  *
  * @param string
  * @return
  */
 public static Object getFactoryApplyModel(String string) {
   if (getResultInt(string) == 0) {
     try {
       JSONObject object = new JSONObject(string);
       JSONObject result = object.getJSONObject("result");
       JSONObject data1 = result.getJSONObject("data");
       JSONArray data2 = data1.getJSONArray("data");
       ArrayList<FactoryApplyModel> models = new ArrayList<>();
       for (int i = 0; i < data2.length(); i++) {
         JSONObject jsonObject = data2.getJSONObject(i);
         FactoryApplyModel model = new FactoryApplyModel();
         model.setAddrs(jsonObject.getString("addrs"));
         model.setArea(jsonObject.getString("area"));
         model.setAreaframe(jsonObject.getString("areaframe"));
         model.setBusiness_encoding(jsonObject.getString("business_encoding"));
         model.setBusiness_photo(jsonObject.getString("business_photo"));
         model.setContact_person(jsonObject.getString("contact_person"));
         model.setContact_tel(jsonObject.getString("contact_tel"));
         model.setDesc(jsonObject.getString("desc"));
         model.setEparchy(jsonObject.getString("eparchy"));
         model.setRepair_name(jsonObject.getString("repair_name"));
         model.setShop_id(ParamUtils.converNull(jsonObject.getString("shop_id")));
         model.setStatus(jsonObject.getInt("status"));
         model.setUser_id(jsonObject.getString("user_id"));
         model.setUser_identity(jsonObject.getString("user_identity"));
         model.setUser_name(jsonObject.getString("user_name"));
         models.add(model);
       }
       return models;
     } catch (JSONException e) {
       e.printStackTrace();
     }
     return null;
   } else {
     return getErrorValue(string);
   }
 }
Ejemplo n.º 2
0
 /**
  * 获取订单列表
  *
  * @param string
  * @return
  */
 public static Object getOrderModel(String string) {
   if (getResultInt(string) == 0) {
     try {
       JSONObject object = new JSONObject(string);
       JSONObject result = object.getJSONObject("result");
       JSONObject data1 = result.getJSONObject("data");
       JSONArray data2 = data1.getJSONArray("data");
       ArrayList<ParentOrderModel> models = new ArrayList<>();
       for (int i = 0; i < data2.length(); i++) {
         ParentOrderModel pmodel = new ParentOrderModel();
         pmodel.setStatus(data2.getJSONObject(i).getString("status"));
         pmodel.setTid(data2.getJSONObject(i).getString("tid"));
         pmodel.setPayment(data2.getJSONObject(i).getString("payment"));
         pmodel.setReceiver_state(data2.getJSONObject(i).getString("receiver_state"));
         pmodel.setReceiver_city(data2.getJSONObject(i).getString("receiver_city"));
         pmodel.setReceiver_district(data2.getJSONObject(i).getString("receiver_district"));
         pmodel.setReceiver_address(data2.getJSONObject(i).getString("receiver_address"));
         pmodel.setReceiver_zip(data2.getJSONObject(i).getString("receiver_zip"));
         pmodel.setReceiver_mobile(data2.getJSONObject(i).getString("receiver_mobile"));
         pmodel.setBuyer_message(data2.getJSONObject(i).getString("buyer_message"));
         pmodel.setNeed_invoice(data2.getJSONObject(i).getString("need_invoice"));
         pmodel.setInvoice_name(data2.getJSONObject(i).getString("invoice_name"));
         pmodel.setInvoice_type(data2.getJSONObject(i).getString("invoice_type"));
         pmodel.setInvoice_main(data2.getJSONObject(i).getString("invoice_main"));
         pmodel.setItemnum(data2.getJSONObject(i).getString("itemnum"));
         pmodel.setUser_memo(data2.getJSONObject(i).getString("user_memo"));
         pmodel.setCreated_time(
             ParamUtils.converNull(data2.getJSONObject(i).getString("created_time")));
         pmodel.setApprove_time(
             ParamUtils.converNull(data2.getJSONObject(i).getString("approve_time")));
         pmodel.setConsign_time(
             ParamUtils.converNull(data2.getJSONObject(i).getString("consign_time")));
         pmodel.setEnd_time(ParamUtils.converNull(data2.getJSONObject(i).getString("end_time")));
         pmodel.setTimeout_action_time(
             ParamUtils.converNull(data2.getJSONObject(i).getString("timeout_action_time")));
         pmodel.setReceiver_name(data2.getJSONObject(i).getString("receiver_name"));
         pmodel.setShop_memo(ParamUtils.converNull(data2.getJSONObject(i).getString("shop_memo")));
         pmodel.setPay_time(ParamUtils.converNull(data2.getJSONObject(i).getString("pay_time")));
         pmodel.setTotal_fee(ParamUtils.converNull(data2.getJSONObject(i).getString("total_fee")));
         pmodel.setReceiver_time(
             ParamUtils.converNull(data2.getJSONObject(i).getString("receiver_time")));
         pmodel.setMessage(ParamUtils.converNull(data2.getJSONObject(i).getString("message")));
         pmodel.setNeedpaytime(
             ParamUtils.converNull(data2.getJSONObject(i).getString("needpaytime")));
         ArrayList<ChildOrderModel> cModels = new ArrayList<>();
         JSONArray order = new JSONArray(data2.getJSONObject(i).getString("order"));
         for (int j = 0; j < order.length(); j++) {
           JSONObject jsonObject = order.getJSONObject(j);
           ChildOrderModel cmodel = new ChildOrderModel();
           cmodel.setTid(jsonObject.getString("tid"));
           cmodel.setNum(jsonObject.getString("num"));
           cmodel.setOid(jsonObject.getString("oid"));
           cmodel.setOld_price(jsonObject.getString("old_price"));
           cmodel.setPrice(jsonObject.getString("price"));
           cmodel.setSpec_nature_info(
               ParamUtils.converNull(jsonObject.getString("spec_nature_info")));
           cmodel.setTitle(jsonObject.getString("title"));
           cmodel.setPic_path(jsonObject.getString("pic_path"));
           cmodel.setAftersales_status(jsonObject.getString("aftersales_status"));
           cModels.add(cmodel);
         }
         pmodel.setModels(cModels);
         models.add(pmodel);
       }
       return models;
     } catch (JSONException e) {
       e.printStackTrace();
     }
     return null;
   } else {
     return getErrorValue(string);
   }
 }
Ejemplo n.º 3
0
 /**
  * 获取客户中心修理厂列表
  *
  * @param string
  * @return
  */
 public static Object getCustomerModel(String string) {
   if (getResultInt(string) == 0) {
     try {
       JSONObject object = new JSONObject(string);
       JSONObject result = object.getJSONObject("result");
       JSONObject data1 = result.getJSONObject("data");
       JSONArray data2 = data1.getJSONArray("data");
       ArrayList<CustomerModel> models = new ArrayList<>();
       for (int i = 0; i < data2.length(); i++) {
         JSONObject jsonObject = data2.getJSONObject(i);
         CustomerModel model = new CustomerModel();
         model.setRepairdepot_name(
             ParamUtils.converNull(jsonObject.getString("repairdepot_name")));
         model.setUser_id(jsonObject.getInt("user_id"));
         model.setContact_person(jsonObject.getString("contact_person"));
         model.setCorporation(ParamUtils.converNull(jsonObject.getString("corporation")));
         model.setCorporation_codeId_photo(
             ParamUtils.converNull(jsonObject.getString("corporation_codeId_photo")));
         model.setShop_photo(ParamUtils.converNull(jsonObject.getString("shop_photo")));
         model.setCorporation_codeId(
             ParamUtils.converNull(jsonObject.getString("corporation_codeId")));
         model.setLogin_account(ParamUtils.converNull(jsonObject.getString("login_account")));
         model.setAccount_name(ParamUtils.converNull(jsonObject.getString("account_name")));
         model.setAreaframe(ParamUtils.converNull(jsonObject.getString("areaframe")));
         model.setRepairdepot_address(
             ParamUtils.converNull(jsonObject.getString("repairdepot_address")));
         model.setCorporation(ParamUtils.converNull(jsonObject.getString("corporation")));
         model.setMobile(ParamUtils.converNull(jsonObject.getString("mobile")));
         model.setBusiness_encoding(
             ParamUtils.converNull(jsonObject.getString("business_encoding")));
         model.setBusiness_photo(ParamUtils.converNull(jsonObject.getString("business_photo")));
         model.setShop_photo_new(ParamUtils.converNull(jsonObject.getString("shop_photo_new")));
         model.setRevenues_code(ParamUtils.converNull(jsonObject.getString("revenues_code")));
         model.setBank_name(ParamUtils.converNull(jsonObject.getString("bank_name")));
         model.setBank_account(ParamUtils.converNull(jsonObject.getString("bank_account")));
         model.setContact_phone(jsonObject.getString("contact_phone"));
         model.setReg_address(ParamUtils.converNull(jsonObject.getString("reg_address")));
         model.setInit_amount(ParamUtils.converNull(jsonObject.getString("init_amount")));
         model.setEmail(ParamUtils.converNull(jsonObject.getString("email")));
         model.setPostcode(ParamUtils.converNull(jsonObject.getString("postcode")));
         models.add(model);
       }
       return models;
     } catch (JSONException e) {
       e.printStackTrace();
     }
     return null;
   } else {
     return getErrorValue(string);
   }
 }