|
|
@@ -13,9 +13,11 @@ import android.widget.Button;
|
|
|
import android.widget.TextView;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.android.volley.Request;
|
|
|
import com.uas.pda_smart_com_lg.R;
|
|
|
+import com.uas.pda_smart_com_lg.bean.VersionUpgradeBean;
|
|
|
import com.uas.pda_smart_com_lg.global.GloableParams;
|
|
|
import com.uas.pda_smart_com_lg.util.AndroidUtil;
|
|
|
import com.uas.pda_smart_com_lg.util.CommonUtil;
|
|
|
@@ -31,6 +33,8 @@ import com.uas.pda_smart_com_lg.view.business.CommonProgressPop;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
+import java.util.ArrayList;
|
|
|
+import java.util.List;
|
|
|
|
|
|
import static com.uas.pda_smart_com_lg.util.Constants.CONSTANT.APK_FILE_NAME;
|
|
|
import static com.uas.pda_smart_com_lg.util.Constants.CONSTANT.APK_FILE_PATH;
|
|
|
@@ -113,16 +117,42 @@ public class VersionUpgradeFragment extends BaseFragment implements ProgressResp
|
|
|
progressDialog.dismiss();
|
|
|
String result = o.toString();
|
|
|
JSONObject resultObject = JSON.parseObject(result);
|
|
|
- JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
- if (dataObject != null) {
|
|
|
- mNewVersionTv.setText(FastjsonUtil.getText(dataObject, "PP_VERSIONNAME"));
|
|
|
- mMsgTextView.setText(FastjsonUtil.getText(dataObject, "PP_REMARK"));
|
|
|
-
|
|
|
- mAttachId = FastjsonUtil.getText(dataObject, "PP_ATTACH");
|
|
|
- if (!TextUtils.isEmpty(mAttachId)) {
|
|
|
- mUpgradeButton.setVisibility(View.VISIBLE);
|
|
|
- } else {
|
|
|
- mUpgradeButton.setVisibility(View.GONE);
|
|
|
+ JSONArray dataArray = resultObject.getJSONArray("data");
|
|
|
+ List<VersionUpgradeBean> list=new ArrayList<>();
|
|
|
+ list.clear();
|
|
|
+ if (dataArray != null && dataArray.size() > 0) {
|
|
|
+ for (int i = 0; i < dataArray.size(); i++) {
|
|
|
+ JSONObject dataObject = dataArray.getJSONObject(i);
|
|
|
+ if (dataObject != null) {
|
|
|
+ VersionUpgradeBean jltStorageInBean = new VersionUpgradeBean();
|
|
|
+ if (FastjsonUtil.getText(dataObject, "PP_PDACODE").equals("UAS仓储管理")){
|
|
|
+ jltStorageInBean.setPP_PDACODE(FastjsonUtil.getText(dataObject, "PP_PDACODE"));
|
|
|
+ jltStorageInBean.setPP_VERSIONNUM(FastjsonUtil.getText(dataObject, "PP_VERSIONNUM"));
|
|
|
+ jltStorageInBean.setPP_ATTACH(FastjsonUtil.getText(dataObject, "PP_ATTACH"));
|
|
|
+ jltStorageInBean.setPP_REMARK(FastjsonUtil.getText(dataObject, "PP_REMARK"));
|
|
|
+ jltStorageInBean.setPP_VERSIONNAME(FastjsonUtil.getText(dataObject, "PP_VERSIONNAME"));
|
|
|
+ list.add(jltStorageInBean);
|
|
|
+ mUpgradeButton.setVisibility(View.VISIBLE);
|
|
|
+ }else {
|
|
|
+ mUpgradeButton.setVisibility(View.GONE);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (list == null || list.size() == 0){
|
|
|
+ mUpgradeButton.setVisibility(View.GONE);
|
|
|
+ }else {
|
|
|
+ for (int i=0;i<list.size();i++){
|
|
|
+ VersionUpgradeBean versionUpgradeBean = list.get(0);
|
|
|
+ mNewVersionTv.setText(versionUpgradeBean.getPP_VERSIONNAME());
|
|
|
+ mMsgTextView.setText(versionUpgradeBean.getPP_REMARK());
|
|
|
+ mAttachId = versionUpgradeBean.getPP_ATTACH();
|
|
|
+ if (!TextUtils.isEmpty(mAttachId)) {
|
|
|
+ mUpgradeButton.setVisibility(View.VISIBLE);
|
|
|
+ } else {
|
|
|
+ mUpgradeButton.setVisibility(View.VISIBLE);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|