[function]补录功能
This commit is contained in:
parent
714bac19f9
commit
bafc66cdaa
|
|
@ -44,3 +44,5 @@ const val NUMBER = "counter"
|
||||||
const val TIMING_NAME = "定时计数(秒)"
|
const val TIMING_NAME = "定时计数(秒)"
|
||||||
|
|
||||||
const val NUMBER_NAME = "定数计数(个)"
|
const val NUMBER_NAME = "定数计数(个)"
|
||||||
|
|
||||||
|
const val ACTIVITY = "ACTIVITY"
|
||||||
|
|
@ -16,6 +16,7 @@ import com.skipping.net.ScoreReqBean
|
||||||
import com.skipping.utils.*
|
import com.skipping.utils.*
|
||||||
import com.skipping.view.dialog.DialogBean
|
import com.skipping.view.dialog.DialogBean
|
||||||
import com.skipping.view.dialog.DialogTool
|
import com.skipping.view.dialog.DialogTool
|
||||||
|
import com.tencent.mmkv.MMKV
|
||||||
import kotlinx.android.synthetic.main.activity_begin.*
|
import kotlinx.android.synthetic.main.activity_begin.*
|
||||||
import kotlinx.android.synthetic.main.activity_home.*
|
import kotlinx.android.synthetic.main.activity_home.*
|
||||||
import kotlinx.android.synthetic.main.net_item.view.*
|
import kotlinx.android.synthetic.main.net_item.view.*
|
||||||
|
|
@ -29,11 +30,28 @@ import java.util.concurrent.ScheduledFuture
|
||||||
*/
|
*/
|
||||||
class BeginActivity : BaseActivity<BeginPresenter>() {
|
class BeginActivity : BaseActivity<BeginPresenter>() {
|
||||||
lateinit var adaper: BeginGridAdaper
|
lateinit var adaper: BeginGridAdaper
|
||||||
|
val mmkv = MMKV.defaultMMKV()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 详情列表
|
||||||
|
*/
|
||||||
lateinit var detailBean: DetailActivityBean
|
lateinit var detailBean: DetailActivityBean
|
||||||
lateinit var future: ScheduledFuture<*>
|
lateinit var future: ScheduledFuture<*>
|
||||||
lateinit var dialog: AlertDialog
|
lateinit var dialog: AlertDialog
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 可选择的班级列表
|
||||||
|
*/
|
||||||
var choseGradeBeanList = mutableListOf<DialogBean<List<DetailActivityBean.CandidatesBean>>>()
|
var choseGradeBeanList = mutableListOf<DialogBean<List<DetailActivityBean.CandidatesBean>>>()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择的班级
|
||||||
|
*/
|
||||||
lateinit var showBean: List<DetailActivityBean.CandidatesBean>
|
lateinit var showBean: List<DetailActivityBean.CandidatesBean>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 选择的组别
|
||||||
|
*/
|
||||||
var position = 0
|
var position = 0
|
||||||
var scList = mutableListOf<ScoreReqBean.CandidatesBean>()
|
var scList = mutableListOf<ScoreReqBean.CandidatesBean>()
|
||||||
var complete = mutableListOf<Int>()
|
var complete = mutableListOf<Int>()
|
||||||
|
|
@ -63,31 +81,35 @@ class BeginActivity : BaseActivity<BeginPresenter>() {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initData() {
|
override fun initData() {
|
||||||
p.getActivityDetail(intent.getBundleExtra(DATA).getString(ID))
|
var saveBean = mmkv?.decodeParcelable(ACTIVITY + intent.getBundleExtra(DATA).getString(ID), DetailActivityBean::class.java)
|
||||||
|
if (saveBean == null) {
|
||||||
|
p.getActivityDetail(intent.getBundleExtra(DATA).getString(ID))
|
||||||
|
} else {
|
||||||
|
activityDetailResult(saveBean)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
begin_back.setOnClickListener {
|
begin_back.setOnClickListener {
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
begin_start.setOnClickListener {
|
begin_start.setOnClickListener {
|
||||||
|
//当不是连接模式或吗,没有设备连接提示
|
||||||
if (!ConnectManager.getSingleton().deviceStatus || !ConnectManager.getSingleton().deviceNum()) {
|
if (!ConnectManager.getSingleton().deviceStatus || !ConnectManager.getSingleton().deviceNum()) {
|
||||||
ToastUtil.longToast("请先连接设备并开启连接模式")
|
ToastUtil.longToast("请先连接设备并开启连接模式")
|
||||||
return@setOnClickListener
|
return@setOnClickListener
|
||||||
}
|
}
|
||||||
|
|
||||||
if (detailBean.activityType == TIMING) {
|
if (detailBean.activityType == TIMING) {
|
||||||
//定时计数
|
|
||||||
var num = detailBean.activityValue
|
var num = detailBean.activityValue
|
||||||
ConnectManager.getSingleton().startJumpLimitTime(num)
|
ConnectManager.getSingleton().startJumpLimitTime(num)
|
||||||
|
|
||||||
future = ThreadPoolUtil.getSingleton().scheduleWithFixedDelayMain({
|
future = ThreadPoolUtil.getSingleton().scheduleWithFixedDelayMain({
|
||||||
if (num <= 0) {
|
if (num <= 0) {
|
||||||
ConnectManager.getSingleton().stopGetScore()
|
ConnectManager.getSingleton().stopGetScore()
|
||||||
// ConnectManager.getSingleton().stopJump()
|
// ConnectManager.getSingleton().stopJump()
|
||||||
future.cancel(false)
|
future.cancel(false)
|
||||||
choseGradeBeanList.get(position).bean = showBean
|
|
||||||
choseGradeBeanList.get(position).bean
|
|
||||||
ConnectManager.getSingleton().getCount()
|
ConnectManager.getSingleton().getCount()
|
||||||
score()
|
|
||||||
flushScore()
|
flushScore()
|
||||||
|
score()
|
||||||
begin_listRL.isClickable = true
|
begin_listRL.isClickable = true
|
||||||
begin_start.isClickable = true
|
begin_start.isClickable = true
|
||||||
return@scheduleWithFixedDelayMain
|
return@scheduleWithFixedDelayMain
|
||||||
|
|
@ -99,29 +121,6 @@ class BeginActivity : BaseActivity<BeginPresenter>() {
|
||||||
begin_type.text = "${TIMING_NAME}: ${num} 秒"
|
begin_type.text = "${TIMING_NAME}: ${num} 秒"
|
||||||
flushScore()
|
flushScore()
|
||||||
}, 1000, 1000)
|
}, 1000, 1000)
|
||||||
} else {
|
|
||||||
//定数计时
|
|
||||||
// future = ThreadPoolUtil.getSingleton().scheduleWithFixedDelayMain({
|
|
||||||
// if(){
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// if (num <= 0) {
|
|
||||||
// ConnectManager.getSingleton().stopGetScore()
|
|
||||||
//// ConnectManager.getSingleton().stopJump()
|
|
||||||
// future.cancel(false)
|
|
||||||
// choseGradeBeanList.get(position).bean = showBean
|
|
||||||
// choseGradeBeanList.get(position).bean
|
|
||||||
// score()
|
|
||||||
// ConnectManager.getSingleton().getCount()
|
|
||||||
// return@scheduleWithFixedDelayMain
|
|
||||||
// }
|
|
||||||
// ConnectManager.getSingleton().getCount()
|
|
||||||
// num--
|
|
||||||
// begin_type.text = "${NUMBER_NAME}: ${num} 个"
|
|
||||||
// flushScore()
|
|
||||||
// }, 1000, 1000)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
begin_listRL.setOnClickListener {
|
begin_listRL.setOnClickListener {
|
||||||
|
|
@ -148,7 +147,6 @@ class BeginActivity : BaseActivity<BeginPresenter>() {
|
||||||
val num = NumberUtil.numberToChinese(index + 1)
|
val num = NumberUtil.numberToChinese(index + 1)
|
||||||
choseGradeBeanList.add(DialogBean("第 $num 组", mutableList))
|
choseGradeBeanList.add(DialogBean("第 $num 组", mutableList))
|
||||||
}
|
}
|
||||||
|
|
||||||
detailBean = bean
|
detailBean = bean
|
||||||
showBean = bean.candidates[0]
|
showBean = bean.candidates[0]
|
||||||
begin_name.text = bean.activityName
|
begin_name.text = bean.activityName
|
||||||
|
|
@ -174,24 +172,67 @@ class BeginActivity : BaseActivity<BeginPresenter>() {
|
||||||
adaper.notifyDataSetChanged()
|
adaper.notifyDataSetChanged()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交成绩
|
||||||
|
*/
|
||||||
fun score() {
|
fun score() {
|
||||||
var bean = ScoreReqBean.CandidatesBean()
|
showBean.forEachIndexed { index, candidatesBean ->
|
||||||
bean.complateTime = (System.currentTimeMillis() / 1000).toInt()
|
val list = ConnectManager.getSingleton().scoreMap[index + 1]
|
||||||
var list = mutableListOf<ScoreReqBean.CandidatesBean.InfoBean>()
|
detailBean.candidates[position][index].detail = list
|
||||||
choseGradeBeanList.get(position).bean.forEachIndexed() { po, it ->
|
|
||||||
var info = ScoreReqBean.CandidatesBean.InfoBean()
|
|
||||||
info.personID = it.personID
|
|
||||||
info.score = it.score
|
|
||||||
info.detail = cute(po)
|
|
||||||
list.add(info)
|
|
||||||
}
|
}
|
||||||
bean.info = list
|
if (inspect()) {
|
||||||
scList.add(bean)
|
var bean = ScoreReqBean()
|
||||||
complete.add(position)
|
bean.id = detailBean.id
|
||||||
if (complete.size == choseGradeBeanList.size) {
|
bean.step = detailBean.step
|
||||||
p.score(intent.getBundleExtra(DATA).getString(ID).toInt(), detailBean.step, scList)
|
var canList = mutableListOf<ScoreReqBean.CandidatesBean>()
|
||||||
|
detailBean.candidates.forEach {
|
||||||
|
var can = ScoreReqBean.CandidatesBean()
|
||||||
|
can.complateTime = (System.currentTimeMillis() / 1000).toInt()
|
||||||
|
it.forEach {
|
||||||
|
var infoBean = ScoreReqBean.CandidatesBean.InfoBean()
|
||||||
|
infoBean.personID = it.personID
|
||||||
|
infoBean.score = it.score
|
||||||
|
infoBean.detail = it.detail
|
||||||
|
can.info.add(infoBean)
|
||||||
|
}
|
||||||
|
canList.add(can)
|
||||||
|
}
|
||||||
|
bean.candidates = canList
|
||||||
|
p.score(bean)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// var bean = ScoreReqBean.CandidatesBean()
|
||||||
|
// bean.complateTime = (System.currentTimeMillis() / 1000).toInt()
|
||||||
|
// var list = mutableListOf<ScoreReqBean.CandidatesBean.InfoBean>()
|
||||||
|
// choseGradeBeanList.get(position).bean.forEachIndexed() { po, it ->
|
||||||
|
// var info = ScoreReqBean.CandidatesBean.InfoBean()
|
||||||
|
// info.personID = it.personID
|
||||||
|
// info.score = it.score
|
||||||
|
// info.detail = cute(po)
|
||||||
|
// list.add(info)
|
||||||
|
// }
|
||||||
|
// bean.info = list
|
||||||
|
// scList.add(bean)
|
||||||
|
// complete.add(position)
|
||||||
|
// if (scList.size == choseGradeBeanList.size) {
|
||||||
|
//
|
||||||
|
// p.score(intent.getBundleExtra(DATA).getString(ID).toInt(), detailBean.step, scList)
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
fun inspect(): Boolean {
|
||||||
|
detailBean.candidates.forEachIndexed { index, mutableList ->
|
||||||
|
detailBean.candidates[index].forEach {
|
||||||
|
if (it.detail == null || it.detail.size == 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun cute(position: Int): List<Int>? {
|
fun cute(position: Int): List<Int>? {
|
||||||
|
|
@ -221,4 +262,10 @@ class BeginActivity : BaseActivity<BeginPresenter>() {
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onDestroy() {
|
||||||
|
mmkv?.encode(ACTIVITY + intent.getBundleExtra(DATA).getString(ID), detailBean)
|
||||||
|
super.onDestroy()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,7 @@ import com.libs.network.CallBack
|
||||||
import com.libs.network.Concise
|
import com.libs.network.Concise
|
||||||
import com.libs.utils.LogUtil
|
import com.libs.utils.LogUtil
|
||||||
import com.libs.utils.ToastUtil
|
import com.libs.utils.ToastUtil
|
||||||
import com.skipping.ACCOUNT
|
import com.skipping.*
|
||||||
import com.skipping.BASE_URL
|
|
||||||
import com.skipping.PASSWORD
|
|
||||||
import com.skipping.TOKEN
|
|
||||||
import com.skipping.activity.IView
|
import com.skipping.activity.IView
|
||||||
import com.skipping.net.*
|
import com.skipping.net.*
|
||||||
import com.tencent.mmkv.MMKV
|
import com.tencent.mmkv.MMKV
|
||||||
|
|
@ -35,23 +32,23 @@ class BeginPresenter() : BasePresenter<BeginActivity>() {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
fun score(id:Int,step:Int,list: List<ScoreReqBean.CandidatesBean>) {
|
fun score(bean:ScoreReqBean) {
|
||||||
var bean = ScoreReqBean()
|
|
||||||
bean.id = id
|
|
||||||
bean.step = step
|
|
||||||
bean.candidates = list
|
|
||||||
LogUtil.e("提交数据",bean)
|
LogUtil.e("提交数据",bean)
|
||||||
|
concise.request(v, concise.api.score(bean), object : CallBack<BaseBean<*>> {
|
||||||
|
override fun onSuccess(k: BaseBean<*>?) {
|
||||||
|
if(k?.code == 0){
|
||||||
|
ToastUtil.longToast("成绩提交成功")
|
||||||
|
mmkv?.remove(ACTIVITY + bean.id)
|
||||||
|
v.scoreResult()
|
||||||
|
}else{
|
||||||
|
ToastUtil.longToast(k?.msg)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// concise.request(v, concise.api.score(bean), object : CallBack<BaseBean<*>> {
|
override fun onFailed(e: Throwable?) {
|
||||||
// override fun onSuccess(k: BaseBean<*>?) {
|
ToastUtil.longToast("成绩提交失败")
|
||||||
// ToastUtil.longToast("成绩提交成功")
|
}
|
||||||
// v.scoreResult()
|
|
||||||
// }
|
})
|
||||||
//
|
|
||||||
// override fun onFailed(e: Throwable?) {
|
|
||||||
// ToastUtil.longToast("成绩提交失败")
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,139 @@
|
||||||
|
package com.skipping.net;
|
||||||
|
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Ming
|
||||||
|
* 4/8/22
|
||||||
|
*/
|
||||||
|
public class DetailAcBean {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ID : 1
|
||||||
|
* ActivityName : 活动1
|
||||||
|
* ActivityType : timing
|
||||||
|
* ActivityValue : 60
|
||||||
|
* Step : 2
|
||||||
|
* Max : 12
|
||||||
|
* Avg : 9.75
|
||||||
|
* Median : 9.5
|
||||||
|
* Candidates : [[{"PersonID":"329b20b046f5888bcd5165d115f1","Name":"xiaofang","StudentID":"1002","Score":12,"Detail":null},{"PersonID":"4557de13408aaf9057752285c81a","Name":"xiaohai","StudentID":"1003","Score":8,"Detail":null},{"PersonID":"4dee38df466fa8469f0e62f672fb","Name":"xiaoli","StudentID":"1004","Score":9,"Detail":null}]]
|
||||||
|
*/
|
||||||
|
|
||||||
|
private Integer ID;
|
||||||
|
private String ActivityName;
|
||||||
|
private String ActivityType;
|
||||||
|
private Integer ActivityValue;
|
||||||
|
private Integer Step;
|
||||||
|
private Integer Max;
|
||||||
|
private Double Avg;
|
||||||
|
private Double Median;
|
||||||
|
private List<List<DetailActivityBean.CandidatesBean>> Candidates;
|
||||||
|
|
||||||
|
public Integer getId() {
|
||||||
|
return ID;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setId(Integer id) {
|
||||||
|
this.ID = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getActivityName() {
|
||||||
|
return ActivityName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivityName(String activityName) {
|
||||||
|
ActivityName = activityName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getActivityType() {
|
||||||
|
return ActivityType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivityType(String activityType) {
|
||||||
|
ActivityType = activityType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getActivityValue() {
|
||||||
|
return ActivityValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setActivityValue(Integer activityValue) {
|
||||||
|
ActivityValue = activityValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getStep() {
|
||||||
|
return Step;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setStep(Integer step) {
|
||||||
|
Step = step;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getMax() {
|
||||||
|
return Max;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMax(Integer max) {
|
||||||
|
Max = max;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getAvg() {
|
||||||
|
return Avg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAvg(Double avg) {
|
||||||
|
Avg = avg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Double getMedian() {
|
||||||
|
return Median;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setMedian(Double median) {
|
||||||
|
Median = median;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<List<DetailActivityBean.CandidatesBean>> getCandidates() {
|
||||||
|
return Candidates;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCandidates(List<List<DetailActivityBean.CandidatesBean>> candidates) {
|
||||||
|
Candidates = candidates;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "DetailActivityBean{" +
|
||||||
|
"id=" + ID +
|
||||||
|
", ActivityName='" + ActivityName + '\'' +
|
||||||
|
", ActivityType='" + ActivityType + '\'' +
|
||||||
|
", ActivityValue=" + ActivityValue +
|
||||||
|
", Step=" + Step +
|
||||||
|
", Max=" + Max +
|
||||||
|
", Avg=" + Avg +
|
||||||
|
", Median=" + Median +
|
||||||
|
", Candidates=" + Candidates +
|
||||||
|
'}';
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class CandidatesBean{
|
||||||
|
/**
|
||||||
|
* PersonID : 329b20b046f5888bcd5165d115f1
|
||||||
|
* Name : xiaofang
|
||||||
|
* StudentID : 1002
|
||||||
|
* Score : 12
|
||||||
|
* Detail : [0,1,2]
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String PersonID;
|
||||||
|
private String Name;
|
||||||
|
private String StudentID;
|
||||||
|
private Integer Score;
|
||||||
|
private List<Integer> Detail;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -1,15 +1,19 @@
|
||||||
package com.skipping.net;
|
package com.skipping.net;
|
||||||
|
|
||||||
|
import android.os.Parcel;
|
||||||
|
import android.os.Parcelable;
|
||||||
|
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Ming
|
* @author Ming
|
||||||
* 3/15/22
|
* 3/15/22
|
||||||
*/
|
*/
|
||||||
public class DetailActivityBean implements Serializable {
|
public class DetailActivityBean implements Parcelable {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ID : 1
|
* ID : 1
|
||||||
|
|
@ -120,7 +124,7 @@ public class DetailActivityBean implements Serializable {
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class CandidatesBean implements Serializable {
|
public static class CandidatesBean implements Parcelable {
|
||||||
/**
|
/**
|
||||||
* PersonID : 329b20b046f5888bcd5165d115f1
|
* PersonID : 329b20b046f5888bcd5165d115f1
|
||||||
* Name : xiaofang
|
* Name : xiaofang
|
||||||
|
|
@ -185,5 +189,111 @@ public class DetailActivityBean implements Serializable {
|
||||||
", Detail=" + Detail +
|
", Detail=" + Detail +
|
||||||
'}';
|
'}';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeString(this.PersonID);
|
||||||
|
dest.writeString(this.Name);
|
||||||
|
dest.writeString(this.StudentID);
|
||||||
|
dest.writeValue(this.Score);
|
||||||
|
dest.writeList(this.Detail);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void readFromParcel(Parcel source) {
|
||||||
|
this.PersonID = source.readString();
|
||||||
|
this.Name = source.readString();
|
||||||
|
this.StudentID = source.readString();
|
||||||
|
this.Score = (Integer) source.readValue(Integer.class.getClassLoader());
|
||||||
|
this.Detail = new ArrayList<Integer>();
|
||||||
|
source.readList(this.Detail, Integer.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
public CandidatesBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected CandidatesBean(Parcel in) {
|
||||||
|
this.PersonID = in.readString();
|
||||||
|
this.Name = in.readString();
|
||||||
|
this.StudentID = in.readString();
|
||||||
|
this.Score = (Integer) in.readValue(Integer.class.getClassLoader());
|
||||||
|
this.Detail = new ArrayList<Integer>();
|
||||||
|
in.readList(this.Detail, Integer.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<CandidatesBean> CREATOR = new Parcelable.Creator<CandidatesBean>() {
|
||||||
|
@Override
|
||||||
|
public CandidatesBean createFromParcel(Parcel source) {
|
||||||
|
return new CandidatesBean(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CandidatesBean[] newArray(int size) {
|
||||||
|
return new CandidatesBean[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int describeContents() {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToParcel(Parcel dest, int flags) {
|
||||||
|
dest.writeValue(this.ID);
|
||||||
|
dest.writeString(this.ActivityName);
|
||||||
|
dest.writeString(this.ActivityType);
|
||||||
|
dest.writeValue(this.ActivityValue);
|
||||||
|
dest.writeValue(this.Step);
|
||||||
|
dest.writeValue(this.Max);
|
||||||
|
dest.writeValue(this.Avg);
|
||||||
|
dest.writeValue(this.Median);
|
||||||
|
dest.writeList(this.Candidates);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void readFromParcel(Parcel source) {
|
||||||
|
this.ID = (Integer) source.readValue(Integer.class.getClassLoader());
|
||||||
|
this.ActivityName = source.readString();
|
||||||
|
this.ActivityType = source.readString();
|
||||||
|
this.ActivityValue = (Integer) source.readValue(Integer.class.getClassLoader());
|
||||||
|
this.Step = (Integer) source.readValue(Integer.class.getClassLoader());
|
||||||
|
this.Max = (Integer) source.readValue(Integer.class.getClassLoader());
|
||||||
|
this.Avg = (Double) source.readValue(Double.class.getClassLoader());
|
||||||
|
this.Median = (Double) source.readValue(Double.class.getClassLoader());
|
||||||
|
this.Candidates = new ArrayList<List<CandidatesBean>>();
|
||||||
|
source.readList(this.Candidates, CandidatesBean.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
public DetailActivityBean() {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected DetailActivityBean(Parcel in) {
|
||||||
|
this.ID = (Integer) in.readValue(Integer.class.getClassLoader());
|
||||||
|
this.ActivityName = in.readString();
|
||||||
|
this.ActivityType = in.readString();
|
||||||
|
this.ActivityValue = (Integer) in.readValue(Integer.class.getClassLoader());
|
||||||
|
this.Step = (Integer) in.readValue(Integer.class.getClassLoader());
|
||||||
|
this.Max = (Integer) in.readValue(Integer.class.getClassLoader());
|
||||||
|
this.Avg = (Double) in.readValue(Double.class.getClassLoader());
|
||||||
|
this.Median = (Double) in.readValue(Double.class.getClassLoader());
|
||||||
|
this.Candidates = new ArrayList<List<CandidatesBean>>();
|
||||||
|
in.readList(this.Candidates, CandidatesBean.class.getClassLoader());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Parcelable.Creator<DetailActivityBean> CREATOR = new Parcelable.Creator<DetailActivityBean>() {
|
||||||
|
@Override
|
||||||
|
public DetailActivityBean createFromParcel(Parcel source) {
|
||||||
|
return new DetailActivityBean(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DetailActivityBean[] newArray(int size) {
|
||||||
|
return new DetailActivityBean[size];
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.skipping.net;
|
||||||
import com.google.gson.annotations.SerializedName;
|
import com.google.gson.annotations.SerializedName;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -61,7 +62,7 @@ public class ScoreReqBean implements Serializable {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private Integer ComplateTime;
|
private Integer ComplateTime;
|
||||||
private List<InfoBean> Info;
|
private List<InfoBean> Info = new ArrayList<>();
|
||||||
|
|
||||||
public Integer getComplateTime() {
|
public Integer getComplateTime() {
|
||||||
return ComplateTime;
|
return ComplateTime;
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,17 @@ public class ConnectManager {
|
||||||
private OnflushList onflushList;
|
private OnflushList onflushList;
|
||||||
private ScheduledFuture scheduledFuture;
|
private ScheduledFuture scheduledFuture;
|
||||||
private static volatile ConnectManager connectManager;
|
private static volatile ConnectManager connectManager;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备列表
|
||||||
|
*/
|
||||||
public List<DeviceBean> deviceBeanList = new ArrayList<>();
|
public List<DeviceBean> deviceBeanList = new ArrayList<>();
|
||||||
private ScheduledFuture future;
|
private ScheduledFuture future;
|
||||||
private DialogTool dialog;
|
private DialogTool dialog;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成绩列表 key是设备id value是成绩
|
||||||
|
*/
|
||||||
public HashMap<Integer, List<Integer>> scoreMap = new HashMap<>();
|
public HashMap<Integer, List<Integer>> scoreMap = new HashMap<>();
|
||||||
private boolean getScore = false;
|
private boolean getScore = false;
|
||||||
public Boolean deviceStatus = false;
|
public Boolean deviceStatus = false;
|
||||||
|
|
@ -333,6 +341,7 @@ public class ConnectManager {
|
||||||
loopDevice = (LoopDevice) msg.obj;
|
loopDevice = (LoopDevice) msg.obj;
|
||||||
LogUtil.e("连接LoopDevice__LOOP_GET_DEVICE_INFO", loopDevice.toString());
|
LogUtil.e("连接LoopDevice__LOOP_GET_DEVICE_INFO", loopDevice.toString());
|
||||||
if (getScore) {
|
if (getScore) {
|
||||||
|
//当执行获取模式,保存在scoreMap key是设备id value是成绩
|
||||||
if (scoreMap.get(loopDevice.loopDeviceId) == null) {
|
if (scoreMap.get(loopDevice.loopDeviceId) == null) {
|
||||||
List<Integer> list = new ArrayList<>();
|
List<Integer> list = new ArrayList<>();
|
||||||
list.add(loopDevice.count);
|
list.add(loopDevice.count);
|
||||||
|
|
@ -341,6 +350,7 @@ public class ConnectManager {
|
||||||
scoreMap.get(loopDevice.loopDeviceId).add(loopDevice.count);
|
scoreMap.get(loopDevice.loopDeviceId).add(loopDevice.count);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
//当不是获取模式,刷新设备列表
|
||||||
addList(loopDevice);
|
addList(loopDevice);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue