|
|
|
@ -5,8 +5,15 @@ import android.widget.ListView; |
|
|
|
import com.qhclh.ytzh.R; |
|
|
|
import com.qhclh.ytzh.base.BaseFragment; |
|
|
|
import com.qhclh.ytzh.bean.ScanBean; |
|
|
|
import com.qhclh.ytzh.home.RpcUrl; |
|
|
|
import com.qhclh.ytzh.tasks.ViewOnClickTask; |
|
|
|
import com.qhclh.ytzh.utils.DateTimeUtil; |
|
|
|
import com.qhclh.ytzh.work.scan.ScanAdapter; |
|
|
|
|
|
|
|
import org.forks.jsonrpc.JsonRpcResult; |
|
|
|
import org.forks.jsonrpc.RpcFacade; |
|
|
|
import org.forks.jsonrpc.RpcObject; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@ -20,7 +27,7 @@ public class ChicksFragment extends BaseFragment{ |
|
|
|
@BindView(R.id.lv_infos_chicks) |
|
|
|
ListView lv_infos_chicks; |
|
|
|
private List<ScanBean> scanBeanList; |
|
|
|
private ScanAdapter scanAdapter; |
|
|
|
private CarsInfosAdapter adapter; |
|
|
|
@Override |
|
|
|
protected int setLayout() { |
|
|
|
return R.layout.fragment_chicks; |
|
|
|
@ -33,16 +40,63 @@ public class ChicksFragment extends BaseFragment{ |
|
|
|
@Override |
|
|
|
protected void initData() { |
|
|
|
scanBeanList = new ArrayList<>(); |
|
|
|
// for (int i=0;i<4;i++){ |
|
|
|
// scanBeanList.add(new ScanBean(i,"车牌号"+i,"司机"+i,"联系方式"+i,"批次"+i,"厂址"+i, |
|
|
|
// "时间"+i,"数量"+i,"免疫"+i,"均匀度"+i,"起始时间"+i,"到达时间"+i)); |
|
|
|
// } |
|
|
|
scanAdapter = new ScanAdapter(getActivity(),scanBeanList); |
|
|
|
lv_infos_chicks.setAdapter(scanAdapter); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void initOper() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void onResume() { |
|
|
|
super.onResume(); |
|
|
|
Query(); |
|
|
|
} |
|
|
|
|
|
|
|
private void Query() { |
|
|
|
ViewOnClickTask queryTask = new ViewOnClickTask(getActivity(),"加载中...") { |
|
|
|
List<RpcObject> rpcObj; |
|
|
|
@Override |
|
|
|
protected void successUI() { |
|
|
|
scanBeanList.clear(); |
|
|
|
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 = new CarsInfosAdapter(getActivity(),scanBeanList); |
|
|
|
lv_infos_chicks.setAdapter(adapter); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Object call() throws Exception { |
|
|
|
RpcObject queryObj = RpcObject.create(RpcUrl.ChickTransportLogRpc_canshu); |
|
|
|
|
|
|
|
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(); |
|
|
|
} |
|
|
|
} |