|
|
@ -10,6 +10,7 @@ import com.qhclh.ytzh.base.BaseFragment; |
|
|
import com.qhclh.ytzh.bean.ScanBean; |
|
|
import com.qhclh.ytzh.bean.ScanBean; |
|
|
import com.qhclh.ytzh.home.RpcUrl; |
|
|
import com.qhclh.ytzh.home.RpcUrl; |
|
|
import com.qhclh.ytzh.tasks.ViewOnClickTask; |
|
|
import com.qhclh.ytzh.tasks.ViewOnClickTask; |
|
|
|
|
|
import com.qhclh.ytzh.ui.RefreshLayout; |
|
|
import com.qhclh.ytzh.utils.DateTimeUtil; |
|
|
import com.qhclh.ytzh.utils.DateTimeUtil; |
|
|
import com.qhclh.ytzh.work.scan.ScanAdapter; |
|
|
import com.qhclh.ytzh.work.scan.ScanAdapter; |
|
|
|
|
|
|
|
|
@ -26,11 +27,14 @@ import butterknife.BindView; |
|
|
* Created by 青花瓷 on 2017/11/30. |
|
|
* Created by 青花瓷 on 2017/11/30. |
|
|
*/ |
|
|
*/ |
|
|
///< 车辆管理鸡苗 |
|
|
///< 车辆管理鸡苗 |
|
|
public class ChicksFragment extends BaseFragment{ |
|
|
|
|
|
|
|
|
public class ChicksFragment extends BaseFragment implements RefreshLayout.OnLoadListener { |
|
|
@BindView(R.id.lv_infos_chicks) |
|
|
@BindView(R.id.lv_infos_chicks) |
|
|
ListView lv_infos_chicks; |
|
|
ListView lv_infos_chicks; |
|
|
private List<ScanBean> scanBeanList; |
|
|
private List<ScanBean> scanBeanList; |
|
|
private CarsInfosAdapter adapter; |
|
|
private CarsInfosAdapter adapter; |
|
|
|
|
|
@BindView(R.id.rfl_chicks) |
|
|
|
|
|
RefreshLayout rfl_chicks; |
|
|
|
|
|
private int page =0; |
|
|
@Override |
|
|
@Override |
|
|
protected int setLayout() { |
|
|
protected int setLayout() { |
|
|
return R.layout.fragment_chicks; |
|
|
return R.layout.fragment_chicks; |
|
|
@ -38,6 +42,7 @@ public class ChicksFragment extends BaseFragment{ |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
protected void initView() { |
|
|
protected void initView() { |
|
|
|
|
|
rfl_chicks.setEnabled(false); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
@ -55,11 +60,13 @@ public class ChicksFragment extends BaseFragment{ |
|
|
startActivity(intent); |
|
|
startActivity(intent); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
rfl_chicks.setOnLoadListener(this); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public void onResume() { |
|
|
public void onResume() { |
|
|
super.onResume(); |
|
|
super.onResume(); |
|
|
|
|
|
page = 0; |
|
|
Query(); |
|
|
Query(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@ -89,7 +96,66 @@ public class ChicksFragment extends BaseFragment{ |
|
|
@Override |
|
|
@Override |
|
|
public Object call() throws Exception { |
|
|
public Object call() throws Exception { |
|
|
RpcObject queryObj = RpcObject.create(RpcUrl.ChickTransportLogRpc_canshu); |
|
|
RpcObject queryObj = RpcObject.create(RpcUrl.ChickTransportLogRpc_canshu); |
|
|
|
|
|
queryObj.setInt("PageSize",10); |
|
|
|
|
|
queryObj.setInt("CurrentPageIndex",page); |
|
|
|
|
|
List<Object> select = queryObj.getList("Select"); |
|
|
|
|
|
select.add("ID"); |
|
|
|
|
|
select.add("CreateTime"); |
|
|
|
|
|
select.add("Employee_Name"); |
|
|
|
|
|
select.add("Car_Name"); |
|
|
|
|
|
|
|
|
|
|
|
List<Object> orderList = queryObj.getList("OrderBy"); |
|
|
|
|
|
RpcObject orderBy = RpcObject.create(RpcUrl.DayProductRpc_Query_order); |
|
|
|
|
|
orderBy.setString("Name", "CreateTime"); |
|
|
|
|
|
orderBy.setBoolean("Desc", true); |
|
|
|
|
|
orderList.add(orderBy); |
|
|
|
|
|
|
|
|
|
|
|
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.ChickTransportLogRpc_Query,queryObj); |
|
|
|
|
|
rpcObj = result.getRpcObjectList(RpcUrl.ChickTransportLogRpc_fanhui); |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
queryTask.execute(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public void onLoad() { |
|
|
|
|
|
rfl_chicks.postDelayed(new Runnable() { |
|
|
|
|
|
@Override |
|
|
|
|
|
public void run() { |
|
|
|
|
|
rfl_chicks.setLoading(false); |
|
|
|
|
|
querymore(); |
|
|
|
|
|
} |
|
|
|
|
|
},1000); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void querymore() { |
|
|
|
|
|
page++; |
|
|
|
|
|
ViewOnClickTask queryTask = new ViewOnClickTask(getActivity(),"加载中...") { |
|
|
|
|
|
List<RpcObject> rpcObj; |
|
|
|
|
|
@Override |
|
|
|
|
|
protected void successUI() { |
|
|
|
|
|
for (int i=0;i<rpcObj.size();i++) { |
|
|
|
|
|
ScanBean scanBean = new ScanBean(); |
|
|
|
|
|
scanBean.setId(rpcObj.get(i).getLong("ID")); |
|
|
|
|
|
scanBean.setInfos_carname(rpcObj.get(i).getString("Car_Name")); |
|
|
|
|
|
scanBean.setInfos_driver(rpcObj.get(i).getString("Employee_Name")); |
|
|
|
|
|
if (rpcObj.get(i).getDate("CreateTime")!=null) { |
|
|
|
|
|
scanBean.setCreatetime(DateTimeUtil.getYMD4(rpcObj.get(i).getDate("CreateTime"))); |
|
|
|
|
|
}else { |
|
|
|
|
|
scanBean.setCreatetime(""); |
|
|
|
|
|
} |
|
|
|
|
|
scanBeanList.add(scanBean); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
adapter.notifyDataSetChanged(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
public Object call() throws Exception { |
|
|
|
|
|
RpcObject queryObj = RpcObject.create(RpcUrl.ChickTransportLogRpc_canshu); |
|
|
|
|
|
queryObj.setInt("PageSize",10); |
|
|
|
|
|
queryObj.setInt("CurrentPageIndex",page); |
|
|
List<Object> select = queryObj.getList("Select"); |
|
|
List<Object> select = queryObj.getList("Select"); |
|
|
select.add("ID"); |
|
|
select.add("ID"); |
|
|
select.add("CreateTime"); |
|
|
select.add("CreateTime"); |
|
|
|