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
968f6e69
Commit
968f6e69
authored
May 19, 2021
by
刘鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: IM模块 确认订单,收款问题修复
parent
4dc68055
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
24 deletions
+69
-24
config.gradle
config.gradle
+2
-2
CustomAttachReceivedMoney.java
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachReceivedMoney.java
+14
-7
MsgViewHolderConfirmOrder.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderConfirmOrder.java
+13
-4
MsgViewHolderOrderAlreadyDone.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderOrderAlreadyDone.java
+12
-3
MsgViewHolderReceivedMoney.java
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderReceivedMoney.java
+17
-8
MsgAdapter.java
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MsgAdapter.java
+11
-0
No files found.
config.gradle
View file @
968f6e69
...
...
@@ -10,7 +10,7 @@ ext {
"m-fm"
:
"0.0.30.03"
,
"m-user"
:
"0.0.61.31"
,
"m-home"
:
"0.0.22.61"
,
"m-im"
:
"0.0.19.0
0
"
,
"m-im"
:
"0.0.19.0
1
"
,
"m-dynamic"
:
"0.0.7.22"
,
"m-article"
:
"0.0.0.8"
,
...
...
@@ -93,7 +93,7 @@ ext {
"m-fm"
:
"0.0.30.01"
,
"m-user"
:
"0.0.61.31"
,
"m-home"
:
"0.0.22.61"
,
"m-im"
:
"0.0.19.0
0
"
,
"m-im"
:
"0.0.19.0
1
"
,
"m-dynamic"
:
"0.0.7.22"
,
"m-article"
:
"0.0.0.6"
,
...
...
m-im/src/main/java/com/yidianling/im/session/extension/CustomAttachReceivedMoney.java
View file @
968f6e69
...
...
@@ -11,22 +11,18 @@ public class CustomAttachReceivedMoney extends CustomAttachment {
private
static
final
String
KEY_TITLE
=
"title"
;
private
static
final
String
KEY_NUM
=
"num"
;
private
static
final
String
KEY_ORPAY
=
"orPay"
;
private
static
final
String
ISNEWORDER
=
"isNewOrder"
;
private
static
final
String
KEY_ORDERID
=
"orderid"
;
private
String
num
=
""
;
//订单金额
private
String
title
=
""
;
//订单标题题
private
int
orPay
;
//支付状态 0未支付1已支付
private
String
orderid
=
""
;
//订单id
private
Boolean
isNewOrder
=
false
;
//是否是新订单
public
CustomAttachReceivedMoney
()
{
super
(
CustomAttachmentType
.
RECEIVEDMONEY
);
}
public
CustomAttachReceivedMoney
(
String
num
,
String
title
,
int
orPay
,
String
orderId
)
{
super
(
CustomAttachmentType
.
RECEIVEDMONEY
);
this
.
num
=
num
;
this
.
title
=
title
;
this
.
orPay
=
orPay
;
this
.
orderid
=
orderId
;
}
@Override
protected
void
parseData
(
JSONObject
data
)
{
...
...
@@ -34,6 +30,7 @@ public class CustomAttachReceivedMoney extends CustomAttachment {
this
.
title
=
data
.
getString
(
KEY_TITLE
);
this
.
num
=
data
.
getString
(
KEY_NUM
);
this
.
orPay
=
data
.
getInteger
(
KEY_ORPAY
);
this
.
isNewOrder
=
data
.
getBoolean
(
ISNEWORDER
);
}
@Override
...
...
@@ -43,6 +40,7 @@ public class CustomAttachReceivedMoney extends CustomAttachment {
data
.
put
(
KEY_TITLE
,
title
);
data
.
put
(
KEY_NUM
,
num
);
data
.
put
(
KEY_ORPAY
,
orPay
);
data
.
put
(
ISNEWORDER
,
isNewOrder
);
return
data
;
}
...
...
@@ -76,4 +74,13 @@ public class CustomAttachReceivedMoney extends CustomAttachment {
public
void
setOrderId
(
String
orderId
)
{
this
.
orderid
=
orderId
;
}
public
Boolean
getNewOrder
()
{
return
isNewOrder
;
}
public
void
setNewOrder
(
Boolean
newOrder
)
{
isNewOrder
=
newOrder
;
}
}
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderConfirmOrder.java
View file @
968f6e69
...
...
@@ -123,7 +123,7 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
//确认接口
ToastUtil
.
toastShort
(
context
,
"发送中..."
);
String
str
=
new
Gson
().
toJson
(
new
OrderStatusBean
(
serviceId
!=
null
?
serviceId
:
orderId
,
String
.
valueOf
(
flag
)
));
String
str
=
new
Gson
().
toJson
(
new
OrderStatusBean
(
serviceId
!=
null
?
serviceId
:
orderId
,
"3"
));
RequestBody
body
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json; charset=utf-8"
),
str
);
Disposable
subscribe
=
ImRetrofitApi
.
Companion
.
getImRetrofitApi
().
standardOrderServiceOperation
(
body
)
...
...
@@ -201,7 +201,7 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
message
.
setLocalExtension
(
map
);
NIMClient
.
getService
(
MsgService
.
class
).
updateIMMessage
(
message
);
//同时更新历史同订单未确认的消息状态
NIMClient
.
getService
(
MsgService
.
class
).
queryMessageList
(
message
.
get
FromAccount
(),
SessionTypeEnum
.
P2P
,
0
,
100
).
setCallback
(
new
RequestCallback
<
List
<
IMMessage
>>()
{
NIMClient
.
getService
(
MsgService
.
class
).
queryMessageList
(
message
.
get
SessionId
(),
SessionTypeEnum
.
P2P
,
0
,
100
).
setCallback
(
new
RequestCallback
<
List
<
IMMessage
>>()
{
@Override
public
void
onSuccess
(
List
<
IMMessage
>
param
)
{
if
(
param
!=
null
&&
param
.
size
()
>
0
)
{
...
...
@@ -212,11 +212,20 @@ public class MsgViewHolderConfirmOrder extends MsgViewHolderBase {
if
(
customAttachConsultSubScript
.
orderId
.
equals
(
orderId
))
{
//修改历史消息状态为已失效
Map
map1
=
msg
.
getLocalExtension
();
if
(
map1
==
null
)
{
if
(
map1
==
null
)
{
map1
=
new
HashMap
();
map1
.
put
(
"isExpired"
,
true
);
map1
.
put
(
"isExpired"
,
true
);
msg
.
setLocalExtension
(
map1
);
NIMClient
.
getService
(
MsgService
.
class
).
updateIMMessage
(
msg
);
//通知ui刷新
getMsgAdapter
().
updateItemAtLocalExtension
(
msg
);
}
else
{
map1
=
new
HashMap
();
map1
.
put
(
"isExpired"
,
true
);
msg
.
setLocalExtension
(
map1
);
NIMClient
.
getService
(
MsgService
.
class
).
updateIMMessage
(
msg
);
//通知ui刷新
getMsgAdapter
().
updateItemAtLocalExtension
(
msg
);
}
}
}
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderOrderAlreadyDone.java
View file @
968f6e69
...
...
@@ -193,7 +193,7 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
message
.
setLocalExtension
(
map
);
NIMClient
.
getService
(
MsgService
.
class
).
updateIMMessage
(
message
);
//同时更新历史同订单未确认的消息状态
NIMClient
.
getService
(
MsgService
.
class
).
queryMessageList
(
message
.
get
FromAccount
(),
SessionTypeEnum
.
P2P
,
0
,
100
).
setCallback
(
new
RequestCallback
<
List
<
IMMessage
>>()
{
NIMClient
.
getService
(
MsgService
.
class
).
queryMessageList
(
message
.
get
SessionId
(),
SessionTypeEnum
.
P2P
,
0
,
100
).
setCallback
(
new
RequestCallback
<
List
<
IMMessage
>>()
{
@Override
public
void
onSuccess
(
List
<
IMMessage
>
param
)
{
if
(
param
!=
null
&&
param
.
size
()
>
0
)
{
...
...
@@ -204,11 +204,20 @@ public class MsgViewHolderOrderAlreadyDone extends MsgViewHolderBase {
if
(
customAttachConsultSubScript
.
orderId
.
equals
(
orderId
))
{
//修改历史消息状态为已失效
Map
map1
=
msg
.
getLocalExtension
();
if
(
map1
==
null
)
{
if
(
map1
==
null
)
{
map1
=
new
HashMap
();
map1
.
put
(
"isExpired"
,
true
);
map1
.
put
(
"isExpired"
,
true
);
msg
.
setLocalExtension
(
map1
);
NIMClient
.
getService
(
MsgService
.
class
).
updateIMMessage
(
msg
);
//通知ui刷新
getMsgAdapter
().
updateItemAtLocalExtension
(
msg
);
}
else
{
map1
=
new
HashMap
();
map1
.
put
(
"isExpired"
,
true
);
msg
.
setLocalExtension
(
map1
);
NIMClient
.
getService
(
MsgService
.
class
).
updateIMMessage
(
msg
);
//通知ui刷新
getMsgAdapter
().
updateItemAtLocalExtension
(
msg
);
}
}
}
...
...
m-im/src/main/java/com/yidianling/im/session/viewholder/MsgViewHolderReceivedMoney.java
View file @
968f6e69
...
...
@@ -8,6 +8,7 @@ import com.ydl.webview.H5Params;
import
com.ydl.webview.NewH5Activity
;
import
com.ydl.ydlcommon.base.config.HttpConfig
;
import
com.yidianling.im.R
;
import
com.yidianling.im.config.constants.ImConstants
;
import
com.yidianling.im.session.extension.CustomAttachReceivedMoney
;
import
com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter
;
import
com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase
;
...
...
@@ -24,9 +25,10 @@ public class MsgViewHolderReceivedMoney extends MsgViewHolderBase {
private
String
title
;
//订单标题题
private
int
orPay
;
//支付状态 0未支付1已支付
private
String
orderid
;
//订单id
private
Boolean
isNewOrder
;
//是否是新订单
private
View
message_received
;
private
TextView
tit
,
content
;
private
TextView
tit
,
content
;
private
ImageView
img
;
public
MsgViewHolderReceivedMoney
(
BaseMultiItemFetchLoadAdapter
adapter
)
{
...
...
@@ -41,7 +43,7 @@ public class MsgViewHolderReceivedMoney extends MsgViewHolderBase {
@Override
protected
void
inflateContentView
()
{
message_received
=
findViewById
(
R
.
id
.
message_received
);
message_received
=
findViewById
(
R
.
id
.
message_received
);
tit
=
findViewById
(
R
.
id
.
packet_title
);
content
=
findViewById
(
R
.
id
.
text_content
);
img
=
findViewById
(
R
.
id
.
packte_im
);
...
...
@@ -49,20 +51,21 @@ public class MsgViewHolderReceivedMoney extends MsgViewHolderBase {
@Override
protected
void
bindContentView
()
{
CustomAttachReceivedMoney
customAttachReceivedMoney
=
(
CustomAttachReceivedMoney
)
message
.
getAttachment
();
orderid
=
customAttachReceivedMoney
.
getOrderId
();
CustomAttachReceivedMoney
customAttachReceivedMoney
=
(
CustomAttachReceivedMoney
)
message
.
getAttachment
();
orderid
=
customAttachReceivedMoney
.
getOrderId
();
num
=
customAttachReceivedMoney
.
getNum
();
title
=
customAttachReceivedMoney
.
getTitle
();
orPay
=
customAttachReceivedMoney
.
getOrPay
();
num
=
customAttachReceivedMoney
.
getNum
();
isNewOrder
=
customAttachReceivedMoney
.
getNewOrder
();
if
(
title
!=
null
)
tit
.
setText
(
title
);
if
(
title
!=
null
)
tit
.
setText
(
title
);
if
(
orPay
==
1
)
{
//支付成功
if
(
num
!=
null
)
content
.
setText
(
"您支付了"
+
num
+
"元"
);
if
(
num
!=
null
)
content
.
setText
(
"您支付了"
+
num
+
"元"
);
img
.
setImageDrawable
(
view
.
getResources
().
getDrawable
(
R
.
mipmap
.
im_zhifu
));
}
else
{
if
(
num
!=
null
)
content
.
setText
(
"您需要支付"
+
num
+
"元"
);
}
else
{
if
(
num
!=
null
)
content
.
setText
(
"您需要支付"
+
num
+
"元"
);
img
.
setImageDrawable
(
view
.
getResources
().
getDrawable
(
R
.
mipmap
.
im_weifu
));
}
...
...
@@ -72,8 +75,14 @@ public class MsgViewHolderReceivedMoney extends MsgViewHolderBase {
@Override
protected
void
onItemClick
()
{
if
(
isReceivedMessage
())
{
if
(
isNewOrder
)
{
H5Params
orderParams
=
new
H5Params
(
ImConstants
.
Companion
.
getORDER_DETAIL
()
+
(
orderid
.
isEmpty
()
?
""
:
orderid
),
null
);
NewH5Activity
.
start
(
context
,
orderParams
);
}
else
{
NewH5Activity
.
start
(
view
.
getContext
(),
new
H5Params
(
HttpConfig
.
Companion
.
getH5_URL
()
+
"receipt/order?oid="
+
orderid
,
null
));
}
}
}
}
m-im/src/main/java/com/yidianling/uikit/business/session/module/list/MsgAdapter.java
View file @
968f6e69
...
...
@@ -247,4 +247,15 @@ public class MsgAdapter extends BaseMultiItemFetchLoadAdapter<IMMessage, BaseVie
public
Container
getContainer
()
{
return
container
;
}
//刷新某条消息的扩展字段
public
void
updateItemAtLocalExtension
(
IMMessage
imMessage
){
for
(
int
i
=
getData
().
size
()-
1
;
i
>
0
;
i
--)
{
if
(
getData
().
get
(
i
).
isTheSame
(
imMessage
))
{
getData
().
get
(
i
).
setLocalExtension
(
imMessage
.
getLocalExtension
());
notifyItemChanged
(
i
);
return
;
}
}
}
}
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