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
6233367b
Commit
6233367b
authored
Jul 01, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:更新本地消息
parent
6302007a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
5 deletions
+49
-5
MultipleSelectedEvent.kt
m-im/src/main/java/com/yidianling/im/event/MultipleSelectedEvent.kt
+0
-1
ImIn.kt
m-im/src/main/java/com/yidianling/im/router/ImIn.kt
+9
-0
MsgViewHolderLingxiWhichQuestion.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
+0
-0
LingxiWhichQuestionBean.kt
m-im/src/main/java/com/yidianling/im/session/viewholder/bean/LingxiWhichQuestionBean.kt
+8
-2
YDLMessageFragment.java
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
+32
-2
No files found.
m-im/src/main/java/com/yidianling/im/event/MultipleSelectedEvent.kt
View file @
6233367b
package
com.yidianling.im.event
import
com.yidianling.im.router.ImIn.getUserInfo
import
com.yidianling.im.session.viewholder.bean.AnswersItem
public
class
MultipleSelectedEvent
(
...
...
m-im/src/main/java/com/yidianling/im/router/ImIn.kt
View file @
6233367b
...
...
@@ -9,6 +9,7 @@ import com.netease.nimlib.sdk.NIMClient
import
com.netease.nimlib.sdk.RequestCallback
import
com.netease.nimlib.sdk.auth.LoginInfo
import
com.netease.nimlib.sdk.msg.MsgService
import
com.netease.nimlib.sdk.msg.model.IMMessage
import
com.netease.nimlib.sdk.uinfo.UserService
import
com.netease.nimlib.sdk.uinfo.constant.UserInfoFieldEnum
import
com.ydl.confide.api.IConfideService
...
...
@@ -301,4 +302,12 @@ object ImIn {
fun
loginByOneKeyLogin
(
context
:
Context
,
isOpenDialog
:
Boolean
)
:
Boolean
{
return
getUserService
().
loginByOneKeyLogin
(
context
,
isOpenDialog
)
}
lateinit
var
imMessage
:
IMMessage
fun
setLocalExten
(
imMessage
:
IMMessage
){
this
.
imMessage
=
imMessage
}
fun
getImmessage
():
IMMessage
{
return
imMessage
}
}
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderLingxiWhichQuestion.java
View file @
6233367b
This diff is collapsed.
Click to expand it.
m-im/src/main/java/com/yidianling/im/session/viewholder/bean/LingxiWhichQuestionBean.kt
View file @
6233367b
package
com.yidianling.im.session.viewholder.bean
import
android.os.Parcel
import
android.os.Parcelable
import
java.io.Serializable
data class
LingxiWhichQuestionBean
(
var
isSelected
:
Boolean
,
...
...
@@ -30,18 +34,20 @@ data class AnswerBean(
var
questionId
:
String
,
var
answers
:
ArrayList
<
AnswersItem
>
)
data
class
AnswersItem
(
class
AnswersItem
(
var
optionId
:
String
,
var
name
:
String
,
var
other
:
String
?,
var
relates
:
ArrayList
<
Relates
>
)
data class
Relates
(
class
Relates
(
var
id
:
String
?,
var
category
:
String
?,
var
name
:
String
?,
var
score
:
String
?
)
data class
UserIsIn
(
var
data
:
UserIsInPageData
,
var
fromUid
:
String
,
...
...
m-im/src/main/java/com/yidianling/uikit/business/session/fragment/YDLMessageFragment.java
View file @
6233367b
...
...
@@ -110,6 +110,7 @@ import org.jetbrains.annotations.NotNull;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -226,6 +227,8 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
private
UserInfoDialog
userInfoDialog
=
null
;
private
boolean
isOthers
;
private
MultipleAnswerBean
multipleAnswerBean
;
private
ArrayList
<
String
>
answersItemsMap
=
new
ArrayList
<>();
@SuppressLint
(
"HandlerLeak"
)
private
Handler
mHandler
=
new
Handler
()
{
@Override
...
...
@@ -1116,6 +1119,10 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
}
multipleAnswerBean
.
setAnswersItems
(
answersItems
);
for
(
int
i
=
0
;
i
<
answersItems
.
size
();
i
++){
answersItemsMap
.
add
(
i
,
answersItems
.
get
(
i
).
getName
());
}
updateLocalMsg
(
null
,
answersItemsMap
);
answerMultipleQuestion
(
multipleAnswerBean
);
}
else
{
...
...
@@ -1129,14 +1136,37 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
}
multipleAnswerBean
=
event
.
getMultipleAnswerBean
();
multipleAnswerBean
.
setAnswersItems
(
answersItems
);
for
(
int
i
=
0
;
i
<
answersItems
.
size
();
i
++){
answersItemsMap
.
add
(
i
,
answersItems
.
get
(
i
).
getName
());
}
updateLocalMsg
(
null
,
answersItemsMap
);
answerMultipleQuestion
(
multipleAnswerBean
);
}
}
private
void
updateLocalMsg
(
Integer
position
,
ArrayList
<
String
>
selectedPosition
)
{
IMMessage
message
=
ImIn
.
INSTANCE
.
getImMessage
();
//更新本地消息
Map
<
String
,
Object
>
map
=
message
.
getLocalExtension
();
if
(
map
==
null
)
{
map
=
new
HashMap
();
}
map
.
put
(
"isSure"
,
true
);
if
(
position
!=
null
){
map
.
put
(
"position"
,
position
);
}
if
(
selectedPosition
!=
null
){
map
.
put
(
"multiple"
,
selectedPosition
);
}
message
.
setLocalExtension
(
map
);
NIMClient
.
getService
(
MsgService
.
class
).
updateIMMessage
(
message
);
//通知ui刷新
// message.getMsgAdapter().updateItemAtLocalExtension(message);
}
/*
* 用户回答问题接口
* */
private
void
answerMultipleQuestion
(
MultipleAnswerBean
multipleAnswerBean
){
inputPanel
.
setInputContent
(
""
);
question_multiple
.
setText
(
""
);
inputPanel
.
onlyShowTextEnd
();
...
...
@@ -1148,7 +1178,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
* 用户回答问题接口
* */
private
void
answerLingxiQuestion
(
String
examID
,
String
questionPaperId
,
String
uid
,
String
questionId
,
ArrayList
<
AnswersItem
>
answersItems
,
String
fromUID
)
{
String
str
=
new
Gson
().
toJson
(
new
LingxiAnswerBean
(
new
AnswerBean
(
examID
,
questionPaperId
,
uid
,
questionId
,
answersItems
),
fromUID
,
"56"
,
uid
));
String
str
=
new
Gson
().
toJson
(
new
LingxiAnswerBean
(
new
AnswerBean
(
examID
,
questionPaperId
,
uid
,
questionId
,
answersItems
),
uid
,
"56"
,
fromUID
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
str
);
Disposable
subscribe
=
ImRetrofitApi
.
Companion
.
getImRetrofitApi
().
lingxiAnswerQuestion
(
body
)
.
compose
(
RxUtils
.
INSTANCE
.
resultJavaData
())
...
...
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