Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
yohoufo-fore
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
caoyan
6 years ago
Commit
3c26007cc8b8576762a3027c20c662696abc8f76
2 parents
07fbd392
71d637d0
Merge branch 'dev_物权转移' into test6.8.6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
20 deletions
product/src/main/java/com/yohoufo/product/controller/ProductIdentifyController.java
product/src/main/java/com/yohoufo/product/service/impl/ProductIdentifyServiceImpl.java
product/src/main/java/com/yohoufo/product/controller/ProductIdentifyController.java
View file @
3c26007
...
...
@@ -110,7 +110,7 @@ public class ProductIdentifyController {
}
}
@ApiOperation
(
name
=
"ufo.product.
updateOwnerApply
"
,
desc
=
"确认物权转移"
)
@ApiOperation
(
name
=
"ufo.product.
confirmTransferOwner
"
,
desc
=
"确认物权转移"
)
@ApiParam
(
name
=
"tagId"
,
required
=
true
,
desc
=
"NFC标签id"
,
type
=
Integer
.
class
)
@ApiParam
(
name
=
"nfcUid"
,
required
=
false
,
desc
=
"NFC芯片id"
,
type
=
Integer
.
class
)
@ApiParam
(
name
=
"from_uid"
,
required
=
true
,
desc
=
"当前物权所有人"
,
type
=
Integer
.
class
)
...
...
product/src/main/java/com/yohoufo/product/service/impl/ProductIdentifyServiceImpl.java
View file @
3c26007
...
...
@@ -8,7 +8,6 @@ import java.util.Date;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map.Entry
;
import
java.util.stream.Collectors
;
import
javax.annotation.Resource
;
...
...
@@ -366,7 +365,7 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
TransferRecordsHistory
history
=
transferRecordsHistoryMapper
.
selectByToUid
(
tagId
,
nfcUid
,
null
);
if
(
null
!=
history
&&
(
history
.
getStatus
().
equals
(
OPERATE_TYPE_APPLYING
)))
{
throw
new
GatewayException
(
402
,
"
当前不可
申请"
);
throw
new
GatewayException
(
402
,
"
已存在物权
申请"
);
}
//将申请记录插入数据库
...
...
@@ -390,7 +389,8 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
messageFacade
.
applyToBeOwner
(
insertItem
.
getFromUid
(),
String
.
valueOf
(
uid
),
tagId
,
nfcUid
,
orderCode
);
//发送定时mq
yhProducer
.
send
(
TopicConstants
.
MQ_TOPIC_CONFIRM_OWNER_DELAY
,
insertItem
,
null
,
3
*
24
*
60
);
//3天
// yhProducer.send(TopicConstants.MQ_TOPIC_CONFIRM_OWNER_DELAY, insertItem, null, 3*24*60);//3天
yhProducer
.
send
(
TopicConstants
.
MQ_TOPIC_CONFIRM_OWNER_DELAY
,
insertItem
,
null
,
5
);
return
result
;
}
...
...
@@ -513,9 +513,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
//申请人申请状态
TransferRecordsHistory
history
=
transferRecordsHistoryMapper
.
selectByToUid
(
tagId
,
nfcUid
,
null
);
if
(
null
==
history
||
!
history
.
getStatus
().
equals
(
OPERATE_TYPE_APPLYING
)
)
{
if
(
null
==
history
)
{
result
.
setApplyStatus
(
OPERATE_TYPE_NO_APPLY
);
//未申请
}
else
if
(!(
history
.
getToUid
().
equals
(
String
.
valueOf
(
uid
))))
{
}
else
if
(
history
.
getStatus
().
equals
(
OPERATE_TYPE_APPLYING
)
&&
!(
history
.
getToUid
().
equals
(
String
.
valueOf
(
uid
))))
{
result
.
setApplyStatus
(
OPERATE_TYPE_CANNOT_APPLY
);
return
;
}
else
{
...
...
@@ -570,11 +570,9 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
//2)第二部分:历史物权所有人,按时间顺序排列
List
<
TransferRecords
>
transferList
=
transferRecordsMapper
.
selectByTagIdAndNfcUid
(
identifyRecord
.
getTagId
(),
identifyRecord
.
getNfcUid
());
List
<
String
>
ownerUidList
=
transferList
.
stream
().
map
(
TransferRecords:
:
getToUid
).
collect
(
Collectors
.
toList
());
List
<
String
>
allUidList
=
Lists
.
newArrayList
();
allUidList
.
addAll
(
ownerUidList
);
//查询头像和手机号
Map
<
Integer
,
ProfileInfoRsp
>
profileMap
=
userInfoProxyService
.
queryIcoAndMobile
(
all
UidList
);
Map
<
Integer
,
ProfileInfoRsp
>
profileMap
=
userInfoProxyService
.
queryIcoAndMobile
(
owner
UidList
);
List
<
IdentifyTrackResp
>
historyTrackList
=
buildTransferTrackList
(
profileMap
,
transferList
);
trackRespList
.
addAll
(
historyTrackList
);
...
...
@@ -583,24 +581,21 @@ public class ProductIdentifyServiceImpl implements ProductIdentifyService{
private
List
<
IdentifyTrackResp
>
buildTransferTrackList
(
Map
<
Integer
,
ProfileInfoRsp
>
profileMap
,
List
<
TransferRecords
>
transferList
)
{
List
<
IdentifyTrackResp
>
trackList
=
Lists
.
newArrayList
();
Map
<
String
,
TransferRecords
>
transferMap
=
transferList
.
stream
().
collect
(
Collectors
.
toMap
(
TransferRecords:
:
getToUid
,
t
->
t
));
for
(
Entry
<
Integer
,
ProfileInfoRsp
>
entry
:
profileMap
.
entrySet
())
{
for
(
TransferRecords
record
:
transferList
)
{
IdentifyTrackResp
item
=
new
IdentifyTrackResp
();
item
.
setUid
(
entry
.
getKey
());
String
mobileMask
=
MobileHelper
.
coverMobile2
(
entry
.
getValue
().
getMobile
());
//隐位的手机号码--隐藏中间6位
item
.
setContent
(
StringUtils
.
isEmpty
(
entry
.
getValue
().
getNickname
())
?
mobileMask
:
entry
.
getValue
().
getNickname
());
String
headIcon
=
entry
.
getValue
().
getHead_ico
();
Integer
toUid
=
Integer
.
parseInt
(
record
.
getToUid
());
item
.
setUid
(
toUid
);
String
mobileMask
=
MobileHelper
.
coverMobile2
(
profileMap
.
get
(
toUid
).
getMobile
());
//隐位的手机号码--隐藏中间6位
item
.
setContent
(
StringUtils
.
isEmpty
(
profileMap
.
get
(
toUid
).
getNickname
())
?
mobileMask
:
profileMap
.
get
(
toUid
).
getNickname
());
String
headIcon
=
profileMap
.
get
(
toUid
).
getHead_ico
();
if
(
DEFAULT_HEAD_IMG
.
equals
(
headIcon
)
||
StringUtils
.
isBlank
(
headIcon
)){
//有货的默认头像
//ufo 用户的默认头像
headIcon
=
configReader
.
getString
(
"ufo.product.defaultUserHeadIcon"
,
"http://head.static.yhbimg.com/yhb-head/2018/12/28/14/0160773bb87685aade796ea4f94e0587cf.png?imageView2/{mode}/w/{width}/h/{height}"
);
}
item
.
setHeadIcon
(
headIcon
);
item
.
setType
(
MESSAGE_TYPE_EX_OWNER
);
if
(
null
!=
transferMap
.
get
(
String
.
valueOf
(
entry
.
getKey
())))
{
Integer
createTime
=
transferMap
.
get
(
String
.
valueOf
(
entry
.
getKey
())).
getCreateTime
();
item
.
setTime
(
createTime
);
item
.
setTimeStr
(
formatDate
(
createTime
,
"yyyy.MM.dd HH:mm:ss"
));
}
item
.
setTime
(
record
.
getCreateTime
());
item
.
setTimeStr
(
formatDate
(
record
.
getCreateTime
(),
"yyyy.MM.dd HH:mm:ss"
));
trackList
.
add
(
item
);
}
...
...
Please
register
or
login
to post a comment