Commit e9d061bc authored by shiyl's avatar shiyl

add搭建人员管理相关页面

parent 29c894a2
......@@ -28,5 +28,23 @@ class XRouterPathConstants {
// 人员管理 —— 我的员工
const val PERSONAL_MY_STAFF = "/personal/myStaffActivity"
// 人员管理 —— 管理员信息
const val PERSONAL_MANAGER_INFO = "/personal/ManagerInfoActivity"
// 人员管理 —— 管理员变更
const val PERSONAL_MANAGER_CHANGE = "/personal/ManagerChangeActivity"
// 人员管理 —— 员工信息
const val PERSONAL_STAFF_INFO = "/personal/StaffInfoActivity"
// 人员管理 —— 员工管理
const val PERSONAL_STAFF_MANAGE = "/personal/StaffManageActivity"
// 人员管理 —— 添加员工
const val PERSONAL_ADD_STAFF = "/personal/AddStaffActivity"
// 系统设置 —— 设置
const val SYSTEM_SETTING = "/setting/SettingActivity"
}
}
......@@ -99,6 +99,24 @@
<activity
android:name=".personnel.ui.MyStaffActivity"
android:theme="@style/Transparent" />
<activity
android:name=".personnel.ui.ManagerInfoActivity"
android:theme="@style/Transparent" />
<activity
android:name=".personnel.ui.ManagerChangeActivity"
android:theme="@style/Transparent" />
<activity
android:name=".personnel.ui.StaffInfoActivity"
android:theme="@style/Transparent" />
<activity
android:name=".personnel.ui.StaffManageActivity"
android:theme="@style/Transparent" />
<activity
android:name=".personnel.ui.AddStaffActivity"
android:theme="@style/Transparent" />
<activity
android:name=".ui.setting.SystemSetting"
android:theme="@style/Transparent" />
</application>
......
......@@ -15,17 +15,24 @@ import com.yidian.common.XRouterPathConstants.Companion.LIFE_ACCOUNT_PERSONAL_AU
import com.yidian.common.XRouterPathConstants.Companion.LOGIN_LIFE_CIRCLE
import com.yidian.common.XRouterPathConstants.Companion.NEWS_CONTENT
import com.yidian.common.XRouterPathConstants.Companion.NEWS_MAIN
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_ADD_STAFF
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_MANAGER_CHANGE
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_MANAGER_INFO
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_MY_STAFF
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_INFO
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_MANAGE
import com.yidian.common.XRouterPathConstants.Companion.PROTOCOL
import com.yidian.common.XRouterPathConstants.Companion.SUPPORT
import com.yidian.common.XRouterPathConstants.Companion.SYSTEM_SETTING
import com.yidian.common.YdBaseApplication
import com.yidian.news.util.ProcessUtil
import com.yidian.nightmode.util.NightModeUtil
import com.yidian.shenghuoquan.newscontent.personnel.ui.MyStaffActivity
import com.yidian.shenghuoquan.newscontent.personnel.ui.*
import com.yidian.shenghuoquan.newscontent.service.*
import com.yidian.shenghuoquan.newscontent.ui.*
import com.yidian.shenghuoquan.newscontent.ui.auth.*
import com.yidian.shenghuoquan.newscontent.ui.idcard.IDCardTestActivity
import com.yidian.shenghuoquan.newscontent.ui.setting.SystemSetting
import com.yidian.utils.DensityUtil
import com.yidian.xpage.XPageManager
import com.yidian.xpage.node.XPageHandler
......@@ -236,6 +243,72 @@ class NewsContentApplication : YdBaseApplication() {
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent)
}
}),
XPageNode(PERSONAL_MANAGER_INFO, XPageNodePageType.NATIVE, object : XPageHandler {
override fun handler(params: Map<String, Any?>?) {
val intent = Intent()
if (params != null) {
intent.putExtra(XRouterPathConstants.ParamsKey, params as HashMap)
}
intent.setClass(context, ManagerInfoActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent)
}
}),
XPageNode (PERSONAL_MANAGER_CHANGE, XPageNodePageType.NATIVE, object : XPageHandler {
override fun handler(params: Map<String, Any?>?) {
val intent = Intent()
if (params != null) {
intent.putExtra(XRouterPathConstants.ParamsKey, params as HashMap)
}
intent.setClass(context, ManagerChangeActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent)
}
}),
XPageNode (PERSONAL_STAFF_INFO, XPageNodePageType.NATIVE, object : XPageHandler {
override fun handler(params: Map<String, Any?>?) {
val intent = Intent()
if (params != null) {
intent.putExtra(XRouterPathConstants.ParamsKey, params as HashMap)
}
intent.setClass(context, StaffInfoActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent)
}
}),
XPageNode (PERSONAL_STAFF_MANAGE, XPageNodePageType.NATIVE, object : XPageHandler {
override fun handler(params: Map<String, Any?>?) {
val intent = Intent()
if (params != null) {
intent.putExtra(XRouterPathConstants.ParamsKey, params as HashMap)
}
intent.setClass(context, StaffManageActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent)
}
}),
XPageNode (PERSONAL_ADD_STAFF, XPageNodePageType.NATIVE, object : XPageHandler {
override fun handler(params: Map<String, Any?>?) {
val intent = Intent()
if (params != null) {
intent.putExtra(XRouterPathConstants.ParamsKey, params as HashMap)
}
intent.setClass(context, AddStaffActivity::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent)
}
}),
XPageNode (SYSTEM_SETTING, XPageNodePageType.NATIVE, object : XPageHandler {
override fun handler(params: Map<String, Any?>?) {
val intent = Intent()
if (params != null) {
intent.putExtra(XRouterPathConstants.ParamsKey, params as HashMap)
}
intent.setClass(context, SystemSetting::class.java)
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK
context.startActivity(intent)
}
})
)
)
......
......@@ -18,11 +18,12 @@ object PersonalRemoteDataSource {
/**
* 获取账号列表
*/
fun getAccountList(apiCallback: IPersonalAccountListCallback) {
fun getAccountList(apiCallback: IPersonalAccountListCallback, requestParams: HashMap<String, String?>) {
val timeStamp = System.currentTimeMillis()
val publicParamsMap = HttpParamsUtils.getPublicParamsMap(timeStamp)
val privateParamsMap = HttpParamsUtils.getPrivateParamsMap(requestParams, timeStamp)
ServiceFactory.getInstance().createService(PersonalService::class.java)
.getAccountList(publicParamsMap)
.getAccountList(publicParamsMap, privateParamsMap)
.compose(TransformUtil.defaultSchedulers())
.subscribe(object : HttpResultSubscriber<AccountListDto?>() {
override fun onSuccess(result: HttpResult<AccountListDto?>?) {
......
......@@ -22,7 +22,7 @@ interface PersonalService {
* 获取账号列表
*/
@GET(accountList)
fun getAccountList(@QueryMap commonParams: Map<String, String>): Observable<HttpResult<Any?>>
fun getAccountList(@QueryMap commonParams: Map<String, String>, @QueryMap params: Map<String, String?>): Observable<HttpResult<Any?>>
/**
* 更换生活号管理员
......
package com.yidian.shenghuoquan.newscontent.personnel.ui
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_ADD_STAFF
import com.yidian.common.base.BaseActivity
import com.yidian.shenghuoquan.newscontent.databinding.ActivityAddStaffBinding
/**
* 人员管理 —— 添加员工
*/
class AddStaffActivity : BaseActivity<ActivityAddStaffBinding>() {
override fun createViewBinding(): ActivityAddStaffBinding {
return ActivityAddStaffBinding.inflate(layoutInflater)
}
override fun getXPageName(): String {
return PERSONAL_ADD_STAFF
}
}
package com.yidian.shenghuoquan.newscontent.personnel.ui
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_MANAGER_CHANGE
import com.yidian.common.base.BaseActivity
import com.yidian.shenghuoquan.newscontent.databinding.ActivityManagerChangeBinding
/**
* 人员管理 —— 管理员变更
*/
class ManagerChangeActivity : BaseActivity<ActivityManagerChangeBinding>() {
override fun createViewBinding(): ActivityManagerChangeBinding {
return ActivityManagerChangeBinding.inflate(layoutInflater)
}
override fun getXPageName(): String {
return PERSONAL_MANAGER_CHANGE
}
}
package com.yidian.shenghuoquan.newscontent.personnel.ui
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_MANAGER_INFO
import com.yidian.common.base.BaseActivity
import com.yidian.shenghuoquan.newscontent.databinding.ActivityManagerInfoBinding
/**
* 人员管理 —— 管理员信息
*/
class ManagerInfoActivity: BaseActivity<ActivityManagerInfoBinding>() {
override fun createViewBinding(): ActivityManagerInfoBinding {
return ActivityManagerInfoBinding.inflate(layoutInflater)
}
override fun getXPageName(): String {
return PERSONAL_MANAGER_INFO
}
}
package com.yidian.shenghuoquan.newscontent.personnel.ui
import android.os.Bundle
import com.yidian.common.XRouterPathConstants
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_MY_STAFF
import com.yidian.common.base.BaseActivity
import com.yidian.shenghuoquan.newscontent.R
......@@ -10,7 +11,6 @@ import com.yidian.shenghuoquan.newscontent.personnel.bean.AccountAdmin
import com.yidian.shenghuoquan.newscontent.personnel.bean.AccountListDto
import com.yidian.shenghuoquan.newscontent.personnel.http.IPersonalAccountListCallback
import com.yidian.shenghuoquan.newscontent.personnel.http.PersonalRemoteDataSource
import com.yidian.utils.ToastUtil
import com.yidian.xpage.XPageManager
/**
......@@ -18,6 +18,8 @@ import com.yidian.xpage.XPageManager
*/
class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>(), IPersonalAccountListCallback {
private var managerInfo: AccountAdmin? = null
private val myStaffAdapter: MyStaffListAdapter by lazy { MyStaffListAdapter() }
override fun createViewBinding(): ActivityMyStaffBinding {
......@@ -32,7 +34,13 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>(), IPersonalAccount
super.init(savedInstanceState)
initClick()
initView()
PersonalRemoteDataSource.getAccountList(this)
requestAccountList()
}
private fun requestAccountList() {
val paramsMap = HashMap<String, String?>()
paramsMap["life_account_id"] = "7470213157388289"
PersonalRemoteDataSource.getAccountList(this, paramsMap)
}
private fun initView() {
......@@ -44,19 +52,34 @@ class MyStaffActivity : BaseActivity<ActivityMyStaffBinding>(), IPersonalAccount
viewBind.layoutCommonHeader.ivBack.setOnClickListener {
XPageManager.pop(null)
}
// 管理员信息
viewBind.clManager.setOnClickListener {
managerInfo?.let {
val hashMap = HashMap<String, Any?>()
hashMap["managerInfo"] = it
XPageManager.push(XRouterPathConstants.PERSONAL_MANAGER_INFO, hashMap)
}
}
// 更新管理员
viewBind.tvChange.setOnClickListener {
ToastUtil.showToast(this, "更换管理员")
managerInfo?.let {
val hashMap = HashMap<String, String?>()
hashMap["mobile"] = it.mobile
XPageManager.push(XRouterPathConstants.PERSONAL_MANAGER_CHANGE, hashMap)
}
}
// 点击添加
viewBind.tvAddStaff.setOnClickListener {
ToastUtil.showToast(this, "管理员工")
XPageManager.push(XRouterPathConstants.PERSONAL_ADD_STAFF, null)
}
}
override fun getAccountListSuccess(response: AccountListDto?) {
response?.let {
it.admin?.get(0)?.let { it1 -> initManager(it1) }
it.admin?.get(0)?.let { admin ->
managerInfo = admin
initManager(admin)
}
myStaffAdapter.setList(it.users)
}
}
......
package com.yidian.shenghuoquan.newscontent.personnel.ui
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_INFO
import com.yidian.common.base.BaseActivity
import com.yidian.shenghuoquan.newscontent.databinding.ActivityStaffInfoBinding
/**
* 员工信息
*/
class StaffInfoActivity : BaseActivity<ActivityStaffInfoBinding>() {
override fun createViewBinding(): ActivityStaffInfoBinding {
return ActivityStaffInfoBinding.inflate(layoutInflater)
}
override fun getXPageName(): String {
return PERSONAL_STAFF_INFO
}
}
package com.yidian.shenghuoquan.newscontent.personnel.ui
import com.yidian.common.XRouterPathConstants.Companion.PERSONAL_STAFF_MANAGE
import com.yidian.common.base.BaseActivity
import com.yidian.shenghuoquan.newscontent.databinding.ActivityStaffManageBinding
/**
* 人员管理 —— 员工管理页面
*/
class StaffManageActivity : BaseActivity<ActivityStaffManageBinding>() {
override fun createViewBinding(): ActivityStaffManageBinding {
return ActivityStaffManageBinding.inflate(layoutInflater)
}
override fun getXPageName(): String {
return PERSONAL_STAFF_MANAGE
}
}
package com.yidian.shenghuoquan.newscontent.ui.setting
import com.yidian.common.XRouterPathConstants.Companion.SYSTEM_SETTING
import com.yidian.common.base.BaseActivity
import com.yidian.shenghuoquan.newscontent.databinding.ActivitySystemSettingBinding
/**
* 系统设置页面
*/
class SystemSetting : BaseActivity<ActivitySystemSettingBinding>() {
override fun createViewBinding(): ActivitySystemSettingBinding {
return ActivitySystemSettingBinding.inflate(layoutInflater)
}
override fun getXPageName(): String {
return SYSTEM_SETTING
}
}
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/black"
android:pathData="M19,13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"/>
</vector>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -22,6 +22,7 @@
android:textSize="18sp" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/cl_manager"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="16dp"
......@@ -108,7 +109,8 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_marginEnd="10dp"
android:layout_marginEnd="30dp"
android:drawableStart="@drawable/svg_baseline_add_24"
android:text="添加"
android:textColor="@color/black_333333"
android:textSize="16sp" />
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
android:layout_height="match_parent">
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment