2.4.0 release

master
wenfei 7 months ago
parent a91626e369
commit 62266f9cb2

@ -13,8 +13,8 @@ android {
applicationId "com.rehome.zhdcoa"
minSdk 24
targetSdk 36
versionCode 23
versionName "2.3.9"
versionCode 24
versionName "2.4.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
//authorities

@ -122,6 +122,10 @@ public interface Api {
@Query("timee") String timee);
@GET("PubFile/Data/GetOrderListRsa.ashx")
Call<String> getMyAdviceRsa(@Query("listcode") String listcode,
@Query("manid") String manid,
@Query("proposerid") String proposerid);
@GET("PubFile/Data/GetOrderList.ashx")
Call<MyadviceBean> getMyAdvice(@Query("listcode") String listcode,
@Query("manid") String manid,
@ -452,15 +456,15 @@ public interface Api {
* @param departmentnameid
* @return
*/
@GET("PubFile/Data/GetOrderList.ashx")
Call<ApplyListReceiveBean> getReceiveList(@Query("listcode") String listcode,
@Query("proposerid") String proposerid,
@Query("manid") String manid,
@Query("departmentnameid") String departmentnameid,
@Query("platform") String platform);
// @GET("PubFile/Data/GetOrderList.ashx")
// Call<ApplyListReceiveBean> getReceiveList(@Query("listcode") String listcode,
// @Query("proposerid") String proposerid,
// @Query("manid") String manid,
// @Query("departmentnameid") String departmentnameid,
// @Query("platform") String platform);
/**
* 访
*
*
* @param listcode
* @param proposerid
@ -985,9 +989,9 @@ public interface Api {
* @param aboutme
* @return
*/
@GET("PubFile/Data/aboutme/aboutdetail.ashx")
Call<AboutMeListBean> getAboutMeList(@Query("manid") String manid,
@Query("aboutme") String aboutme);
// @GET("PubFile/Data/aboutme/aboutdetail.ashx")
// Call<AboutMeListBean> getAboutMeList(@Query("manid") String manid,
// @Query("aboutme") String aboutme);
/**
*

@ -223,10 +223,12 @@ public class Contans {
public static String GETABOUTME_URL = "PubFile/Data/aboutme/aboutme.ashx?manid=";
public static String GETABOUTMELIST_URL = "PubFile/Data/aboutme/aboutdetail.ashx?manid=";
public static String GET_ABOUTME_LIST_RSA_URL = "PubFile/Data/aboutme/aboutdetailRsa.ashx";
public static String GETATTENDANCECHECK_URL = "PubFile/Data/RGKQ/GetDataZZCX.ashx?manid=";
public static String GETCHECKUPDATAAPK_URL = "ApkUpdate/GetDataRsa.aspx";
public static String GETYZMANDCHECKYZMANDMODIFYMIMA = "PubFile/Data/GetVerificationCode.ashx";
public static String GET_LISTDATA_URL = "PubFile_DJXT/InterfaceApp/STUDY/WLKCGL/Get_KCGL_DetailData.ashx?skrrid=";
public static String GET_LISTDATA_URL = "PubFile_DJXT/InterfaceApp/STUDY/WLKCGL/Get_KCGL_DetailData.ashx";
public static String GET_LISTDATA_RSA_URL = "PubFile_DJXT/InterfaceApp/STUDY/WLKCGL/Get_KCGL_DetailDataRsa.ashx";
@ -573,6 +575,10 @@ public class Contans {
*
*/
public static String ABOUT_ME_RSA_URL="PubFile/Data/aboutme/aboutmeRsa.ashx";
//获取审批流程
public static String GET_ORDER_LIST_RSA_URL="PubFile/Data/GetOrderListRsa.ashx";
public static String GETAPPLYLIST2_RSA_URL="PubFile/Data/GetList.ashx";
/**
*

@ -1,11 +1,13 @@
package com.rehome.zhdcoa.ui.activity
import android.content.Intent
import android.text.TextUtils
import android.util.Log
import android.view.View
import android.widget.AdapterView
import com.rehome.zhdcoa.App
import com.rehome.zhdcoa.Contans
import com.rehome.zhdcoa.R
import com.rehome.zhdcoa.adapter.AboutMeListAdapter
import com.rehome.zhdcoa.base.BaseActivity
import com.rehome.zhdcoa.base.BaseActivityOaToolbarViewBinding
@ -14,7 +16,13 @@ import com.rehome.zhdcoa.bean.AboutMeListBean
import com.rehome.zhdcoa.bean.ChangeShiftBean
import com.rehome.zhdcoa.databinding.ActivityApplyAboutMeBinding
import com.rehome.zhdcoa.utils.GsonUtils
import com.rehome.zhdcoa.utils.HttpListener
import com.rehome.zhdcoa.utils.HttpUtils
import com.rehome.zhdcoa.utils.NohttpUtils
import com.rehome.zhdcoa.utils.RSAUtils
import com.rehome.zhdcoa.utils.UiUtlis
import com.yolanda.nohttp.NoHttp
import com.yolanda.nohttp.RequestMethod
import retrofit2.Call
import retrofit2.Response
@ -733,15 +741,35 @@ class ApplyAboutMeActivity : BaseActivityOaToolbarViewBinding<ActivityApplyAbout
}
private fun getDatas() {
var manid = App.getInstance().userInfo.manid
//var manid = App.getInstance().userInfo.manid
//manid = "310430"
HttpUtils.getApi(this).getAboutMeList(manid, aboutMeType.toString() + "")
.enqueue(object : BaseCallBack<AboutMeListBean?>(context) {
override fun onSuccess(
call: Call<AboutMeListBean?>?,
response: Response<AboutMeListBean?>?
//获取我的条数显示
val url = Contans.BASE_URL + Contans.GET_ABOUTME_LIST_RSA_URL
val request = NoHttp.createStringRequest(url, RequestMethod.GET)
request.add("manid",App.getInstance().userInfo.manid)
request.add("aboutme","3")
NohttpUtils.getInstance()
.addNoProgress<String>(this, 0, request, object : HttpListener<String?> {
override fun onSucceed(
what: Int,
response: com.yolanda.nohttp.rest.Response<String?>?
) {
val bean = response?.body()
showLog("<---------------->")
showLog(url)
val jsonResult = response?.get()
showLog(jsonResult ?: "jsonResult is null")
val jsonDecode = RSAUtils.decryptBASE64StrClient(jsonResult)
showLog(jsonDecode)
showLog( "--------getAboutMeData--------")
if (TextUtils.isEmpty(jsonDecode)) {
showToast(UiUtlis.getString(context, R.string.data_error))
} else {
val bean = GsonUtils.GsonToBean(
jsonDecode,
AboutMeListBean::class.java
)
if (bean != null) {
if (bean.total != "0") {
datas.clear()
@ -753,11 +781,42 @@ class ApplyAboutMeActivity : BaseActivityOaToolbarViewBinding<ActivityApplyAbout
}
}
}
}
override fun onError(call: Call<AboutMeListBean?>?, t: Throwable?) {
override fun onFailed(
what: Int,
response: com.yolanda.nohttp.rest.Response<String?>?
) {
}
})
// HttpUtils.getApi(this).getAboutMeList(manid, aboutMeType.toString() + "")
// .enqueue(object : BaseCallBack<AboutMeListBean?>(context) {
// override fun onSuccess(
// call: Call<AboutMeListBean?>?,
// response: Response<AboutMeListBean?>?
// ) {
// val bean = response?.body()
// if (bean != null) {
// if (bean.total != "0") {
// datas.clear()
// datas.addAll(bean.rows)
// adapter.notifyDataSetChanged()
// } else {
// datas.clear()
// adapter.notifyDataSetChanged()
// }
// }
// }
//
// override fun onError(call: Call<AboutMeListBean?>?, t: Throwable?) {
//
// }
// })
}
private fun getListDatas(

@ -51,7 +51,7 @@ public class ApplyConferenceActivity extends BaseActivity implements ApplyListUt
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYCONFERENCE, userInfo.getManid())
.setListener(this)
.builder(context);
.builder(this);
}
@Override
@ -63,7 +63,7 @@ public class ApplyConferenceActivity extends BaseActivity implements ApplyListUt
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYCONFERENCE, userInfo.getManid())
.setListener(this)
.builder(context);
.builder(ApplyConferenceActivity.this);
}
}
}

@ -47,7 +47,7 @@ public class ApplyDinnerActivity extends BaseActivity implements ApplyListUtils.
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYDINNER, userInfo.getManid())
.setListener(this)
.builder(context);
.builder(this);
}
@Override
@ -59,7 +59,7 @@ public class ApplyDinnerActivity extends BaseActivity implements ApplyListUtils.
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYDINNER, userInfo.getManid())
.setListener(this)
.builder(context);
.builder(ApplyDinnerActivity.this);
}
}
}

@ -44,7 +44,7 @@ public class ApplyOfficeAddActivity extends BaseActivity implements ApplyListUti
.setListener(this)
.setParams(Contans.LISTCODE.APPLYFACILITIES, userInfo.getManid())
.setListView(lv)
.builder(context);
.builder(this);
}
@Override
@ -75,7 +75,7 @@ public class ApplyOfficeAddActivity extends BaseActivity implements ApplyListUti
.setListener(this)
.setParams(Contans.LISTCODE.APPLYFACILITIES, userInfo.getManid())
.setListView(lv)
.builder(context);
.builder(ApplyOfficeAddActivity.this);
}
}
}

@ -48,7 +48,7 @@ public class ApplyReceiveActivity extends BaseActivity implements ApplyListUtil
.setParams(Contans.LISTCODE.RECEIVEVISIT,userInfo.getManid())
.setListView(lv)
.setListener(this)
.builder(context);
.builder(this);
}
@Override
@ -80,7 +80,7 @@ public class ApplyReceiveActivity extends BaseActivity implements ApplyListUtil
.setParams(Contans.LISTCODE.RECEIVEVISIT,userInfo.getManid())
.setListView(lv)
.setListener(this)
.builder(context);
.builder(ApplyReceiveActivity.this);
break;
}
}

@ -42,7 +42,7 @@ public class ApplySuppliesActivity extends BaseActivity implements ApplyListUtil
.setParams(Contans.LISTCODE.APPLYSUPPLIES, userInfo.getManid())
.setListView(lv)
.setListener(this)
.builder(context);
.builder(this);
}
@Override
@ -76,7 +76,7 @@ public class ApplySuppliesActivity extends BaseActivity implements ApplyListUtil
.setParams(Contans.LISTCODE.APPLYSUPPLIES, userInfo.getManid())
.setListView(lv)
.setListener(this)
.builder(context);
.builder(ApplySuppliesActivity.this);
}
}
}

@ -44,7 +44,7 @@ public class ApplyTakeOutActivity extends BaseActivity implements ApplyListUtils
.setParams(Contans.LISTCODE.APPLYORDER,userInfo.getManid())
.setListView(lv)
.setListener(this)
.builder(context);
.builder(this);
}
@Override
@ -58,7 +58,7 @@ public class ApplyTakeOutActivity extends BaseActivity implements ApplyListUtils
.setParams(Contans.LISTCODE.APPLYORDER, userInfo.getManid())
.setListView(lv)
.setListener(this)
.builder(context);
.builder(ApplyTakeOutActivity.this);
}
}
}

@ -38,7 +38,7 @@ public class ApplyTravelActivity extends BaseActivity implements ApplyListUtils.
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYTRAVEL, userInfo.getManid())
.setListener(this)
.builder(context);
.builder(this);
}
@Override
@ -73,7 +73,7 @@ public class ApplyTravelActivity extends BaseActivity implements ApplyListUtils.
.setListView(lv)
.setParams(Contans.LISTCODE.APPLYTRAVEL, userInfo.getManid())
.setListener(this)
.builder(context);
.builder(ApplyTravelActivity.this);
break;
case 2:
break;

@ -45,7 +45,7 @@ public class ApplyVehicleActivity extends BaseActivity implements ApplyListUtil
.setListener(this)
.setParams(Contans.LISTCODE.APPLYVEHICLE, userInfo.getManid())
.setListView(lv)
.builder(context);
.builder(this);
}
@Override
@ -100,7 +100,7 @@ public class ApplyVehicleActivity extends BaseActivity implements ApplyListUtil
.setListener(this)
.setParams(Contans.LISTCODE.APPLYVEHICLE, userInfo.getManid())
.setListView(lv)
.builder(context);
.builder(ApplyVehicleActivity.this);
}
}
}

@ -174,78 +174,7 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
if (isApkInDebug(context)) {
// 管理员
binding.etUsername.setText("ZHPS_Admin")
binding.etPassword.setText("Rehome.zhps@996")
//公司内网215管理员
// binding.etUsername.setText("ZHPS_Admin")
// binding.etPassword.setText("Rehome.zhps@2020")
// binding.etUsername.setText("310353")
// binding.etPassword.setText("Zhps1382.")
// binding.etUsername.setText("310691")
// binding.etPassword.setText("Abcd*1234")
// binding.etUsername.setText("990001")
// binding.etPassword.setText("Bwfb@123")
// binding.etUsername.setText("310295")
// binding.etPassword.setText("Whk363521!")
// binding.etUsername.setText("310675")
// binding.etPassword.setText("Mj12345_")
//吴云强
// binding.etUsername.setText("310430")
// binding.etPassword.setText("Laq**201610")
//马
// binding.etUsername.setText("310482")
// binding.etPassword.setText("Maying2008!")
// 生产岗位 卢高波 可以进入巡视抄表
// binding.etUsername.setText("310492")
// binding.etPassword.setText("Dudu520520@")
//李昕逸 可以进入巡视抄表
// binding.etUsername.setText("310677")
// binding.etPassword.setText("LXY1997.qaz")
//陈坚标
// binding.etUsername.setText("310063")
// binding.etPassword.setText("ZHPs@040909")
////郑佩障
// binding.etUsername.setText("310569")
// binding.etPassword.setText("sUnnY@0926")
//谭添欢
// binding.etUsername.setText("310273")
// binding.etPassword.setText("#Tth8680004")
//吴云强
// binding.etUsername.setText("310430")
// binding.etPassword.setText("Laq@201610")
//欧建荣
// binding.etUsername.setText("310285")
// binding.etPassword.setText("@Ojr310285")
// binding.etUsername.setText("310561")
// binding.etPassword.setText("Yangjing!0561")
// binding.etUsername.setText("310534")
// binding.etPassword.setText("abCd*1234")
// binding.etUsername.setText("310291")
// binding.etPassword.setText("sfd02910291Z+")
// binding.etUsername.setText("310465")
// binding.etPassword.setText("Liu524042*")
// binding.etUsername.setText("310291")
// binding.etPassword.setText("sfd02910291Z+")

@ -219,14 +219,22 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
}
//获取我的条数显示
val url = Contans.BASE_URL + Contans.GETABOUTME_URL + App.getInstance().userInfo.manid
val url = Contans.BASE_URL + Contans.ABOUT_ME_RSA_URL
val request = NoHttp.createStringRequest(url, RequestMethod.GET)
request.add("manid",App.getInstance().userInfo.manid)
NohttpUtils.getInstance().addNoProgress(this, 0, request, object : HttpListener<String?> {
override fun onSucceed(what: Int, response: Response<String?>?) {
showLog( "----------------")
showLog( "--------getAboutMeData--------")
val jsonResult = response?.get()
showLog(url)
showLog( jsonResult ?: "jsonResult is null")
val bean = GsonUtils.GsonToBean(jsonResult, AboutMeBean::class.java)
val jsonDecode = RSAUtils.decryptBASE64StrClient(jsonResult)
showLog(jsonDecode)
showLog( "--------getAboutMeData--------")
if (TextUtils.isEmpty(jsonDecode)) {
showToast(UiUtlis.getString(context, R.string.data_error))
} else {
val bean = GsonUtils.GsonToBean(jsonDecode, AboutMeBean::class.java)
if (bean != null) {
if (bean.total != "0") {
val rowsBeanList = bean.rows
@ -256,6 +264,7 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
}
}
}
}
override fun onFailed(what: Int, response: Response<String?>?) {
@ -419,9 +428,9 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
val appVersionName = rowsBean.versionname
val androidVersionCode = rowsBean.android_versioncode
val appDesc = rowsBean.appdesc
if (appURL != null && appURL.contains("http://")) {
if (appURL.length > 26) {
val baseApkUrl = appURL.substring(26)
if (appURL != null && appURL.contains("https://")) {
if (appURL.length > 27) {
val baseApkUrl = appURL.substring(27)
appURL = Contans.BASE_URL + baseApkUrl
}
} else {

@ -45,7 +45,7 @@ public class MyAdviceActivity extends BaseActivity implements View.OnClickListen
.setListener(this)
.setParams(Contans.LISTCODE.APPLYSUGGESTION,userInfo.getManid())
.setListView(lv)
.builder(context);
.builder(this);
}else if (intent.getStringExtra("result_advice").equals("2")){
@ -57,7 +57,7 @@ public class MyAdviceActivity extends BaseActivity implements View.OnClickListen
.setListener(this)
.setParams(Contans.LISTCODE.APPLYSUGGESTION, "")
.setListView(lv)
.builder(context);
.builder(this);
}

@ -38,7 +38,7 @@ public class MyTaskActivity extends BaseActivity implements ApplyListUtils.OnIte
.setParams(Contans.LISTCODE.MYTASK,userInfo.getManid())
.setListener(this)
.setListView(lv)
.builder(context);
.builder(this);
}
@Override
@ -61,7 +61,7 @@ public class MyTaskActivity extends BaseActivity implements ApplyListUtils.OnIte
.setParams(Contans.LISTCODE.MYTASK, userInfo.getManid())
.setListener(this)
.setListView(lv)
.builder(context);
.builder(MyTaskActivity.this);
}
}
}

@ -45,7 +45,7 @@ public class OrdinaryVisitActivity extends BaseActivity implements ApplyListUtil
.setListener(this)
.setListView(lv)
.setParams(Contans.LISTCODE.ORDINARYVISIT, userInfo.getManid())
.builder(context);
.builder(this);
}
@Override

@ -55,7 +55,7 @@ public class OthersTaskActivity extends BaseActivity implements ApplyListUtils.
.setListView(lv)
.setParams(Contans.LISTCODE.OTHERTASK, userInfo.getManid())
.setListener(this)
.builder(context);
.builder(this);
}
@Override

@ -18,6 +18,7 @@ import com.rehome.zhdcoa.Contans
import com.rehome.zhdcoa.R
import com.rehome.zhdcoa.base.BaseActivityOaToolbarViewBinding
import com.rehome.zhdcoa.base.BaseCallBack
import com.rehome.zhdcoa.bean.AboutMeBean
import com.rehome.zhdcoa.bean.PxinfomoreBean
import com.rehome.zhdcoa.bean.UserInfoBean
import com.rehome.zhdcoa.databinding.ActivityTrainInfoMoreBinding
@ -423,9 +424,10 @@ class TrainInfoMoreActivity : BaseActivityOaToolbarViewBinding<ActivityTrainInfo
}
private fun getListDatas() {
val url = Contans.BASE_URL + Contans.GET_LISTDATA_URL + Skrrid
val url = Contans.BASE_URL + Contans.GET_LISTDATA_RSA_URL
val request = NoHttp.createStringRequest(url, RequestMethod.GET)
request.add("skrrid", Skrrid)
request.add("man_id", userInfo!!.manid)
NohttpUtils.getInstance().add(this, 0, request, object : HttpListener<String?> {
override fun onSucceed(
what: Int,
@ -435,8 +437,14 @@ class TrainInfoMoreActivity : BaseActivityOaToolbarViewBinding<ActivityTrainInfo
showLog("-----getListDatas 学习中心------")
showLog(jsonResult)
val bean: PxinfomoreBean? =
GsonUtils.GsonToBean(jsonResult, PxinfomoreBean::class.java)
val jsonDecode = RSAUtils.decryptBASE64StrClient(jsonResult)
showLog(jsonDecode)
showLog("-----getListDatas 学习中心------")
if (TextUtils.isEmpty(jsonDecode)) {
showToast(UiUtlis.getString(context, R.string.data_error))
} else {
val bean: PxinfomoreBean? = GsonUtils.GsonToBean(jsonDecode, PxinfomoreBean::class.java)
//val bean = GsonUtils.GsonToBean(jsonDecode, PxinfomoreBean::class.java)
if (bean != null) {
showLog(GsonUtils.GsonString(bean))
if (bean.result == "success") {
@ -489,6 +497,7 @@ class TrainInfoMoreActivity : BaseActivityOaToolbarViewBinding<ActivityTrainInfo
}
}
}
}
override fun onFailed(what: Int, response: com.yolanda.nohttp.rest.Response<String?>?) {
Log.i("login", "onError")

@ -4,6 +4,7 @@ import android.app.Activity
import android.content.Intent
import android.os.Handler
import android.os.Looper
import android.text.TextUtils
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
@ -78,6 +79,8 @@ import com.rehome.zhdcoa.utils.HttpListener
import com.rehome.zhdcoa.utils.HttpUtils
import com.rehome.zhdcoa.utils.ModuleDatas
import com.rehome.zhdcoa.utils.NohttpUtils
import com.rehome.zhdcoa.utils.RSAUtils
import com.rehome.zhdcoa.utils.UiUtlis
import com.rehome.zhdcoa.weiget.GridViewDialog
import com.xuexiang.xui.widget.textview.supertextview.SuperTextView
import com.xuexiang.xui.widget.textview.supertextview.SuperTextView.OnSuperTextViewClickListener
@ -742,9 +745,10 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>() {
return
}
//获取我的条数显示
val url =
Contans.BASE_URL + Contans.GETABOUTMELIST_URL + App.getInstance().userInfo.manid + "&aboutme=3"
val url = Contans.BASE_URL + Contans.GET_ABOUTME_LIST_RSA_URL
val request = NoHttp.createStringRequest(url, RequestMethod.GET)
request.add("manid",App.getInstance().userInfo.manid)
request.add("aboutme","3")
NohttpUtils.getInstance()
.addNoProgress<String>(requireActivity(), 0, request, object : HttpListener<String?> {
@ -756,8 +760,14 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>() {
showLog(url)
val jsonResult = response?.get()
showLog(jsonResult ?: "jsonResult is null")
val jsonDecode = RSAUtils.decryptBASE64StrClient(jsonResult)
showLog(jsonDecode)
showLog( "--------getAboutMeData--------")
if (TextUtils.isEmpty(jsonDecode)) {
showToast(UiUtlis.getString(context, R.string.data_error))
} else {
val bean = GsonUtils.GsonToBean(
jsonResult,
jsonDecode,
AboutMeListBean::class.java
)
if (bean != null) {
@ -783,6 +793,7 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>() {
}
}
}
}
override fun onFailed(
what: Int,

@ -1,13 +1,19 @@
package com.rehome.zhdcoa.utils;
import android.app.Activity;
import android.content.Context;
import android.content.pm.ApplicationInfo;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ListView;
import android.widget.Toast;
import com.rehome.zhdcoa.Api;
import com.rehome.zhdcoa.App;
import com.rehome.zhdcoa.Contans;
import com.rehome.zhdcoa.R;
import com.rehome.zhdcoa.adapter.ApplyConferenceAdapter;
import com.rehome.zhdcoa.adapter.ApplyDinnerListAdapter;
import com.rehome.zhdcoa.adapter.ApplyListAdapter;
@ -20,6 +26,7 @@ import com.rehome.zhdcoa.adapter.ApplyVehicleAdapter;
import com.rehome.zhdcoa.adapter.GetRadioListAdapter;
import com.rehome.zhdcoa.adapter.MyadviceAdapter;
import com.rehome.zhdcoa.base.BaseCallBack;
import com.rehome.zhdcoa.bean.AboutMeBean;
import com.rehome.zhdcoa.bean.ApplyListBean;
import com.rehome.zhdcoa.bean.ApplyListConferenceBean;
import com.rehome.zhdcoa.bean.ApplyListOtherTaskBean;
@ -32,6 +39,9 @@ import com.rehome.zhdcoa.bean.BfwwBean;
import com.rehome.zhdcoa.bean.GetRadioListBean;
import com.rehome.zhdcoa.bean.MyadviceBean;
import com.rehome.zhdcoa.bean.UserInfoBean;
import com.yolanda.nohttp.NoHttp;
import com.yolanda.nohttp.RequestMethod;
import com.yolanda.nohttp.rest.Request;
import java.util.ArrayList;
import java.util.HashMap;
@ -79,8 +89,10 @@ public class ApplyListUtils {
private GetRadioListAdapter getRadioListAdapter;
private MyadviceAdapter myadviceAdapter;
private Activity context;
private ApplyListUtils(Context context) {
private ApplyListUtils(Activity context) {
api = HttpUtils.getApi(context);
datas = new ArrayList<>();
receiveDatas = new ArrayList<>();
@ -93,6 +105,7 @@ public class ApplyListUtils {
getRadioDates = new ArrayList<>();
myadviceDatas = new ArrayList<>();
bfwwDatas= new ArrayList<>();
this.context=context;
init();
}
@ -111,14 +124,119 @@ public class ApplyListUtils {
String manid = userInfo.getManid();
String departmentnameid = userInfo.getBzbh();
if (listcode == Contans.LISTCODE.RECEIVEVISIT) {
String url = Contans.BASE_URL + Contans.GET_ORDER_LIST_RSA_URL;
Request<String> request = NoHttp.createStringRequest(url, RequestMethod.GET);
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
request.add("departmentnameid",departmentnameid);
if (listcode.equals(Contans.LISTCODE.RECEIVEVISIT)) {
//获取接待来访详情列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYCONFERENCE)) {
//获取会议室详情列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.ORDINARYVISIT)) {
//获取订餐列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYTRAVEL)) {
//获取出差申请列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYVEHICLE)) {
//获取用车申请详情列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.OTHERTASK)) {
//获取他人任务详情列表
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYORDER)) {
//获取送餐详情列表
request.add("platform","0");
request.add("login_userid","");
request.add("istj","");
} else if (listcode.equals(Contans.LISTCODE.APPLYDINNER)) {
//订餐申请
request.add("platform","0");
} else if (listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)) {
//获取申请列表
url = Contans.BASE_URL + Contans.GETAPPLYLIST2_RSA_URL;
request = NoHttp.createStringRequest(url, RequestMethod.GET);
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
request.add("times",times);
request.add("timee",timee);
} else if (listcode.equals(Contans.LISTCODE.APPLYFACILITIES)) {
//获取申请列表
url = Contans.BASE_URL + Contans.GETAPPLYLIST2_RSA_URL;
request = NoHttp.createStringRequest(url, RequestMethod.GET);
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
request.add("times",times);
request.add("timee",timee);
} else if (listcode.equals(Contans.LISTCODE.APPLYSUGGESTION)) {
//建议汇总和我的建议
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
} else {
//没有就是else里面
request.add("listcode",listcode);
request.add("proposerid",proposerid);
request.add("manid",manid);
request.add("times",times);
request.add("timee",timee);
}
NohttpUtils.getInstance().add(context, 0, request, new HttpListener<String>() {
api.getReceiveList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListReceiveBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyListReceiveBean> call, Response<ApplyListReceiveBean> response) {
ApplyListReceiveBean baseResult = response.body();
public void onSucceed(int what, com.yolanda.nohttp.rest.Response<String> response) {
showLog("----------------");
String result = response.get();
if(listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)||listcode.equals(Contans.LISTCODE.APPLYFACILITIES)){
if (listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(result,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
datas.clear();
}
}
}
if (listcode.equals(Contans.LISTCODE.APPLYFACILITIES)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(result,ApplyListBean.class);
if (baseResult != null) {
if (!baseResult.getTotal().equals("0")) {
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
datas.clear();
}
}
}
}else{
String jsonDecode = RSAUtils.decryptBASE64StrClient(result);
showLog(result);
showLog(jsonDecode);
if (TextUtils.isEmpty(jsonDecode)) {
showToast(UiUtlis.getString(context, R.string.data_error));
} else {
if (listcode.equals(Contans.LISTCODE.RECEIVEVISIT)) {
ApplyListReceiveBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListReceiveBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
receiveDatas.clear();
receiveDatas.addAll(baseResult.getRows());
@ -127,22 +245,9 @@ public class ApplyListUtils {
receiveDatas.clear();
}
}
}
@Override
public void onError(Call<ApplyListReceiveBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.APPLYCONFERENCE) {
api.getConferenceList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListConferenceBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyListConferenceBean> call, Response<ApplyListConferenceBean> response) {
ApplyListConferenceBean baseResult = response.body();
} else if (listcode.equals(Contans.LISTCODE.APPLYCONFERENCE)) {
ApplyListConferenceBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListConferenceBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
conferenceDatas.clear();
conferenceDatas.addAll(baseResult.getRows());
@ -151,24 +256,9 @@ public class ApplyListUtils {
conferenceDatas.clear();
}
}
}
@Override
public void onError(Call<ApplyListConferenceBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.ORDINARYVISIT) {
api.getOrdinaryVisitList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyOrdinaryVisitBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyOrdinaryVisitBean> call, Response<ApplyOrdinaryVisitBean> response) {
ApplyOrdinaryVisitBean baseResult = response.body();
} else if (listcode.equals(Contans.LISTCODE.ORDINARYVISIT)) {
ApplyOrdinaryVisitBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyOrdinaryVisitBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
ordinaryVisiDatas.clear();
ordinaryVisiDatas.addAll(baseResult.getRows());
@ -177,21 +267,9 @@ public class ApplyListUtils {
conferenceDatas.clear();
}
}
}
@Override
public void onError(Call<ApplyOrdinaryVisitBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.APPLYTRAVEL) {
api.getApplyTraveList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyTravelListBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyTravelListBean> call, Response<ApplyTravelListBean> response) {
ApplyTravelListBean baseResult = response.body();
} else if (listcode.equals(Contans.LISTCODE.APPLYTRAVEL)) {
ApplyTravelListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyTravelListBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
travelListDatas.clear();
travelListDatas.addAll(baseResult.getRows());
@ -200,24 +278,9 @@ public class ApplyListUtils {
travelListDatas.clear();
}
}
}
@Override
public void onError(Call<ApplyTravelListBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.APPLYVEHICLE) {
api.getVehicleList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListVehicleBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyListVehicleBean> call, Response<ApplyListVehicleBean> response) {
ApplyListVehicleBean baseResult = response.body();
} else if (listcode.equals(Contans.LISTCODE.APPLYVEHICLE)) {
ApplyListVehicleBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListVehicleBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
vehicleDatas.clear();
vehicleDatas.addAll(baseResult.getRows());
@ -226,22 +289,9 @@ public class ApplyListUtils {
vehicleDatas.clear();
}
}
}
@Override
public void onError(Call<ApplyListVehicleBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.OTHERTASK) {
api.getOtherTaskList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListOtherTaskBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyListOtherTaskBean> call, Response<ApplyListOtherTaskBean> response) {
ApplyListOtherTaskBean baseResult = response.body();
} else if (listcode.equals(Contans.LISTCODE.OTHERTASK)) {
ApplyListOtherTaskBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListOtherTaskBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
otherTaskDatas.clear();
otherTaskDatas.addAll(baseResult.getRows());
@ -250,22 +300,9 @@ public class ApplyListUtils {
otherTaskDatas.clear();
}
}
}
@Override
public void onError(Call<ApplyListOtherTaskBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.APPLYORDER) {
api.getTakeOutList2(listcode, "0", manid,"", departmentnameid,"").enqueue(new BaseCallBack<ApplyListTakeOutBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyListTakeOutBean> call, Response<ApplyListTakeOutBean> response) {
ApplyListTakeOutBean baseResult = response.body();
} else if (listcode.equals(Contans.LISTCODE.APPLYORDER)) {
ApplyListTakeOutBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListTakeOutBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
takeOutDatas.clear();
takeOutDatas.addAll(baseResult.getRows());
@ -274,50 +311,9 @@ public class ApplyListUtils {
takeOutDatas.clear();
}
}
}
@Override
public void onError(Call<ApplyListTakeOutBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.APPLYDINNER) {
api.getApplyList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
ApplyListBean baseResult = response.body();
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
datas.clear();
datas.addAll(baseResult.getRows());
setListAdapter(listcode);
} else {
datas.clear();
}
}
}
@Override
public void onError(Call<ApplyListBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.APPLYSUPPLIES) {
api.getApplyList2(listcode, proposerid, times, timee).enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
ApplyListBean baseResult = response.body();
} else if (listcode.equals(Contans.LISTCODE.APPLYDINNER)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
datas.clear();
datas.addAll(baseResult.getRows());
@ -326,24 +322,9 @@ public class ApplyListUtils {
datas.clear();
}
}
}
@Override
public void onError(Call<ApplyListBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.APPLYFACILITIES) {
api.getApplyList2(listcode, proposerid, times, timee).enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
ApplyListBean baseResult = response.body();
} else if (listcode.equals(Contans.LISTCODE.APPLYSUPPLIES)) {
ApplyListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
datas.clear();
datas.addAll(baseResult.getRows());
@ -352,24 +333,9 @@ public class ApplyListUtils {
datas.clear();
}
}
}
@Override
public void onError(Call<ApplyListBean> call, Throwable t) {
}
});
} else if (listcode == Contans.LISTCODE.APPLYSUGGESTION) {
api.getMyAdvice(listcode,manid, proposerid).enqueue(new BaseCallBack<MyadviceBean>(builder.context) {
@Override
public void onSuccess(Call<MyadviceBean> call, Response<MyadviceBean> response) {
MyadviceBean myadviceBean = response.body();
} else if (listcode.equals(Contans.LISTCODE.APPLYSUGGESTION)) {
MyadviceBean myadviceBean = GsonUtils.GsonToBean(jsonDecode,MyadviceBean.class);
if (myadviceBean != null) {
myadviceBean.getTotal();
if (!myadviceBean.getTotal().equals("0")) {
myadviceDatas.clear();
myadviceDatas.addAll(myadviceBean.getRows());
@ -377,28 +343,11 @@ public class ApplyListUtils {
} else {
myadviceDatas.clear();
}
}
}
@Override
public void onError(Call<MyadviceBean> call, Throwable t) {
}
});
} else {
//没有就是else里面
api.getApplyList(listcode, proposerid,manid, times, timee).enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
@Override
public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
ApplyListBean baseResult = response.body();
ApplyListBean baseResult = GsonUtils.GsonToBean(jsonDecode,ApplyListBean.class);
if (baseResult != null) {
baseResult.getTotal();
if (!baseResult.getTotal().equals("0")) {
datas.clear();
datas.addAll(baseResult.getRows());
@ -408,13 +357,330 @@ public class ApplyListUtils {
}
}
}
}
}
}
@Override
public void onError(Call<ApplyListBean> call, Throwable t) {
public void onFailed(int what, com.yolanda.nohttp.rest.Response<String> response) {
}
});
}
// if (listcode == Contans.LISTCODE.RECEIVEVISIT) {
//
// api.getReceiveList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListReceiveBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListReceiveBean> call, Response<ApplyListReceiveBean> response) {
// ApplyListReceiveBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// receiveDatas.clear();
// receiveDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// receiveDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListReceiveBean> call, Throwable t) {
//
// }
// });
//
// } else if (listcode == Contans.LISTCODE.APPLYCONFERENCE) {
//
// api.getConferenceList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListConferenceBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListConferenceBean> call, Response<ApplyListConferenceBean> response) {
// ApplyListConferenceBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// conferenceDatas.clear();
// conferenceDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// conferenceDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListConferenceBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.ORDINARYVISIT) {
//
// api.getOrdinaryVisitList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyOrdinaryVisitBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyOrdinaryVisitBean> call, Response<ApplyOrdinaryVisitBean> response) {
//
// ApplyOrdinaryVisitBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// ordinaryVisiDatas.clear();
// ordinaryVisiDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// conferenceDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyOrdinaryVisitBean> call, Throwable t) {
//
// }
// });
// } else if (listcode == Contans.LISTCODE.APPLYTRAVEL) {
//
// api.getApplyTraveList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyTravelListBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyTravelListBean> call, Response<ApplyTravelListBean> response) {
// ApplyTravelListBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// travelListDatas.clear();
// travelListDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// travelListDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyTravelListBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.APPLYVEHICLE) {
//
// api.getVehicleList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListVehicleBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListVehicleBean> call, Response<ApplyListVehicleBean> response) {
//
// ApplyListVehicleBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// vehicleDatas.clear();
// vehicleDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// vehicleDatas.clear();
// }
// }
//
// }
//
// @Override
// public void onError(Call<ApplyListVehicleBean> call, Throwable t) {
//
// }
// });
//
// } else if (listcode == Contans.LISTCODE.OTHERTASK) {
// api.getOtherTaskList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListOtherTaskBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListOtherTaskBean> call, Response<ApplyListOtherTaskBean> response) {
// ApplyListOtherTaskBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// otherTaskDatas.clear();
// otherTaskDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// otherTaskDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListOtherTaskBean> call, Throwable t) {
//
// }
// });
//
// } else if (listcode == Contans.LISTCODE.APPLYORDER) {
//
// api.getTakeOutList2(listcode, "0", manid,"", departmentnameid,"").enqueue(new BaseCallBack<ApplyListTakeOutBean>(builder.context) {
// @Override
// public void onSuccess(Call<ApplyListTakeOutBean> call, Response<ApplyListTakeOutBean> response) {
// ApplyListTakeOutBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// takeOutDatas.clear();
// takeOutDatas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// takeOutDatas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListTakeOutBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.APPLYDINNER) {
//
// api.getApplyList(listcode, proposerid,manid, departmentnameid, "0").enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
//
// @Override
// public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
// ApplyListBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// datas.clear();
// datas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// datas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.APPLYSUPPLIES) {
//
// api.getApplyList2(listcode, proposerid, times, timee).enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
//
// @Override
// public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
// ApplyListBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// datas.clear();
// datas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// datas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListBean> call, Throwable t) {
//
// }
// });
//
//
// } else if (listcode == Contans.LISTCODE.APPLYSUGGESTION) {
//
//// api.getMyAdvice(listcode,manid, proposerid).enqueue(new BaseCallBack<MyadviceBean>(builder.context) {
//// @Override
//// public void onSuccess(Call<MyadviceBean> call, Response<MyadviceBean> response) {
////
//// MyadviceBean myadviceBean = response.body();
//// if (myadviceBean != null) {
//// myadviceBean.getTotal();
//// if (!myadviceBean.getTotal().equals("0")) {
//// myadviceDatas.clear();
//// myadviceDatas.addAll(myadviceBean.getRows());
//// setListAdapter(listcode);
//// } else {
//// myadviceDatas.clear();
//// }
////
//// }
////
////
//// }
////
//// @Override
//// public void onError(Call<MyadviceBean> call, Throwable t) {
////
//// }
//// });
//
// api.getMyAdviceRsa(listcode,manid, proposerid).enqueue(new BaseCallBack<String>(builder.context) {
// @Override
// public void onSuccess(Call<String> call, Response<String> response) {
//
// String result = response.body();
// showLog("-----getMyAdviceRsa----");
// showLog(result);
//
// String jsonDecode = RSAUtils.decryptBASE64StrClient(result);
// showLog(jsonDecode);
// if (TextUtils.isEmpty(jsonDecode)) {
// showToast(UiUtlis.getString(context, R.string.data_error));
// } else {
// showToast(jsonDecode);
// MyadviceBean myadviceBean = GsonUtils.GsonToBean(jsonDecode,MyadviceBean.class);
// if (myadviceBean != null) {
// myadviceBean.getTotal();
// if (!myadviceBean.getTotal().equals("0")) {
// myadviceDatas.clear();
// myadviceDatas.addAll(myadviceBean.getRows());
// setListAdapter(listcode);
// } else {
// myadviceDatas.clear();
// }
// }
// }
// }
//
// @Override
// public void onError(Call<String> call, Throwable t) {
//
// }
// });
//
//
// } else {
// //没有就是else里面
// api.getApplyList(listcode, proposerid,manid, times, timee).enqueue(new BaseCallBack<ApplyListBean>(builder.context) {
//
// @Override
// public void onSuccess(Call<ApplyListBean> call, Response<ApplyListBean> response) {
// ApplyListBean baseResult = response.body();
// if (baseResult != null) {
// baseResult.getTotal();
// if (!baseResult.getTotal().equals("0")) {
// datas.clear();
// datas.addAll(baseResult.getRows());
// setListAdapter(listcode);
// } else {
// datas.clear();
// }
// }
// }
//
// @Override
// public void onError(Call<ApplyListBean> call, Throwable t) {
//
// }
// });
// }
}
/**
@ -659,7 +925,7 @@ public class ApplyListUtils {
return builder;
}
public ApplyListUtils builder(Context context) {
public ApplyListUtils builder(Activity context) {
this.context = context;
valida();
return new ApplyListUtils(context);
@ -691,4 +957,34 @@ public class ApplyListUtils {
public interface OnItemClickListener {
void onItemClick(Object object);
}
public void showLog(String logText) {
if (isApkInDebug(context)) {
if(TextUtils.isEmpty(logText)){
Log.i("app", "logText is null");
}else{
Log.i("app", logText);
}
}
}
/**
* debug
*/
public static boolean isApkInDebug(Context context) {
try {
ApplicationInfo info = context.getApplicationInfo();
return (info.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0;
} catch (Exception e) {
return false;
}
}
public void showToast(String msg) {
Toast.makeText(context, msg, Toast.LENGTH_SHORT).show();
}
public void showToast(int strId) {
Toast.makeText(context, strId, Toast.LENGTH_SHORT).show();
}
}

@ -84,8 +84,8 @@ public class NohttpUtils {
String credential = "Bearer " + token;
request.addHeader("Authorization", credential);
showLog(request.url(),mActivity);
showLog(credential,mActivity);
showLog(new Gson().toJson(request.headers()),mActivity);
// showLog(credential,mActivity);
// showLog(new Gson().toJson(request.headers()),mActivity);
}
if(!TextUtils.isEmpty(request.url())){
String url =request.url();

Loading…
Cancel
Save