2.4.3 release 1.管理-移除来访管理、办公领用、工作任务、日程查看。2.移除通讯录。3.我的-移除我的待办(其它系统)、APP建议。

master
wenfei 3 months ago
parent 4b071d6ca2
commit de287a699e

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

@ -81,6 +81,7 @@
tools:ignore="GoogleAppIndexingWarning" tools:ignore="GoogleAppIndexingWarning"
tools:replace="android:allowBackup" tools:replace="android:allowBackup"
tools:targetApi="s"> tools:targetApi="s">
<activity <activity
android:name=".ui.activity.AuthSuccessActivity" android:name=".ui.activity.AuthSuccessActivity"
android:exported="false" /> android:exported="false" />
@ -1205,7 +1206,10 @@
android:name=".ui.activity.StatisticsTableActivity" android:name=".ui.activity.StatisticsTableActivity"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden" /> android:windowSoftInputMode="adjustResize|stateHidden" />
<activity
android:name=".ui.activity.WeatherActivity"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize|stateHidden" /> <!-- 作业风险清单 -->
<service <service
android:name=".service.PushService" android:name=".service.PushService"
android:exported="false" /> android:exported="false" />

@ -165,16 +165,15 @@ public class App extends LitePalApplication {
* *
* dpsppx * dpsppx
*/ */
// if (isApkInDebug(base)) { if (isApkInDebug(base)) {
// showLog("attachBaseContext base");
// initSdk(base);
// GlobalListenerManager.getInstance().init(base);
// DpPxSpTransformUtil.init(getResources().getDisplayMetrics().density);
// }
initSdk(base); initSdk(base);
GlobalListenerManager.getInstance().init(base); GlobalListenerManager.getInstance().init(base);
DpPxSpTransformUtil.init(getResources().getDisplayMetrics().density); DpPxSpTransformUtil.init(getResources().getDisplayMetrics().density);
} }
// initSdk(base);
// GlobalListenerManager.getInstance().init(base);
// DpPxSpTransformUtil.init(getResources().getDisplayMetrics().density);
}
public void clearUser() { public void clearUser() {
this.userInfo = null; this.userInfo = null;

@ -119,21 +119,21 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
Contans.BASE_URL_AI_3D_SERVER_INTRANET //AI三维可视化安防平台登录 电厂外网 Contans.BASE_URL_AI_3D_SERVER_INTRANET //AI三维可视化安防平台登录 电厂外网
} }
} else { } else {
// binding.rg.check(R.id.rb2) binding.rg.check(R.id.rb2)
// SPUtils.put(this, Contans.NETWORK_CHECK_TYPE, "外网") SPUtils.put(this, Contans.NETWORK_CHECK_TYPE, "外网")
// Contans.IP = Contans.IP_EXTRANET //运行IP外网 Contans.IP = Contans.IP_EXTRANET //运行IP外网
// Contans.BASE_URL = Contans.BASE_URL_EXTRANET //行政IP外网 Contans.BASE_URL = Contans.BASE_URL_EXTRANET //行政IP外网
// Contans.BASE_URL_COMPANY_SERVER =
// Contans.BASE_URL_COMPANY_SERVER_EXTRANET //智慧安防平台登录 电厂外网
// Contans.BASE_URL_AI_3D_SERVER =
// Contans.BASE_URL_AI_3D_SERVER_EXTRANET //AI三维可视化安防平台登录 电厂外网
binding.rg.check(R.id.rb3)
Contans.IP = Contans.IP_INTRANET //运行IP内网
Contans.BASE_URL = Contans.BASE_URL_INTRANET //行政IP内网
Contans.BASE_URL_COMPANY_SERVER = Contans.BASE_URL_COMPANY_SERVER =
Contans.BASE_URL_COMPANY_SERVER_INTRANET //智慧安防平台登录 电厂内 Contans.BASE_URL_COMPANY_SERVER_EXTRANET //智慧安防平台登录 电厂外网
Contans.BASE_URL_AI_3D_SERVER = Contans.BASE_URL_AI_3D_SERVER =
Contans.BASE_URL_AI_3D_SERVER_INTRANET //AI三维可视化安防平台登录 电厂外网 Contans.BASE_URL_AI_3D_SERVER_EXTRANET //AI三维可视化安防平台登录 电厂外网
// binding.rg.check(R.id.rb3)
// Contans.IP = Contans.IP_INTRANET //运行IP内网
// Contans.BASE_URL = Contans.BASE_URL_INTRANET //行政IP内网
// Contans.BASE_URL_COMPANY_SERVER =
// Contans.BASE_URL_COMPANY_SERVER_INTRANET //智慧安防平台登录 电厂内网
// Contans.BASE_URL_AI_3D_SERVER =
// Contans.BASE_URL_AI_3D_SERVER_INTRANET //AI三维可视化安防平台登录 电厂外网
} }
binding.rg.setOnCheckedChangeListener(RadioGroup.OnCheckedChangeListener { _, checkedId -> binding.rg.setOnCheckedChangeListener(RadioGroup.OnCheckedChangeListener { _, checkedId ->
@ -198,6 +198,15 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
SFUemSDK.getInstance().logout() SFUemSDK.getInstance().logout()
showToast(R.string.str_vpn_logout) showToast(R.string.str_vpn_logout)
} }
if (isApkInDebug(this)) {
binding.tvVpnLogin.visibility=View.INVISIBLE
binding.tvVpnLogout.visibility=View.VISIBLE
binding.rb3.visibility=View.VISIBLE
}else{
binding.tvVpnLogin.visibility=View.GONE
binding.tvVpnLogout.visibility=View.GONE
binding.rb3.visibility=View.GONE
}
} }
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")
@ -219,8 +228,8 @@ class LoginActivity : BaseActivityOaToolbarViewBinding<ActivityLoginBinding>() {
if (isApkInDebug(context)) { if (isApkInDebug(context)) {
// 管理员 // 管理员
binding.etUsername.setText("ZHPS_Admin") // binding.etUsername.setText("ZHPS_Admin")
binding.etPassword.setText("Rehome.zhps@996") // binding.etPassword.setText("Rehome.zhps@996")
//公司内网215管理员 //公司内网215管理员

@ -66,7 +66,7 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
private var mqttPublishServer: MqttSSLPublishServer? = null private var mqttPublishServer: MqttSSLPublishServer? = null
private var isInitTbs: Boolean = false private var isInitTbs: Boolean = false
private lateinit var contactFragment:ContactFragment //private lateinit var contactFragment:ContactFragment
//定时器 //定时器
private var timer: Timer? = null private var timer: Timer? = null
//定时器 //定时器
@ -106,11 +106,11 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
badgeView_me.setBadgeMargin(0, 2, 10, 0) //设置边距 badgeView_me.setBadgeMargin(0, 2, 10, 0) //设置边距
badgeView_me.textSize = 16f badgeView_me.textSize = 16f
contactFragment = ContactFragment() //contactFragment = ContactFragment()
fragments.add(HomeFragment()) fragments.add(HomeFragment())
fragments.add(YunXingFragment()) fragments.add(YunXingFragment())
fragments.add(contactFragment) //fragments.add(contactFragment)
fragments.add(MineFragment.getInstance()) fragments.add(MineFragment.getInstance())
adapter = object : FragmentPagerAdapter(supportFragmentManager) { adapter = object : FragmentPagerAdapter(supportFragmentManager) {
@ -154,29 +154,36 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
} }
2 -> { 2 -> {
setToolbarTitle("通讯录")
binding.vp.setCurrentItem(2, false)
binding.rbContact.setTextColor(Color.parseColor("#0099ff"))
binding.rbContact.isChecked = true
binding.toolbarView.topLl.visibility = View.VISIBLE
if(contactFragment.datas.size==0){
if (contactFragment.isAdded && contactFragment.isVisible) {
// Fragment存在且可见可以安全访问
contactFragment.getData()
} else {
// Fragment不可用或不可见
}
}
}
3 -> {
MineFragment.getInstance().getAboutMeData() MineFragment.getInstance().getAboutMeData()
setToolbarTitle("") setToolbarTitle("")
binding.vp.setCurrentItem(3, false) binding.vp.setCurrentItem(2, false)
binding.toolbarView.topLl.visibility = View.GONE binding.toolbarView.topLl.visibility = View.GONE
binding.rbMine.setTextColor(Color.parseColor("#0099ff")) binding.rbMine.setTextColor(Color.parseColor("#0099ff"))
binding.rbMine.isChecked = true binding.rbMine.isChecked = true
// setToolbarTitle("通讯录")
// binding.vp.setCurrentItem(2, false)
// binding.rbContact.setTextColor(Color.parseColor("#0099ff"))
// binding.rbContact.isChecked = true
// binding.toolbarView.topLl.visibility = View.VISIBLE
// if(contactFragment.datas.size==0){
// if (contactFragment.isAdded && contactFragment.isVisible) {
// // Fragment存在且可见可以安全访问
// contactFragment.getData()
// } else {
// // Fragment不可用或不可见
// }
// }
} }
// 3 -> {
// MineFragment.getInstance().getAboutMeData()
// setToolbarTitle("")
// binding.vp.setCurrentItem(3, false)
// binding.toolbarView.topLl.visibility = View.GONE
// binding.rbMine.setTextColor(Color.parseColor("#0099ff"))
// binding.rbMine.isChecked = true
// }
} }
} }
@ -197,14 +204,16 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
binding.vp.setCurrentItem(1, false) binding.vp.setCurrentItem(1, false)
binding.rbYunxing.setTextColor(Color.parseColor("#0099ff")) binding.rbYunxing.setTextColor(Color.parseColor("#0099ff"))
binding.toolbarView.topLl.visibility = View.GONE binding.toolbarView.topLl.visibility = View.GONE
} else if (i == R.id.rb_contact) { }
setToolbarTitle("通讯录") // else if (i == R.id.rb_contact) {
binding.vp.setCurrentItem(2, false) // setToolbarTitle("通讯录")
binding.rbContact.setTextColor(Color.parseColor("#0099ff")) // binding.vp.setCurrentItem(2, false)
binding.toolbarView.topLl.visibility = View.VISIBLE // binding.rbContact.setTextColor(Color.parseColor("#0099ff"))
} else if (i == R.id.rb_mine) { // binding.toolbarView.topLl.visibility = View.VISIBLE
// }
else if (i == R.id.rb_mine) {
setToolbarTitle("") setToolbarTitle("")
binding.vp.setCurrentItem(3, false) binding.vp.setCurrentItem(2, false)
binding.rbMine.setTextColor(Color.parseColor("#0099ff")) binding.rbMine.setTextColor(Color.parseColor("#0099ff"))
binding.toolbarView.topLl.visibility = View.GONE binding.toolbarView.topLl.visibility = View.GONE
} }
@ -279,7 +288,7 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
private fun initTextColor() { private fun initTextColor() {
binding.rbHome.setTextColor(Color.parseColor("#abadbb")) binding.rbHome.setTextColor(Color.parseColor("#abadbb"))
binding.rbYunxing.setTextColor(Color.parseColor("#abadbb")) binding.rbYunxing.setTextColor(Color.parseColor("#abadbb"))
binding.rbContact.setTextColor(Color.parseColor("#abadbb")) //binding.rbContact.setTextColor(Color.parseColor("#abadbb"))
binding.rbMine.setTextColor(Color.parseColor("#abadbb")) binding.rbMine.setTextColor(Color.parseColor("#abadbb"))
} }
@ -305,6 +314,7 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
e.printStackTrace() e.printStackTrace()
} }
} }
if (isApkInDebug(context)) {
if (timerVpn == null) { if (timerVpn == null) {
try { try {
timerVpn = Timer() timerVpn = Timer()
@ -322,6 +332,7 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
} }
} }
} }
}
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
@ -332,10 +343,12 @@ class MainActivity : BaseActivityOaToolbarViewBinding<ActivityMainBinding>() {
if (timer != null) { if (timer != null) {
timer!!.cancel() timer!!.cancel()
} }
if (isApkInDebug(context)) {
if (timerVpn != null) { if (timerVpn != null) {
timerVpn!!.cancel() timerVpn!!.cancel()
} }
} }
}
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean { override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {
if (keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_DOWN) { if (keyCode == KeyEvent.KEYCODE_BACK && event.action == KeyEvent.ACTION_DOWN) {

@ -0,0 +1,373 @@
package com.rehome.zhdcoa.ui.activity
import android.content.Intent
import android.text.TextUtils
import android.view.View
import android.widget.TextView
import androidx.activity.result.ActivityResultLauncher
import androidx.activity.result.contract.ActivityResultContracts
import com.rehome.zhdcoa.Contans
import com.rehome.zhdcoa.R
import com.rehome.zhdcoa.adapter.WorkRiskLevelListAdapter
import com.rehome.zhdcoa.base.BaseActivityOaToolbarTwoViewBinding
import com.rehome.zhdcoa.base.BaseActivityOaToolbarViewBinding
import com.rehome.zhdcoa.bean.WorkRiskLevelListBean
import com.rehome.zhdcoa.completionUtil.ReplaceSpan
import com.rehome.zhdcoa.completionUtil.ReplaceSpan.OnClickListener
import com.rehome.zhdcoa.databinding.ActivityWorkRiskListBinding
import com.rehome.zhdcoa.utils.AuthenticationLoginAIUtils
import com.rehome.zhdcoa.utils.GsonUtils
import com.rehome.zhdcoa.utils.HttpListener
import com.rehome.zhdcoa.utils.NohttpUtils
import com.rehome.zhdcoa.utils.RSAAndroid
import com.yolanda.nohttp.NoHttp
import com.yolanda.nohttp.RequestMethod
import com.yolanda.nohttp.rest.Response
import java.text.SimpleDateFormat
import java.util.Calendar
import javax.net.ssl.HostnameVerifier
/**
* Create By HuangWenFei
* 创建日期2025-09-18 15:19
* 描述气象数据 实时概况
*/
class WeatherActivity : BaseActivityOaToolbarViewBinding<ActivityWorkRiskListBinding>() {
private lateinit var headView: View
private var datas: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private lateinit var mAdapter: WorkRiskLevelListAdapter
private var selectList: MutableList<Int> = mutableListOf()
private var jobNoList: MutableList<String> = mutableListOf()
private var selectListAssistant: MutableList<Int> = mutableListOf()
private var jobNoListAssistant: MutableList<String> = mutableListOf()
private var selectListCustom: MutableList<Int> = mutableListOf()
private var jobNoListCustom: MutableList<String> = mutableListOf()
private var dataA: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private var dataB: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private var dataC1: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private var dataC2: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private var dataC3: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private var dataLowRisk: MutableList<WorkRiskLevelListBean.RowsBean> = mutableListOf()
private var isNetworkNormal = false
private lateinit var launcherResultQRCode: ActivityResultLauncher<Intent>
override fun getViewBinding() = ActivityWorkRiskListBinding.inflate(layoutInflater)
override fun getToolbar() = binding.toolbarView.toolbar
override fun initView() {
initToolbar("气象数据实时概况", "",{
})
launcherResultQRCode = createQRCodeActivityResultLauncher()
binding.lv.emptyView = binding.tvNodata
headView = View.inflate(this, R.layout.item_work_risk_list, null)
mAdapter = WorkRiskLevelListAdapter(this,datas,
{ position ->
val item = datas[position]
if(item.hazardList!=null&&item.hazardList.size>0){
//进入风险提示页面
val intent = Intent(context, WorkRiskListTipActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
intent.putExtra("hazardList", GsonUtils.GsonString(item.hazardList))
startActivity(intent)
}
},
{ position ->
val item = datas[position]
if(item.hazardList!=null&&item.hazardList.size>0){
//进入修改风险等级
val intent = Intent(context, CustomDialogChangeLevelActivity::class.java)
intent.putExtra("id",item.id)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
intent.putExtra("level", item.level)
intent.putExtra("type", item.type)
launcherResultQRCode.launch(intent)
}
},
{ position ->
val item = datas[position]
showLog("---------")
showLog(GsonUtils.GsonString(item))
//工作情况汇报
val intent = Intent(context, WorkRiskListHuiBaoActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
intent.putExtra("level",item.level)
intent.putExtra("type",item.type)
intent.putExtra("id",item.id)
startActivity(intent)
}
)
//binding.lv.addHeaderView(headView, null, false)
binding.lv.adapter = mAdapter
binding.llRefresh.setOnClickListener { authenticationLoginAI() }
binding.llWorkTicket.setOnClickListener {
if(isNetworkNormal){
//进入风险提示页面 WorkTickerSelectListActivity
val intent = Intent(context, WorkTickerSelectListActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
intent.putExtra("selectList", GsonUtils.GsonString(selectList))
intent.putExtra("jobNoList", GsonUtils.GsonString(jobNoList))
startActivity(intent)
}else{
//WorkTickerAssistantSelectListActivity
showToast("列表数据加载失败,请检查网络环境或重新加载列表数据")
}
}
binding.llAssiting.setOnClickListener {
if(isNetworkNormal){
//进入风险提示页面 WorkTickerAssistantSelectListActivity
val intent = Intent(context, WorkTickerAssistantSelectListActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
intent.putExtra("selectList", GsonUtils.GsonString(selectListAssistant))
intent.putExtra("jobNoList", GsonUtils.GsonString(jobNoListAssistant))
startActivity(intent)
}else{
showToast("列表数据加载失败,请检查网络环境或重新加载列表数据")
}
}
binding.llCustomAdd.setOnClickListener {
if(isNetworkNormal){
//进入风险提示页面 WorkTickerAssistantSelectListActivity
val intent = Intent(context, WorkTickerCustomListActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
intent.putExtra("selectList", GsonUtils.GsonString(selectListCustom))
intent.putExtra("jobNoList", GsonUtils.GsonString(jobNoListCustom))
startActivity(intent)
}else{
showToast("列表数据加载失败,请检查网络环境或重新加载列表数据")
}
}
//格式化日期的对象(转化成习惯的时间格式)
val sdFormat = SimpleDateFormat("yyyy.MM.dd")
//静态方法getInstance()使用默认时区和语言环境获得一个日历。
val calendar = Calendar.getInstance()
//输出当前系统时间;
binding.tvTime.text = sdFormat.format(calendar.time)
bindViewClick()
}
override fun initData() {
authenticationLoginAI()
}
override fun onRestart() {
super.onRestart()
authenticationLoginAI()
}
//创建一个ActivityResultLauncher
private fun createQRCodeActivityResultLauncher(): ActivityResultLauncher<Intent> {
//kotlin写法
return registerForActivityResult(ActivityResultContracts.StartActivityForResult()) {
val data = it.data
val resultCode = it.resultCode
if (resultCode == RESULT_OK) {
if (data != null) {
val qrCodeStr = data.getStringExtra("code") ?: ""
showLog(qrCodeStr)
if(!TextUtils.isEmpty(qrCodeStr)){
//刷新列表数据
authenticationLoginAI()
}
}
}
}
}
private fun authenticationLoginAI() {
try {
//AI三维登录接口
val userName = Contans.SP.AI_ACCOUNT
//String strPrivateEncode=RSAAndroid.encryptByPrivateKeyForSpiltStr(Contans.SP.AI_PWD,RSAAndroid.privateRsaKeyLocal);
val strPublicDecode = RSAAndroid.decryptByPublicKeyForSpiltStr(
Contans.SP.AI_PWD_ENCODE,
RSAAndroid.publicRsaKeyLocal
)
AuthenticationLoginAIUtils.authenticationAILoginShowProgress(
this, userName, strPublicDecode
) { _, token ->
if (token != null && token == "") {
showToast("AI三维平台登录失败")
isNetworkNormal = false
} else {
getWorkRiskListData()
}
}
} catch (e: Exception) {
e.printStackTrace()
}
}
private fun getWorkRiskListData() {
val request = NoHttp.createStringRequest(
Contans.BASE_URL_AI_3D_SERVER + Contans.DAYLY_RISK_LIST_NEW,
RequestMethod.GET
)
request.add("filter",true);
if (Contans.BASE_URL_AI_3D_SERVER == Contans.BASE_URL_AI_3D_SERVER_EXTRANET) {
val socketFactory = NohttpUtils.getSSLSocketFactory(context)
if (socketFactory != null) {
request.sslSocketFactory = socketFactory
request.hostnameVerifier = HostnameVerifier { _, _ -> true }
}
}
NohttpUtils.getInstance().add(this, 0, request, object : HttpListener<String?> {
override fun onSucceed(what: Int, response: Response<String?>?) {
val result = response?.get()
showLog("----------------")
showLog(result)
val bean = GsonUtils.GsonToBean(
result,
WorkRiskLevelListBean::class.java
)
if (bean != null && bean.data != null) {
isNetworkNormal = true
val workRiskLevelLists = bean.data
if (workRiskLevelLists != null && workRiskLevelLists.size > 0) {
binding.tvNodata.visibility = View.GONE
headView.visibility = View.VISIBLE
datas.clear()
datas.addAll(workRiskLevelLists)
mAdapter.notifyDataSetChanged()
dataA.clear()
dataB.clear()
dataC1.clear()
dataC2.clear()
dataC3.clear()
dataLowRisk.clear()
selectList.clear()
jobNoList.clear()
selectListAssistant.clear()
jobNoListAssistant.clear()
selectListCustom.clear()
jobNoListCustom.clear()
for(item in datas){
if("ticket" == item.type){
selectList.add(item.id)
jobNoList.add(item.jobNo)
}
if("assisting" == item.type){
selectListAssistant.add(item.id)
jobNoListAssistant.add(item.jobNo)
}
if("custom" == item.type){
selectListCustom.add(item.id)
jobNoListCustom.add(item.jobNo)
}
showLog(GsonUtils.GsonString(item))
if(item.level!=null&&item.level=="A"){
dataA.add(item)
}
if(item.level!=null&&item.level=="B"){
dataB.add(item)
}
if(item.level!=null&&item.level=="C1"){
dataC1.add(item)
}
if(item.level!=null&&item.level=="C2"){
dataC2.add(item)
}
if(item.level!=null&&item.level=="C3"){
dataC3.add(item)
}
if(item.level!=null&&item.level=="低风险"){
dataLowRisk.add(item)
}
}
binding.tvA.text = dataA.size.toString()
binding.tvB.text = dataB.size.toString()
binding.tvC1.text = dataC1.size.toString()
binding.tvC2.text = dataC2.size.toString()
binding.tvC3.text = dataC3.size.toString()
binding.tvLowLisk.text = dataLowRisk.size.toString()
} else {
binding.tvNodata.visibility = View.VISIBLE
}
}else{
isNetworkNormal = false
}
}
override fun onFailed(what: Int, response: Response<String?>?) {
isNetworkNormal = false
}
})
}
private fun bindViewClick() {
binding.tvA.setOnClickListener {
datas.clear()
datas.addAll(dataA)
mAdapter.notifyDataSetChanged()
}
binding.tvB.setOnClickListener {
datas.clear()
datas.addAll(dataB)
mAdapter.notifyDataSetChanged()
}
binding.tvC1.setOnClickListener {
datas.clear()
datas.addAll(dataC1)
mAdapter.notifyDataSetChanged()
}
binding.tvC2.setOnClickListener {
datas.clear()
datas.addAll(dataC2)
mAdapter.notifyDataSetChanged()
}
binding.tvC3.setOnClickListener {
datas.clear()
datas.addAll(dataC3)
mAdapter.notifyDataSetChanged()
}
binding.tvLowLisk.setOnClickListener {
datas.clear()
datas.addAll(dataLowRisk)
mAdapter.notifyDataSetChanged()
}
binding.tvReport.setOnClickListener {
val intent = Intent(context, WorkRiskListReportActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
startActivity(intent)
}
}
private fun toWorkRiskListHuiBaoActivity(type:String){
//工作情况汇报
val intent = Intent(context, WorkRiskListHuiBaoActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
intent.putExtra("type",type)
startActivity(intent)
}
}

@ -92,6 +92,7 @@ import retrofit2.Response
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.Calendar import java.util.Calendar
import androidx.core.view.isVisible import androidx.core.view.isVisible
import com.rehome.zhdcoa.ui.activity.WeatherActivity
/** /**
@ -196,34 +197,36 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>() {
private fun initLists() { private fun initLists() {
val titles = arrayOf( val titles = arrayOf(
"来访管理", // "来访管理",
"会议管理", "会议管理",
"用餐管理", "用餐管理",
"车辆管理", "车辆管理",
"办公领用", // "办公领用",
"工作任务", // "工作任务",
"日程查看", // "日程查看",
"考勤", "考勤",
"培训", "培训",
"党建", "党建",
"工会培训问卷", "工会培训问卷",
"生产过程监督", "生产过程监督",
"安防" "安防"
//"气象数据"
) )
val imgIds = intArrayOf( val imgIds = intArrayOf(
R.drawable.icon_visit, // R.drawable.icon_visit,
R.drawable.icon_meet, R.drawable.icon_meet,
R.drawable.icon_dinner, R.drawable.icon_dinner,
R.drawable.icon_vehicle, R.drawable.icon_vehicle,
R.drawable.icon_office, // R.drawable.icon_office,
R.drawable.icon_task, // R.drawable.icon_task,
R.drawable.icon_date, // R.drawable.icon_date,
R.drawable.icon_check, R.drawable.icon_check,
R.drawable.icon_px, R.drawable.icon_px,
R.drawable.icon_dj, R.drawable.icon_dj,
R.drawable.gh_icon, R.drawable.gh_icon,
R.drawable.icon_gcjd, R.drawable.icon_gcjd,
R.drawable.icon1 R.drawable.icon1
//R.drawable.real_weather
) )
for (i in titles.indices) { for (i in titles.indices) {
val item = GridItem(titles[i], imgIds[i]) val item = GridItem(titles[i], imgIds[i])
@ -255,26 +258,43 @@ class HomeFragment : BaseViewBindingFragment<FragmentHomeBinding>() {
binding.gv.setAdapter(adapter) binding.gv.setAdapter(adapter)
binding.gv.onItemClickListener = binding.gv.onItemClickListener =
AdapterView.OnItemClickListener { parent: AdapterView<*>?, view: View?, position: Int, id: Long -> AdapterView.OnItemClickListener { parent: AdapterView<*>?, view: View?, position: Int, id: Long ->
if (position == 3) { if (position == 2) {
if (resultList.contains("ApplyVehicle")) { if (resultList.contains("ApplyVehicle")) {
val intent = Intent(getContext(), ApplyVehicleActivity::class.java) val intent = Intent(getContext(), ApplyVehicleActivity::class.java)
startActivity(intent) startActivity(intent)
} }
}else if (position == 9) {
val intent = Intent(getContext(), WeatherActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP or Intent.FLAG_ACTIVITY_SINGLE_TOP)
startActivity(intent)
}else { }else {
var TAG = "" var TAG = ""
// when (position) {
// 0 -> TAG = GridViewDialog.TAG_VISIT
// 1 -> TAG = GridViewDialog.TAG_MEET
// 2 -> TAG = GridViewDialog.TAG_DINNER
// 4 -> TAG = GridViewDialog.TAG_OFFICE
// 5 -> TAG = GridViewDialog.TAG_TASK
// 6 -> TAG = GridViewDialog.TAG_SCHEDULE
// 7 -> TAG = GridViewDialog.TAG_CHECK
// 8 -> TAG = GridViewDialog.TAG_PEIXUN
// 9 -> TAG = GridViewDialog.TAG_PDANGJIAN
// 10 -> TAG = GridViewDialog.TAG_GONGHUI
// 11 -> TAG = GridViewDialog.TAG_JD
// 12 -> TAG = GridViewDialog.TAG_AF
// }
when (position) { when (position) {
0 -> TAG = GridViewDialog.TAG_VISIT 0 -> TAG = GridViewDialog.TAG_MEET
1 -> TAG = GridViewDialog.TAG_MEET 1 -> TAG = GridViewDialog.TAG_DINNER
2 -> TAG = GridViewDialog.TAG_DINNER // 3 -> TAG = GridViewDialog.TAG_OFFICE
4 -> TAG = GridViewDialog.TAG_OFFICE // 4 -> TAG = GridViewDialog.TAG_TASK
5 -> TAG = GridViewDialog.TAG_TASK // 5 -> TAG = GridViewDialog.TAG_SCHEDULE
6 -> TAG = GridViewDialog.TAG_SCHEDULE 3 -> TAG = GridViewDialog.TAG_CHECK
7 -> TAG = GridViewDialog.TAG_CHECK 4 -> TAG = GridViewDialog.TAG_PEIXUN
8 -> TAG = GridViewDialog.TAG_PEIXUN 5 -> TAG = GridViewDialog.TAG_PDANGJIAN
9 -> TAG = GridViewDialog.TAG_PDANGJIAN 6 -> TAG = GridViewDialog.TAG_GONGHUI
10 -> TAG = GridViewDialog.TAG_GONGHUI 7 -> TAG = GridViewDialog.TAG_JD
11 -> TAG = GridViewDialog.TAG_JD 8 -> TAG = GridViewDialog.TAG_AF
12 -> TAG = GridViewDialog.TAG_AF
} }
val dialog = GridViewDialog(context, TAG) val dialog = GridViewDialog(context, TAG)
dialog.show() dialog.show()

@ -357,42 +357,42 @@ public class MineFragment extends BaseLazyFragment {
} }
}); });
//APP建议 //APP建议
tvSuggest.setOnClickListener(new View.OnClickListener() { // tvSuggest.setOnClickListener(new View.OnClickListener() {
@Override // @Override
public void onClick(View v) { // public void onClick(View v) {
List<String> list2 = new ArrayList<>(); // List<String> list2 = new ArrayList<>();
list2.add("我的建议"); // list2.add("我的建议");
list2.add("建议汇总"); // list2.add("建议汇总");
//
ListDialog dialog2 = new ListDialog(requireContext(), list2, (time, position) -> { // ListDialog dialog2 = new ListDialog(requireContext(), list2, (time, position) -> {
//
switch (position) { // switch (position) {
case 0: // case 0:
Intent intent62 = new Intent(getActivity(), MyAdviceActivity.class); // Intent intent62 = new Intent(getActivity(), MyAdviceActivity.class);
intent62.putExtra("result_advice", "1"); // intent62.putExtra("result_advice", "1");
startActivity(intent62); // startActivity(intent62);
break; // break;
case 1: // case 1:
Intent intent21 = new Intent(getActivity(), MyAdviceActivity.class); // Intent intent21 = new Intent(getActivity(), MyAdviceActivity.class);
intent21.putExtra("result_advice", "2"); // intent21.putExtra("result_advice", "2");
startActivity(intent21); // startActivity(intent21);
break; // break;
//
} // }
}); // });
//
dialog2.setTvTitle("请选择"); // dialog2.setTvTitle("请选择");
dialog2.show(); // dialog2.show();
} // }
}); // });
//我的待办(其他系统) //我的待办(其他系统)
tvAllaudit.setOnClickListener(new View.OnClickListener() { // tvAllaudit.setOnClickListener(new View.OnClickListener() {
@Override // @Override
public void onClick(View v) { // public void onClick(View v) {
Intent intent6 = new Intent(getActivity(), OtherCountMeActivity.class); // Intent intent6 = new Intent(getActivity(), OtherCountMeActivity.class);
startActivity(intent6); // startActivity(intent6);
} // }
}); // });
//检查更新 //检查更新
tvSm.setOnClickListener(new View.OnClickListener() { tvSm.setOnClickListener(new View.OnClickListener() {
@Override @Override

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

@ -180,7 +180,6 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textSize="16sp" android:textSize="16sp"
android:checked="true"
android:text="aTrust" /> android:text="aTrust" />
</RadioGroup> </RadioGroup>

@ -63,20 +63,20 @@
android:textColor="@color/textColor" android:textColor="@color/textColor"
android:textSize="25px" /> android:textSize="25px" />
<RadioButton <!-- <RadioButton-->
android:id="@+id/rb_contact" <!-- android:id="@+id/rb_contact"-->
android:layout_width="match_parent" <!-- android:layout_width="match_parent"-->
android:layout_height="match_parent" <!-- android:layout_height="match_parent"-->
android:layout_gravity="center" <!-- android:layout_gravity="center"-->
android:layout_margin="5px" <!-- android:layout_margin="5px"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:background="#ffffff" <!-- android:background="#ffffff"-->
android:button="@null" <!-- android:button="@null"-->
android:drawableTop="@drawable/contacts" <!-- android:drawableTop="@drawable/contacts"-->
android:gravity="center" <!-- android:gravity="center"-->
android:text="通讯录" <!-- android:text="通讯录"-->
android:textColor="@color/textColor" <!-- android:textColor="@color/textColor"-->
android:textSize="25px" /> <!-- android:textSize="25px" />-->
<RadioButton <RadioButton
android:id="@+id/rb_mine" android:id="@+id/rb_mine"
@ -99,9 +99,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="100px" android:layout_height="100px"
android:background="#00000000" android:background="#00000000"
android:orientation="horizontal" android:orientation="horizontal">
>
<Button <Button
android:layout_width="0dp" android:layout_width="0dp"
@ -118,12 +116,12 @@
android:clickable="false" android:clickable="false"
android:visibility="invisible" /> android:visibility="invisible" />
<Button <!-- <Button-->
android:layout_width="0dp" <!-- android:layout_width="0dp"-->
android:layout_height="fill_parent" <!-- android:layout_height="fill_parent"-->
android:layout_weight="1" <!-- android:layout_weight="1"-->
android:clickable="false" <!-- android:clickable="false"-->
android:visibility="invisible" /> <!-- android:visibility="invisible" />-->
<Button <Button
android:id="@+id/mine_button" android:id="@+id/mine_button"

@ -0,0 +1,404 @@
<?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:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".ui.activity.WeatherActivity">
<include
android:id="@+id/toolbarView"
layout="@layout/layout_base" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="horizontal">
<LinearLayout
android:id="@+id/ll_workTicket"
android:layout_width="0dp"
android:layout_height="40dp"
android:background="#cccccc"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_workTicket"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/colorPrimary"
android:gravity="center"
android:paddingEnd="20dp"
android:textSize="16sp"
android:text="工作票"/>
</LinearLayout>
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="#aaaaaa" />
<LinearLayout
android:id="@+id/ll_assiting"
android:layout_width="0dp"
android:layout_height="40dp"
android:background="#cccccc"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_assiting"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/colorPrimary"
android:gravity="center"
android:textSize="16sp"
android:text="辅助工作"/>
</LinearLayout>
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="#aaaaaa" />
<LinearLayout
android:id="@+id/ll_custom_add"
android:layout_width="0dp"
android:layout_height="40dp"
android:background="#cccccc"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tv_custom_add"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/colorPrimary"
android:gravity="center"
android:textSize="16sp"
android:text="手动添加"/>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="5dp"
android:paddingEnd="5dp"
android:paddingTop="5dp"
android:layout_gravity="center"
android:gravity="center"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="5dp"
android:minHeight="66px">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="18sp"
android:text="每日作业风险清单" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center">
<TextView
android:id="@+id/tv_time"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:text=""
android:textSize="18sp" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80px"
android:gravity="center"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:minHeight="60px">
<TextView
android:id="@+id/tv_a_desc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center|right"
android:layout_weight="1"
android:textSize="20sp"
android:text="A:" />
<TextView
android:id="@+id/tv_a"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center_vertical|left"
android:layout_marginStart="5dp"
android:textColor="#FFA500"
android:textSize="20sp"
android:text="0" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:minHeight="60px">
<TextView
android:id="@+id/tv_b_desc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center|right"
android:layout_weight="1"
android:textSize="20sp"
android:text="B:" />
<TextView
android:id="@+id/tv_b"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center_vertical|left"
android:layout_marginStart="5dp"
android:textColor="#FFA500"
android:textSize="20sp"
android:text="0" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:minHeight="60px">
<TextView
android:id="@+id/tv_c1_desc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center|right"
android:layout_weight="1.2"
android:textSize="20sp"
android:text="C1:" />
<TextView
android:id="@+id/tv_c1"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.8"
android:gravity="center_vertical|left"
android:layout_marginStart="5dp"
android:textColor="#FFA500"
android:textSize="20sp"
android:text="0" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="80px"
android:gravity="center"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:minHeight="60px">
<TextView
android:id="@+id/tv_c2_desc"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center|right"
android:text="C2:"
android:textSize="20sp" />
<TextView
android:id="@+id/tv_c2"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_gravity="center"
android:gravity="center_vertical|left"
android:layout_marginStart="5dp"
android:textColor="#FFA500"
android:textSize="20sp"
android:text="0" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:minHeight="60px">
<TextView
android:id="@+id/tv_c3_desc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center|right"
android:layout_weight="1"
android:textSize="20sp"
android:text="C3:" />
<TextView
android:id="@+id/tv_c3"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:gravity="center_vertical|left"
android:layout_marginStart="5dp"
android:textColor="#FFA500"
android:textSize="20sp"
android:text="0" />
</LinearLayout>
<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="horizontal"
android:minHeight="60px">
<TextView
android:id="@+id/tv_lowLisk_desc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center|right"
android:layout_weight="1.2"
android:textSize="20sp"
android:text="低风险:" />
<TextView
android:id="@+id/tv_lowLisk"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="0.8"
android:gravity="center_vertical|left"
android:layout_marginStart="5dp"
android:textColor="#FFA500"
android:textSize="20sp"
android:text="0" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<include
android:id="@+id/item_head"
layout="@layout/item_work_risk_list"
android:layout_width="match_parent"
android:layout_marginStart="10px"
android:layout_marginEnd="10px"
android:layout_marginTop="5dp"
android:layout_height="wrap_content" />
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="10px"
android:layout_marginEnd="10px"
android:layout_marginBottom="10px"
android:layout_weight="1">
<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:divider="#00000000"
android:dividerHeight="0px"/>
<TextView
android:id="@+id/tv_nodata"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/viewfinder_mask"
android:gravity="center"
android:text="暂无数据"/>
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="@color/colorPrimary"
android:orientation="horizontal">
<LinearLayout
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:orientation="vertical">
<TextView
android:id="@+id/tv_report"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/white"
android:gravity="center"
android:textSize="16sp"
android:text="查看报告"/>
</LinearLayout>
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="#aaaaaa" />
<LinearLayout
android:id="@+id/ll_refresh"
android:layout_width="0dp"
android:layout_height="50dp"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:orientation="vertical">
<TextView
android:id="@+id/tv_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:textColor="@color/white"
android:gravity="center"
android:textSize="16sp"
android:text="重新加载列表数据"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>

@ -172,12 +172,9 @@
</RelativeLayout> </RelativeLayout>
<View
android:layout_width="match_parent"
android:layout_height="25px" />
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:visibility="gone"
android:layout_height="100px"> android:layout_height="100px">
<TextView <TextView
@ -275,14 +272,10 @@
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="30px" /> android:textSize="30px" />
<View
android:layout_width="match_parent"
android:layout_height="25px" />
<TextView <TextView
android:id="@+id/tv_suggest" android:id="@+id/tv_suggest"
android:layout_width="match_parent" android:layout_width="match_parent"
android:visibility="gone"
android:layout_height="100px" android:layout_height="100px"
android:background="@drawable/selector_list_item" android:background="@drawable/selector_list_item"
android:drawableLeft="@drawable/icon_suggest" android:drawableLeft="@drawable/icon_suggest"

Loading…
Cancel
Save