Browse Source

no message

master
lh 8 years ago
parent
commit
63ad93bca4
3 changed files with 94 additions and 6 deletions
  1. +54
    -2
      app/src/main/java/com/qhclh/ytzh/work/productiondaily/ProductiondailyActivity.java
  2. +37
    -1
      app/src/main/java/com/qhclh/ytzh/work/productiondaily/ProductiondailyInfoActivity.java
  3. +3
    -3
      app/src/main/res/layout/item_productiondaily.xml

+ 54
- 2
app/src/main/java/com/qhclh/ytzh/work/productiondaily/ProductiondailyActivity.java View File

@ -70,7 +70,9 @@ public class ProductiondailyActivity extends BaseActivity implements CalendarDia
lv_productiondaily.setOnItemClickListener(new AdapterView.OnItemClickListener() { lv_productiondaily.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override @Override
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) { public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
startActivity(new Intent(ProductiondailyActivity.this,ProductiondailyInfoActivity.class));
Intent intent = new Intent(ProductiondailyActivity.this,ProductiondailyInfoActivity.class);
intent.putExtra("id",l);
startActivity(intent);
} }
}); });
rfl_productiondaily.setOnLoadListener(this); rfl_productiondaily.setOnLoadListener(this);
@ -188,11 +190,61 @@ public class ProductiondailyActivity extends BaseActivity implements CalendarDia
@Override @Override
public void run() { public void run() {
rfl_productiondaily.setLoading(false); rfl_productiondaily.setLoading(false);
DayProductRpcQueryplus();
} }
},1000); },1000);
} }
private void DayProductRpcQueryplus() {
page++;
ViewOnClickTask DayProductRpcQuerypTask = new ViewOnClickTask(this,"加载中...") {
List<RpcObject> rpcobj;
@Override
protected void successUI() {
int size = rpcobj.size();
for (int i=0;i<size;i++){
productionDailyBeanList.add(new ProductionDailyBean(rpcobj.get(i).getLong("ID")
,rpcobj.get(i).getString("Batch_Name"),rpcobj.get(i).getString("BreedFactory_Name")
,DateTimeUtil.getYMD2(rpcobj.get(i).getDate("Date"))));
}
productiondailyAdapter.notifyDataSetChanged();
}
@Override
public Object call() throws Exception {
RpcObject queryObj = RpcObject.create(RpcUrl.DayProductRpc_Query_canshu);
queryObj.setInt("PageSize",10);
queryObj.setInt("CurrentPageIndex",page);
List<Object> select = queryObj.getList("Select");
select.add("ID");
// select.add("CreateTime");
// select.add("CreateUser_Name");
select.add("Batch_ID");
select.add("Batch_Name");
select.add("BreedFactory_ID");
select.add("BreedFactory_Name");
select.add("Date");
// select.add("Remark");
// select.add("AccountingUnit_ID");
// select.add("AccountingUnit_Name");
// Map<Object, Object> where = queryObj.getMap("Where");
// where.put("MobileToDo",true);
// List<Object> orderList = queryObj.getList("OrderBy");
// RpcObject orderBy1 = RpcObject.create(RpcUrl.paixu);
// orderBy1.setString("Name", "CreateTime");
// orderBy1.setBoolean("Desc", true);
// orderList.add(orderBy1);
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.DayProductRpc_Query,queryObj);
rpcobj = result.getRpcObjectList(RpcUrl.DayProductRpc_Query_fanhui);
return null;
}
};
DayProductRpcQuerypTask.execute();
}
@Override @Override
public void onRefresh() { public void onRefresh() {
rfl_productiondaily.setRefreshing(false); rfl_productiondaily.setRefreshing(false);


+ 37
- 1
app/src/main/java/com/qhclh/ytzh/work/productiondaily/ProductiondailyInfoActivity.java View File

@ -5,6 +5,14 @@ import android.view.View;
import com.qhclh.ytzh.R; import com.qhclh.ytzh.R;
import com.qhclh.ytzh.base.BaseActivity; import com.qhclh.ytzh.base.BaseActivity;
import com.qhclh.ytzh.home.RpcUrl;
import com.qhclh.ytzh.tasks.ViewOnClickTask;
import org.forks.jsonrpc.JsonRpcResult;
import org.forks.jsonrpc.RpcFacade;
import org.forks.jsonrpc.RpcObject;
import java.util.List;
import butterknife.BindView; import butterknife.BindView;
@ -15,6 +23,7 @@ import butterknife.BindView;
public class ProductiondailyInfoActivity extends BaseActivity { public class ProductiondailyInfoActivity extends BaseActivity {
@BindView(R.id.toolbar) @BindView(R.id.toolbar)
Toolbar mToolbar; Toolbar mToolbar;
private long id;
@Override @Override
protected int setLayoutId() { protected int setLayoutId() {
return R.layout.act_productiondaily_info; return R.layout.act_productiondaily_info;
@ -32,11 +41,38 @@ public class ProductiondailyInfoActivity extends BaseActivity {
@Override @Override
protected void initData() { protected void initData() {
id = getIntent().getLongExtra("id",0);
} }
@Override @Override
protected void initOper() { protected void initOper() {
} }
@Override
protected void onResume() {
super.onResume();
LoadOne();
}
private void LoadOne() {
ViewOnClickTask DayProductRpcLoadTask = new ViewOnClickTask(this,"加载中...") {
RpcObject rpcobj;
@Override
protected void successUI() {
int size = rpcobj.size();
System.out.println("aaa++++"+rpcobj);
}
@Override
public Object call() throws Exception {
JsonRpcResult result = RpcFacade.rpcCall(RpcUrl.DayProductRpc_Load,id);
rpcobj = result.getRpcObject(RpcUrl.DayProductRpc_Query_fanhui);
return null;
}
};
DayProductRpcLoadTask.execute();
}
} }

+ 3
- 3
app/src/main/res/layout/item_productiondaily.xml View File

@ -10,7 +10,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_margin="@dimen/dp_10" android:layout_margin="@dimen/dp_10"
android:textColor="@color/black303030" android:textColor="@color/black303030"
android:textSize="@dimen/text_size_20" />
android:textSize="@dimen/text_size_18" />
<TextView <TextView
android:id="@+id/productiondaily_addrs" android:id="@+id/productiondaily_addrs"
@ -19,7 +19,7 @@
android:layout_below="@id/productiondaily_batch" android:layout_below="@id/productiondaily_batch"
android:layout_margin="@dimen/dp_10" android:layout_margin="@dimen/dp_10"
android:textColor="@color/grey666666" android:textColor="@color/grey666666"
android:textSize="@dimen/text_size_20" />
android:textSize="@dimen/text_size_18" />
<TextView <TextView
android:id="@+id/productiondaily_time" android:id="@+id/productiondaily_time"
@ -29,6 +29,6 @@
android:layout_alignTop="@id/productiondaily_addrs" android:layout_alignTop="@id/productiondaily_addrs"
android:layout_marginRight="@dimen/dp_10" android:layout_marginRight="@dimen/dp_10"
android:textColor="@color/grey888888" android:textColor="@color/grey888888"
android:textSize="@dimen/text_size_18" />
android:textSize="@dimen/text_size_16" />
</RelativeLayout> </RelativeLayout>

Loading…
Cancel
Save