Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
cf689cc6
Commit
cf689cc6
authored
Mar 03, 2022
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat : 系统消息列表接口调试完毕,跳转待后续调试
parent
59d2fcbc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
168 additions
and
26 deletions
+168
-26
MainActivity.kt
app/src/main/java/com/ydl/component/MainActivity.kt
+6
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+0
-0
config.gradle
config.gradle
+2
-2
AndroidManifest.xml
m-im/src/main/AndroidManifest.xml
+1
-1
TimeUtil.java
m-im/src/main/java/com/yidianling/avchatkit/common/util/TimeUtil.java
+5
-0
MedicalArchivesListActivity.kt
m-im/src/main/java/com/yidianling/medical/archives/MedicalArchivesListActivity.kt
+1
-1
MedicalSystemListActivity.kt
m-im/src/main/java/com/yidianling/medical/im/MedicalSystemListActivity.kt
+91
-17
MedicalSystemListAdapter.kt
m-im/src/main/java/com/yidianling/medical/im/adapter/MedicalSystemListAdapter.kt
+15
-3
SystemItemBean.kt
m-im/src/main/java/com/yidianling/medical/im/bean/SystemItemBean.kt
+13
-0
SystemListRespose.kt
m-im/src/main/java/com/yidianling/medical/im/bean/SystemListRespose.kt
+12
-0
ServiceApi.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
+10
-2
ServiceImpl.kt
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
+9
-0
medical_item_system_list.xml
m-im/src/main/res/layout/medical_item_system_list.xml
+3
-0
No files found.
app/src/main/java/com/ydl/component/MainActivity.kt
View file @
cf689cc6
...
...
@@ -31,6 +31,8 @@ import com.yidianling.consultant.api.IConsultantService
import
com.yidianling.fm.api.service.IFMService
import
com.yidianling.medical.GraphicConsultationFlow1Activity
import
com.yidianling.medical.archives.MedicalArchivesListActivity
import
com.yidianling.medical.im.MedicalSystemListActivity
import
com.yidianling.medical.im.adapter.MedicalSystemListAdapter
import
com.yidianling.tests.home.NewTestHomeActivity
import
com.yidianling.user.StatusUtils
import
com.yidianling.user.ui.collect.CollectSexAndBirthActivity
...
...
@@ -92,6 +94,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
tv_user
.
setOnClickListener
{
reLoadData
()
}
system_list
.
setOnClickListener
{
//系统消息列表
MedicalSystemListActivity
.
start
(
this
@MainActivity
)
}
test_ts
.
setOnClickListener
{
// val alipay: PayTask = PayTask(this@MainActivity)
// val orderInfo = "{\n" +
...
...
app/src/main/res/layout/activity_main.xml
View file @
cf689cc6
This diff is collapsed.
Click to expand it.
config.gradle
View file @
cf689cc6
...
...
@@ -11,7 +11,7 @@ ext {
"m-user"
:
"0.0.61.90"
,
"m-user-medical"
:
"0.0.61.99"
,
"m-home"
:
"0.0.22.70"
,
"m-im-medical"
:
"0.0.20.8
6
"
,
"m-im-medical"
:
"0.0.20.8
7
"
,
"m-im"
:
"0.0.20.76"
,
"m-dynamic"
:
"0.0.7.28"
,
"m-article"
:
"0.0.0.10"
,
...
...
@@ -97,7 +97,7 @@ ext {
"m-user"
:
"0.0.61.90"
,
"m-user-medical"
:
"0.0.61.99"
,
"m-home"
:
"0.0.22.70"
,
"m-im-medical"
:
"0.0.20.8
6
"
,
"m-im-medical"
:
"0.0.20.8
7
"
,
"m-im"
:
"0.0.20.76"
,
"m-dynamic"
:
"0.0.7.28"
,
"m-article"
:
"0.0.0.8"
,
...
...
m-im/src/main/AndroidManifest.xml
View file @
cf689cc6
...
...
@@ -299,7 +299,7 @@
<!--医疗系统消息-->
<activity
android:name=
"com.yidianling.medical.im.
SystemMessage
ListActivity"
android:name=
"com.yidianling.medical.im.
MedicalSystem
ListActivity"
android:screenOrientation=
"portrait"
android:theme=
"@style/platform_NoTitleTheme"
/>
</application>
...
...
m-im/src/main/java/com/yidianling/avchatkit/common/util/TimeUtil.java
View file @
cf689cc6
...
...
@@ -60,6 +60,11 @@ public class TimeUtil {
return
(
formatter
.
format
(
new
Date
()));
}
public
static
String
getTimeStringForDate
(
long
milliseconds
)
{
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm"
,
Locale
.
getDefault
());
return
(
formatter
.
format
(
milliseconds
));
}
public
static
int
getNow
()
{
return
(
int
)
((
new
Date
()).
getTime
()
/
1000
);
}
...
...
m-im/src/main/java/com/yidianling/medical/archives/MedicalArchivesListActivity.kt
View file @
cf689cc6
...
...
@@ -29,7 +29,7 @@ class MedicalArchivesListActivity : BaseActivity(), SwipeRefreshLayout.OnRefresh
companion
object
{
private
var
currPage
:
Int
=
1
private
val
pageSize
:
Int
=
20
private
const
val
pageSize
:
Int
=
20
private
lateinit
var
mEmptyView
:
View
private
lateinit
var
mAdapter
:
MedicalUserArchivesAdapter
private
var
isFirstLoadData
=
true
...
...
m-im/src/main/java/com/yidianling/medical/im/
SystemMessage
ListActivity.kt
→
m-im/src/main/java/com/yidianling/medical/im/
MedicalSystem
ListActivity.kt
View file @
cf689cc6
package
com.yidianling.medical.im
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Intent
import
android.view.LayoutInflater
import
android.view.View
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
...
...
@@ -14,8 +16,10 @@ import com.ydl.ydlcommon.utils.Utils
import
com.yidianling.im.R
import
com.yidianling.medical.im.adapter.MedicalSystemListAdapter
import
com.yidianling.medical.widgets.LoadMoreView
import
com.yidianling.uikit.custom.http.ServiceImpl
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.schedulers.Schedulers
import
kotlinx.android.synthetic.main.medical_system_list_activity.*
import
kotlinx.coroutines.*
import
java.util.*
...
...
@@ -23,20 +27,18 @@ import java.util.*
* 系统消息列表
* @author liupeng
* */
class
SystemMessage
ListActivity
:
BaseActivity
(),
SwipeRefreshLayout
.
OnRefreshListener
,
class
MedicalSystem
ListActivity
:
BaseActivity
(),
SwipeRefreshLayout
.
OnRefreshListener
,
BaseQuickAdapter
.
RequestLoadMoreListener
{
private
lateinit
var
mEmptyView
:
View
private
lateinit
var
mAdapter
:
MedicalSystemListAdapter
companion
object
{
private
lateinit
var
mDoctorId
:
String
private
lateinit
var
mDoctorUid
:
String
private
var
currPage
:
Int
=
1
private
const
val
pageSize
:
Int
=
20
@JvmStatic
fun
start
(
context
:
Context
,
doctorId
:
String
,
doctorUid
:
String
)
{
val
starter
=
Intent
(
context
,
SystemMessageListActivity
::
class
.
java
)
.
putExtra
(
"doctorId"
,
doctorId
)
.
putExtra
(
"doctorUid"
,
doctorUid
)
fun
start
(
context
:
Context
)
{
val
starter
=
Intent
(
context
,
MedicalSystemListActivity
::
class
.
java
)
context
.
startActivity
(
starter
)
}
}
...
...
@@ -47,11 +49,11 @@ class SystemMessageListActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshLi
override
fun
initDataAndEvent
()
{
initStatus
()
mEmptyView
=
LayoutInflater
.
from
(
this
@
SystemMessage
ListActivity
)
mEmptyView
=
LayoutInflater
.
from
(
this
@
MedicalSystem
ListActivity
)
.
inflate
(
R
.
layout
.
platform_list_empty_view
,
null
,
false
)
mAdapter
=
MedicalSystemListAdapter
()
system_list
.
layoutManager
=
LinearLayoutManager
(
this
@
SystemMessage
ListActivity
,
LinearLayoutManager
.
VERTICAL
,
false
)
LinearLayoutManager
(
this
@
MedicalSystem
ListActivity
,
LinearLayoutManager
.
VERTICAL
,
false
)
system_list
.
adapter
=
mAdapter
mAdapter
.
setOnItemClickListener
{
adapter
,
view
,
position
->
...
...
@@ -61,31 +63,103 @@ class SystemMessageListActivity : BaseActivity(), SwipeRefreshLayout.OnRefreshLi
}
}
mAdapter
.
setLoadMoreView
(
LoadMoreView
())
mAdapter
.
setOnLoadMoreListener
(
this
@
SystemMessage
ListActivity
,
system_list
)
mAdapter
.
setOnLoadMoreListener
(
this
@
MedicalSystem
ListActivity
,
system_list
)
system_swipe_refresh_layout
?.
setOnRefreshListener
(
this
)
system_swipe_refresh_layout
?.
setColorSchemeColors
(
ContextCompat
.
getColor
(
this
@
SystemMessage
ListActivity
,
R
.
color
.
platform_main_theme
)
ContextCompat
.
getColor
(
this
@
MedicalSystem
ListActivity
,
R
.
color
.
platform_main_theme
)
)
system_swipe_refresh_layout
?.
setProgressViewOffset
(
false
,
0
,
200
)
currPage
=
1
getSystemList
()
}
@SuppressLint
(
"CheckResult"
)
private
fun
getSystemList
()
{
ServiceImpl
.
instance
.
getSystemPageList
(
currPage
,
pageSize
,
null
)
.
subscribeOn
(
Schedulers
.
io
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
subscribe
({
response
->
if
(
"200"
==
response
.
code
)
{
system_swipe_refresh_layout
.
isRefreshing
=
false
var
list
=
response
.
data
.
rows
if
(
currPage
==
1
)
{
//第一页数据
if
(
list
!=
null
&&
list
.
isNotEmpty
())
{
if
(
list
.
size
<
pageSize
)
{
mAdapter
.
setNewData
(
list
)
mAdapter
.
removeAllFooterView
()
mAdapter
.
loadMoreEnd
(
false
)
}
else
{
currPage
++
mAdapter
.
setNewData
(
list
)
mAdapter
.
removeAllFooterView
()
mAdapter
.
loadMoreComplete
()
}
}
else
{
mAdapter
.
loadMoreEnd
(
false
)
mAdapter
.
setNewData
(
list
)
var
net_error
=
mEmptyView
.
findViewById
<
TextView
>(
R
.
id
.
net_error
)
net_error
.
text
=
"暂无系统消息~"
mAdapter
.
emptyView
=
mEmptyView
}
}
else
{
//非第一页数据
if
(
list
!=
null
&&
list
.
isEmpty
())
{
mAdapter
.
loadMoreEnd
(
false
)
}
else
{
if
(
list
.
size
<
pageSize
)
{
mAdapter
.
addData
(
list
)
mAdapter
.
loadMoreEnd
(
false
)
}
else
{
mAdapter
.
addData
(
list
)
if
(
currPage
==
response
.
data
.
totalPage
)
{
mAdapter
.
loadMoreEnd
(
false
)
}
else
{
currPage
++
mAdapter
.
loadMoreComplete
()
}
}
}
}
}
else
{
system_swipe_refresh_layout
.
isRefreshing
=
false
mAdapter
.
loadMoreFail
()
mAdapter
.
emptyView
=
mEmptyView
}
},
{
e
->
system_swipe_refresh_layout
.
isRefreshing
=
false
mAdapter
.
loadMoreFail
()
var
net_error
=
mEmptyView
.
findViewById
<
TextView
>(
R
.
id
.
net_error
)
var
reLoad
=
mEmptyView
.
findViewById
<
TextView
>(
R
.
id
.
reLoad
)
net_error
.
text
=
"网络异常,请稍后再试"
reLoad
.
visibility
=
View
.
VISIBLE
mAdapter
.
emptyView
=
mEmptyView
})
}
override
fun
onRefresh
()
{
currPage
=
1
getSystemList
()
}
override
fun
onLoadMoreRequested
()
{
getSystemList
()
}
private
fun
initStatus
()
{
StatusBarUtils
.
setTransparentForImageView
(
this
@
SystemMessage
ListActivity
,
null
)
StatusBarUtils
.
statusBarLightMode
(
this
@
SystemMessage
ListActivity
)
StatusBarUtils
.
setTransparentForImageView
(
this
@
MedicalSystem
ListActivity
,
null
)
StatusBarUtils
.
statusBarLightMode
(
this
@
MedicalSystem
ListActivity
)
}
...
...
m-im/src/main/java/com/yidianling/medical/im/adapter/MedicalSystemListAdapter.kt
View file @
cf689cc6
...
...
@@ -2,15 +2,27 @@ package com.yidianling.medical.im.adapter
import
com.chad.library.adapter.base.BaseQuickAdapter
import
com.chad.library.adapter.base.BaseViewHolder
import
com.yidianling.avchatkit.common.util.TimeUtil
import
com.yidianling.im.R
import
com.yidianling.
im.bean.SystemMsg
Bean
import
com.yidianling.
medical.im.bean.SystemItem
Bean
/**
* 医生系统消息item adapter
*/
class
MedicalSystemListAdapter
:
BaseQuickAdapter
<
SystemMsgBean
.
SystemMBean
?,
BaseViewHolder
>(
R
.
layout
.
medical_item_system_list
)
{
class
MedicalSystemListAdapter
:
BaseQuickAdapter
<
SystemItemBean
,
BaseViewHolder
>(
R
.
layout
.
medical_item_system_list
)
{
override
fun
convert
(
helper
:
BaseViewHolder
,
item
:
SystemMsgBean
.
SystemMBean
?)
{
override
fun
convert
(
helper
:
BaseViewHolder
,
item
:
SystemItemBean
)
{
//时间
helper
.
setText
(
R
.
id
.
time_text
,
TimeUtil
.
getTimeStringForDate
(
item
.
createTime
))
//标题
item
.
title
?.
let
{
title
->
helper
.
setText
(
R
.
id
.
system_title
,
title
)
}
//内容
item
.
content
?.
let
{
content
->
helper
.
setText
(
R
.
id
.
system_dec
,
content
)
}
}
...
...
m-im/src/main/java/com/yidianling/medical/im/bean/SystemItemBean.kt
0 → 100644
View file @
cf689cc6
package
com.yidianling.medical.im.bean
/**
* 系统消息item
* */
data class
SystemItemBean
(
var
content
:
String
,
var
createTime
:
Long
,
var
msgId
:
String
,
var
read
:
Boolean
,
var
readTime
:
String
,
var
title
:
String
)
m-im/src/main/java/com/yidianling/medical/im/bean/SystemListRespose.kt
0 → 100644
View file @
cf689cc6
package
com.yidianling.medical.im.bean
/**
* 系统消息返回数据
* */
data class
SystemListRespose
(
var
pageNum
:
Int
,
var
pageSize
:
Int
,
var
rows
:
List
<
SystemItemBean
>,
var
totalCount
:
Int
,
var
totalPage
:
Int
)
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceApi.kt
View file @
cf689cc6
...
...
@@ -8,13 +8,13 @@ import com.yidianling.medical.MedicalFileBeanRespose
import
com.yidianling.medical.archives.bean.CreateArchivesRespose
import
com.yidianling.medical.archives.bean.MedicalArchivesListBean
import
com.yidianling.medical.archives.bean.MedicalUserArchivesBean
import
com.yidianling.medical.im.bean.SystemListRespose
import
com.yidianling.uikit.custom.http.response.*
import
com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
import
io.reactivex.Observable
import
okhttp3.RequestBody
import
retrofit2.http.*
import
java.util.*
import
kotlin.collections.ArrayList
/**
* Created by xj on 2019/6/26.
...
...
@@ -164,5 +164,12 @@ interface ServiceApi {
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA_URL
)
fun
upload
(
@PartMap
params
:
TreeMap
<
String
,
RequestBody
>):
Observable
<
BaseAPIResponse
<
MedicalFileBeanRespose
>>
//医疗 系统消息列表
@GET
(
"api/client/message/v1/getPageList"
)
@Headers
(
YDL_DOMAIN
+
YDL_DOMAIN_JAVA_URL
)
fun
getSystemPageList
(
@Query
(
"pageNum"
)
pageNum
:
Int
,
@Query
(
"pageSize"
)
pageSize
:
Int
,
@Query
(
"read"
)
read
:
String
?
):
Observable
<
BaseAPIResponse
<
SystemListRespose
>>
}
\ No newline at end of file
m-im/src/main/java/com/yidianling/uikit/custom/http/ServiceImpl.kt
View file @
cf689cc6
...
...
@@ -6,6 +6,7 @@ import com.ydl.ydlnet.YDLHttpUtils
import
com.yidianling.im.http.ImRetrofitApi
import
com.yidianling.medical.MedicalFileBeanRespose
import
com.yidianling.medical.archives.bean.*
import
com.yidianling.medical.im.bean.SystemListRespose
import
com.yidianling.uikit.custom.http.response.*
import
com.yidianling.uikit.custom.http.response.question.QuestionsInfoBean
import
io.reactivex.Observable
...
...
@@ -274,6 +275,14 @@ class ServiceImpl private constructor() {
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
deleteArchives
(
body
)
}
/**
* 医疗 系统消息列表
* @param read 是否阅读 0-未读 1-已读 空-全部
* */
fun
getSystemPageList
(
pageNum
:
Int
,
pageSize
:
Int
,
read
:
String
?):
Observable
<
BaseAPIResponse
<
SystemListRespose
>>{
return
YDLHttpUtils
.
obtainApi
(
ServiceApi
::
class
.
java
).
getSystemPageList
(
pageNum
,
pageSize
,
read
)
}
fun
uploadBatch
(
map
:
TreeMap
<
String
,
RequestBody
>):
Observable
<
BaseAPIResponse
<
List
<
MedicalFileBeanRespose
>>>
{
...
...
m-im/src/main/res/layout/medical_item_system_list.xml
View file @
cf689cc6
...
...
@@ -9,6 +9,7 @@
android:paddingRight=
"16dp"
>
<TextView
android:id=
"@+id/time_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
...
...
@@ -21,10 +22,12 @@
tools:text=
"2022-02-18"
/>
<androidx.cardview.widget.CardView
android:layout_marginTop=
"10dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/medical_bg_ffffff_8dp"
android:elevation=
"0dp"
app:cardCornerRadius=
"8dp"
app:cardElevation=
"0dp"
>
<androidx.constraintlayout.widget.ConstraintLayout
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment