340 lines
8.5 KiB
Java
340 lines
8.5 KiB
Java
package com.ubt.jimu.course.repository;
|
|
|
|
import android.text.TextUtils;
|
|
import com.google.gson.Gson;
|
|
import com.google.gson.annotations.Expose;
|
|
import com.google.gson.reflect.TypeToken;
|
|
import com.ubt.jimu.utils.GsonUtil;
|
|
import com.ubtrobot.jimu.robotapi.BoardInfo;
|
|
import java.io.Serializable;
|
|
import java.util.ArrayList;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/* loaded from: classes.dex */
|
|
public class JimuCourseMission implements Serializable {
|
|
public static final int SKIP_MISSION = 1;
|
|
public static final String STATE_LOCK = "1";
|
|
public static final String STATE_UNLOCK = "0";
|
|
public static final long serialVersionUID = 3;
|
|
private String androidVersion;
|
|
private String beginPath;
|
|
private String beginType;
|
|
private long courseId;
|
|
private String description;
|
|
private String folderName;
|
|
private long id;
|
|
private String imagePath;
|
|
private String imagePathLock;
|
|
private String iosVersion;
|
|
private String isAvailable;
|
|
private String isLock;
|
|
private int isSkip;
|
|
private String knowledge;
|
|
private Long localId;
|
|
private String missionType;
|
|
private List<List<JimuModule>> modules;
|
|
|
|
@Expose(deserialize = false, serialize = false)
|
|
private String modulesStr;
|
|
private String name;
|
|
private long packageId;
|
|
private String resourceZip;
|
|
private String skipDescription;
|
|
private int star;
|
|
private String starMax;
|
|
private long taskId;
|
|
private long updatedTime;
|
|
private String userId;
|
|
|
|
public JimuCourseMission(Long l, long j, long j2, long j3, long j4, String str, String str2, String str3, String str4, String str5, String str6, String str7, String str8, String str9, String str10, String str11, String str12, String str13, String str14, String str15, String str16, long j5, int i, int i2, String str17, String str18) {
|
|
this.localId = l;
|
|
this.id = j;
|
|
this.taskId = j2;
|
|
this.courseId = j3;
|
|
this.packageId = j4;
|
|
this.userId = str;
|
|
this.missionType = str2;
|
|
this.folderName = str3;
|
|
this.name = str4;
|
|
this.description = str5;
|
|
this.starMax = str6;
|
|
this.imagePath = str7;
|
|
this.imagePathLock = str8;
|
|
this.resourceZip = str9;
|
|
this.beginType = str10;
|
|
this.beginPath = str11;
|
|
this.isLock = str12;
|
|
this.knowledge = str13;
|
|
this.isAvailable = str14;
|
|
this.iosVersion = str15;
|
|
this.androidVersion = str16;
|
|
this.updatedTime = j5;
|
|
this.star = i;
|
|
this.isSkip = i2;
|
|
this.skipDescription = str17;
|
|
this.modulesStr = str18;
|
|
}
|
|
|
|
public String getAndroidVersion() {
|
|
return this.androidVersion;
|
|
}
|
|
|
|
public String getBeginPath() {
|
|
return this.beginPath;
|
|
}
|
|
|
|
public String getBeginType() {
|
|
return this.beginType;
|
|
}
|
|
|
|
public long getCourseId() {
|
|
return this.courseId;
|
|
}
|
|
|
|
public String getDescription() {
|
|
return this.description;
|
|
}
|
|
|
|
public String getFolderName() {
|
|
return this.folderName;
|
|
}
|
|
|
|
public long getId() {
|
|
return this.id;
|
|
}
|
|
|
|
public String getImagePath() {
|
|
return this.imagePath;
|
|
}
|
|
|
|
public String getImagePathLock() {
|
|
return this.imagePathLock;
|
|
}
|
|
|
|
public String getIosVersion() {
|
|
return this.iosVersion;
|
|
}
|
|
|
|
public String getIsAvailable() {
|
|
return this.isAvailable;
|
|
}
|
|
|
|
public String getIsLock() {
|
|
return this.isLock;
|
|
}
|
|
|
|
public int getIsSkip() {
|
|
return this.isSkip;
|
|
}
|
|
|
|
public String getKnowledge() {
|
|
return this.knowledge;
|
|
}
|
|
|
|
public Long getLocalId() {
|
|
return this.localId;
|
|
}
|
|
|
|
public List<JimuModule> getMissingComponents(BoardInfo boardInfo) {
|
|
List<List<JimuModule>> modules = getModules();
|
|
ArrayList arrayList = null;
|
|
if (modules != null && modules.size() > 0) {
|
|
if (boardInfo == null) {
|
|
return null;
|
|
}
|
|
Map<Integer, Integer> g = boardInfo.g();
|
|
arrayList = new ArrayList();
|
|
for (List<JimuModule> list : modules) {
|
|
if (list != null && list.size() > 0) {
|
|
for (int size = list.size() - 1; size >= 0; size--) {
|
|
JimuModule jimuModule = (JimuModule) list.get(size).clone();
|
|
Integer num = g.get(Integer.valueOf(JimuModule.getType(jimuModule.getModuleId())));
|
|
if (num == null || num.intValue() < jimuModule.getCount()) {
|
|
if (size <= 0) {
|
|
if (num != null) {
|
|
jimuModule.setCount(jimuModule.getCount() - num.intValue());
|
|
}
|
|
arrayList.add(jimuModule);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
public String getMissionType() {
|
|
return this.missionType;
|
|
}
|
|
|
|
public List<List<JimuModule>> getModules() {
|
|
List<List<JimuModule>> list = this.modules;
|
|
if ((list == null || list.size() <= 0) && !TextUtils.isEmpty(this.modulesStr)) {
|
|
this.modules = (List) GsonUtil.a(this.modulesStr, new TypeToken<List<List<JimuModule>>>() { // from class: com.ubt.jimu.course.repository.JimuCourseMission.1
|
|
});
|
|
}
|
|
return this.modules;
|
|
}
|
|
|
|
public String getModulesStr() {
|
|
List<List<JimuModule>> list;
|
|
if (TextUtils.isEmpty(this.modulesStr) && (list = this.modules) != null && list.size() > 0) {
|
|
setModulesStr(new Gson().toJson(this.modules));
|
|
}
|
|
return this.modulesStr;
|
|
}
|
|
|
|
public String getName() {
|
|
return this.name;
|
|
}
|
|
|
|
public long getPackageId() {
|
|
return this.packageId;
|
|
}
|
|
|
|
public String getResourceZip() {
|
|
return this.resourceZip;
|
|
}
|
|
|
|
public String getSkipDescription() {
|
|
return this.skipDescription;
|
|
}
|
|
|
|
public int getStar() {
|
|
return this.star;
|
|
}
|
|
|
|
public String getStarMax() {
|
|
return this.starMax;
|
|
}
|
|
|
|
public long getTaskId() {
|
|
return this.taskId;
|
|
}
|
|
|
|
public long getUpdatedTime() {
|
|
return this.updatedTime;
|
|
}
|
|
|
|
public String getUserId() {
|
|
return this.userId;
|
|
}
|
|
|
|
public boolean isLock() {
|
|
return "1".equals(this.isLock);
|
|
}
|
|
|
|
public void setAndroidVersion(String str) {
|
|
this.androidVersion = str;
|
|
}
|
|
|
|
public void setBeginPath(String str) {
|
|
this.beginPath = str;
|
|
}
|
|
|
|
public void setBeginType(String str) {
|
|
this.beginType = str;
|
|
}
|
|
|
|
public void setCourseId(long j) {
|
|
this.courseId = j;
|
|
}
|
|
|
|
public void setDescription(String str) {
|
|
this.description = str;
|
|
}
|
|
|
|
public void setFolderName(String str) {
|
|
this.folderName = str;
|
|
}
|
|
|
|
public void setId(long j) {
|
|
this.id = j;
|
|
}
|
|
|
|
public void setImagePath(String str) {
|
|
this.imagePath = str;
|
|
}
|
|
|
|
public void setImagePathLock(String str) {
|
|
this.imagePathLock = str;
|
|
}
|
|
|
|
public void setIosVersion(String str) {
|
|
this.iosVersion = str;
|
|
}
|
|
|
|
public void setIsAvailable(String str) {
|
|
this.isAvailable = str;
|
|
}
|
|
|
|
public void setIsLock(String str) {
|
|
this.isLock = str;
|
|
}
|
|
|
|
public void setIsSkip(int i) {
|
|
this.isSkip = i;
|
|
}
|
|
|
|
public void setKnowledge(String str) {
|
|
this.knowledge = str;
|
|
}
|
|
|
|
public void setLocalId(Long l) {
|
|
this.localId = l;
|
|
}
|
|
|
|
public void setMissionType(String str) {
|
|
this.missionType = str;
|
|
}
|
|
|
|
public void setModules(List<List<JimuModule>> list) {
|
|
this.modules = list;
|
|
}
|
|
|
|
public void setModulesStr(String str) {
|
|
this.modulesStr = str;
|
|
}
|
|
|
|
public void setName(String str) {
|
|
this.name = str;
|
|
}
|
|
|
|
public void setPackageId(long j) {
|
|
this.packageId = j;
|
|
}
|
|
|
|
public void setResourceZip(String str) {
|
|
this.resourceZip = str;
|
|
}
|
|
|
|
public void setSkipDescription(String str) {
|
|
this.skipDescription = str;
|
|
}
|
|
|
|
public void setStar(int i) {
|
|
this.star = i;
|
|
}
|
|
|
|
public void setStarMax(String str) {
|
|
this.starMax = str;
|
|
}
|
|
|
|
public void setTaskId(long j) {
|
|
this.taskId = j;
|
|
}
|
|
|
|
public void setUpdatedTime(long j) {
|
|
this.updatedTime = j;
|
|
}
|
|
|
|
public void setUserId(String str) {
|
|
this.userId = str;
|
|
}
|
|
|
|
public JimuCourseMission() {
|
|
}
|
|
}
|