1.1.6版本发布
parent
f240e20c6f
commit
840d68a351
@ -0,0 +1,167 @@
|
|||||||
|
package com.rehome.dywoa.ui.activity.sbxj;
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.BroadcastReceiver;
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.content.IntentFilter;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
import android.widget.AdapterView;
|
||||||
|
import android.widget.ListView;
|
||||||
|
|
||||||
|
import com.rehome.dywoa.App;
|
||||||
|
import com.rehome.dywoa.Contans;
|
||||||
|
import com.rehome.dywoa.DBModel.XSJJHDataBean;
|
||||||
|
import com.rehome.dywoa.DBModel.XSJJHXZDataBean;
|
||||||
|
import com.rehome.dywoa.R;
|
||||||
|
import com.rehome.dywoa.adapter.DlbAdapter;
|
||||||
|
import com.rehome.dywoa.base.BaseActivity;
|
||||||
|
import com.rehome.dywoa.bean.DlbInfo;
|
||||||
|
import com.rehome.dywoa.bean.SetxjSbModel;
|
||||||
|
import com.rehome.dywoa.utils.GsonUtils;
|
||||||
|
|
||||||
|
import org.litepal.crud.DataSupport;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import static org.litepal.crud.DataSupport.where;
|
||||||
|
|
||||||
|
import androidx.localbroadcastmanager.content.LocalBroadcastManager;
|
||||||
|
|
||||||
|
public class XjCheckAndUploadActivity extends BaseActivity {
|
||||||
|
public static int Req = 101;
|
||||||
|
ListView lv;
|
||||||
|
|
||||||
|
private boolean isEdit = true;
|
||||||
|
private int item;
|
||||||
|
//private ArrayList<XSJJHXZDataBean> xsjjhxzDataBeanArrayList = new ArrayList<>();//工作列表
|
||||||
|
private ArrayList<XSJJHDataBean> xsjjhDataBeanArrayList = new ArrayList<>();
|
||||||
|
private List<DlbInfo> infos = new ArrayList<>();
|
||||||
|
private View headView;
|
||||||
|
private DlbAdapter adapter;
|
||||||
|
private int itemposition;
|
||||||
|
private String LX, LXResult;
|
||||||
|
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
private String type;
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getContentViewID() {
|
||||||
|
return R.layout.activity_xj_check_and_upload;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initView() {
|
||||||
|
username = App.getInstance().getUserInfo().getManid();
|
||||||
|
type = getIntent().getStringExtra("type");
|
||||||
|
String title = "";
|
||||||
|
if ("已检已上传".equals(type)) {
|
||||||
|
title = "已检已上传";
|
||||||
|
}
|
||||||
|
if ("已检未上传".equals(type)) {
|
||||||
|
title = "已检未上传";
|
||||||
|
}
|
||||||
|
if ("已检点数".equals(type)) {
|
||||||
|
title = "已检点数";
|
||||||
|
}
|
||||||
|
if ("未检点数".equals(type)) {
|
||||||
|
title = "未检点数";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
lv = findViewById(R.id.lv);
|
||||||
|
initToolbar(title, "", new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
headView = View.inflate(context, R.layout.dlb_item, null);
|
||||||
|
headView.findViewById(R.id.head).setVisibility(View.VISIBLE);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void initData() {
|
||||||
|
|
||||||
|
searchdata();
|
||||||
|
setListAdapter();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void searchdata() {
|
||||||
|
|
||||||
|
if ("已检已上传".equals(type)) {
|
||||||
|
//已检已上传点数
|
||||||
|
List<XSJJHDataBean> uploadEdList = DataSupport.where("checked = ? and uploaded = ? and username = ?", "1","1",username).find(XSJJHDataBean.class);
|
||||||
|
if(uploadEdList!=null&&uploadEdList.size()>0){
|
||||||
|
showLog("-------已检已上传点数------");
|
||||||
|
showLog(GsonUtils.GsonString(uploadEdList));
|
||||||
|
}
|
||||||
|
|
||||||
|
xsjjhDataBeanArrayList.clear();
|
||||||
|
//获取当前点击的工作栏对应的点检记录列表
|
||||||
|
xsjjhDataBeanArrayList.addAll(uploadEdList);
|
||||||
|
}
|
||||||
|
if ("已检未上传".equals(type)) {
|
||||||
|
//已检未上传点数
|
||||||
|
List<XSJJHDataBean> checkedAndNoUploadList = DataSupport.where("checked = ? and uploaded = ? and username = ?", "1","0",username).find(XSJJHDataBean.class);
|
||||||
|
if(checkedAndNoUploadList!=null&&checkedAndNoUploadList.size()>0){
|
||||||
|
showLog("-------已检未上传点数------");
|
||||||
|
showLog(GsonUtils.GsonString(checkedAndNoUploadList));
|
||||||
|
}
|
||||||
|
|
||||||
|
xsjjhDataBeanArrayList.clear();
|
||||||
|
//获取当前点击的工作栏对应的点检记录列表
|
||||||
|
xsjjhDataBeanArrayList.addAll(checkedAndNoUploadList);
|
||||||
|
}
|
||||||
|
if ("已检点数".equals(type)) {
|
||||||
|
//已检点数
|
||||||
|
List<XSJJHDataBean> checkedList = DataSupport.where("checked = ? and username = ?", "1",username).find(XSJJHDataBean.class);
|
||||||
|
if(checkedList!=null&&checkedList.size()>0){
|
||||||
|
showLog("-------未检点数------");
|
||||||
|
showLog(GsonUtils.GsonString(checkedList));
|
||||||
|
}
|
||||||
|
|
||||||
|
xsjjhDataBeanArrayList.clear();
|
||||||
|
//获取当前点击的工作栏对应的点检记录列表
|
||||||
|
xsjjhDataBeanArrayList.addAll(checkedList);
|
||||||
|
}
|
||||||
|
if ("未检点数".equals(type)) {
|
||||||
|
//未检点数
|
||||||
|
List<XSJJHDataBean> noCheckList = DataSupport.where("checked = ? and username = ?", "0",username).find(XSJJHDataBean.class);
|
||||||
|
if(noCheckList!=null&&noCheckList.size()>0){
|
||||||
|
showLog("-------未检点数------");
|
||||||
|
showLog(GsonUtils.GsonString(noCheckList));
|
||||||
|
}
|
||||||
|
|
||||||
|
xsjjhDataBeanArrayList.clear();
|
||||||
|
//获取当前点击的工作栏对应的点检记录列表
|
||||||
|
xsjjhDataBeanArrayList.addAll(noCheckList);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setListAdapter() {
|
||||||
|
|
||||||
|
for (XSJJHDataBean rw : xsjjhDataBeanArrayList) {
|
||||||
|
DlbInfo info = new DlbInfo();
|
||||||
|
info.setSbid(rw.getSbid());
|
||||||
|
info.setCjjg(rw.getCJJG());
|
||||||
|
//info.setDian(rw.getSb() + "--" + rw.getBJMC());
|
||||||
|
//info.setDian(rw.getJhmc() + "--" + rw.getQymc() + "--" + rw.getSb());
|
||||||
|
info.setDian(rw.getSb());
|
||||||
|
info.setStatu(rw.isChecked());
|
||||||
|
infos.add(info);
|
||||||
|
}
|
||||||
|
|
||||||
|
adapter = new DlbAdapter(context, infos);
|
||||||
|
lv.addHeaderView(headView, null, false);
|
||||||
|
lv.setAdapter(adapter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
|
android:id="@+id/activity_yul"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
tools:context=".ui.activity.sbxj.XjCheckAndUploadActivity">
|
||||||
|
|
||||||
|
<include layout="@layout/layout_base"/>
|
||||||
|
|
||||||
|
<ListView
|
||||||
|
android:id="@+id/lv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_margin="15px"
|
||||||
|
android:divider="#00000000"
|
||||||
|
android:dividerHeight="0px" />
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
Loading…
Reference in New Issue