Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
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
haoban3.0
haoban-manage3.0
Commits
0247c856
Commit
0247c856
authored
Jul 14, 2022
by
songyinghui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 统计活码 sql 修复
parent
1bb9b575
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
8 deletions
+10
-8
HmGroupApiServiceImpl.java
...ge/service/service/out/impl/hm/HmGroupApiServiceImpl.java
+6
-5
TabHaobanHmQrcodeMapper.xml
.../src/main/resources/mapper/hm/TabHaobanHmQrcodeMapper.xml
+2
-2
HmPageServiceTest.java
haoban-manage3-service/src/test/java/HmPageServiceTest.java
+2
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmGroupApiServiceImpl.java
View file @
0247c856
...
...
@@ -115,15 +115,16 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
}
result
.
addAll
(
groupDtoPage
.
getResult
());
List
<
Long
>
groupIds
=
result
.
stream
().
map
(
HmGroupDTO:
:
getGroupId
).
collect
(
Collectors
.
toList
());
List
<
HmQrcodeGroupNumBO
>
qrcodeGroupNumBoList
=
qrcodeService
.
getGroupIdNumByEnterpriseId
(
groupQueryDTO
.
getEnterpriseId
(),
groupIds
);
List
<
HmQrcodeGroupNumBO
>
qrcodeGroupNumBoList
=
qrcodeService
.
getGroupIdNumByEnterpriseId
(
groupQueryDTO
.
getEnterpriseId
(),
groupIds
);
Map
<
Integer
,
Integer
>
qrcodeGroupNumMap
=
Collections
.
emptyMap
();
if
(
CollectionUtils
.
isNotEmpty
(
qrcodeGroupNumBoList
))
{
qrcodeGroupNumMap
=
qrcodeGroupNumBoList
.
stream
()
if
(
CollectionUtils
.
isNotEmpty
(
qrcodeGroupNumBoList
))
{
qrcodeGroupNumMap
=
qrcodeGroupNumBoList
.
stream
()
.
collect
(
Collectors
.
toMap
(
HmQrcodeGroupNumBO:
:
getHmGroupId
,
HmQrcodeGroupNumBO:
:
getNum
,
(
v1
,
v2
)
->
v1
));
}
for
(
HmGroupDTO
groupDTO
:
result
)
{
Integer
referNum
=
Optional
.
ofNullable
(
qrcodeGroupNumMap
.
get
(
groupDTO
.
getGroupId
().
intValue
())).
orElse
(
0
);
groupDTO
.
setReferNum
(
referNum
);
if
(!
DEFAULT_GROUP_ID
.
equals
(
groupDTO
.
getGroupId
())){
if
(!
DEFAULT_GROUP_ID
.
equals
(
groupDTO
.
getGroupId
()))
{
groupDTO
.
setDefaultFlag
(
0
);
}
}
...
...
@@ -151,10 +152,10 @@ public class HmGroupApiServiceImpl implements HmGroupApiService {
}
HmGroupSettingBO
groupSettingBo
=
groupService
.
queryGroupSettingDetail
(
groupDTO
.
getGroupId
());
if
(
groupSettingBo
==
null
||
!
HmGroupStatus
.
ENABLE
.
getCode
().
equals
(
groupSettingBo
.
getStatus
())){
||
!
HmGroupStatus
.
ENABLE
.
getCode
().
equals
(
groupSettingBo
.
getStatus
()))
{
return
ServiceResponse
.
failure
(
HaoBanErrCodeCommon
.
ERR_8
.
getCode
()
+
""
,
HaoBanErrCodeCommon
.
ERR_8
.
getMsg
());
}
if
(
groupSettingBo
.
getReferNum
()
!=
null
&&
groupSettingBo
.
getReferNum
()
>
0
){
if
(
groupSettingBo
.
getReferNum
()
!=
null
&&
groupSettingBo
.
getReferNum
()
>
0
)
{
return
ServiceResponse
.
failure
(
HaoBanErrCode
.
ERR_100033
.
getCode
(),
HaoBanErrCode
.
ERR_100033
.
getMsg
());
}
groupService
.
deleteGroupSetting
(
groupDTO
);
...
...
haoban-manage3-service/src/main/resources/mapper/hm/TabHaobanHmQrcodeMapper.xml
View file @
0247c856
...
...
@@ -324,8 +324,8 @@
</select>
<select
id=
"getGroupIdNumByEnterpriseId"
resultType=
"com.gic.haoban.manage.service.pojo.bo.hm.HmQrcodeGroupNumBO"
>
select hm_group_id,
COUNT(hm_id)
select hm_group_id
as hmGroupId
,
COUNT(hm_id)
as num
from tab_haoban_hm_qrcode
where status_flag != 0
and enterprise_id = #{enterpriseId}
...
...
haoban-manage3-service/src/test/java/HmPageServiceTest.java
View file @
0247c856
...
...
@@ -71,7 +71,8 @@ public class HmPageServiceTest {
@Test
public
void
groupList
(){
HmGroupQueryDTO
groupQueryDTO
=
new
HmGroupQueryDTO
();
groupQueryDTO
.
setGroupName
(
"默认"
);
//groupQueryDTO.setGroupName("默认");
groupQueryDTO
.
setEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
);
ServiceResponse
<
Page
<
HmGroupDTO
>>
pageServiceResponse
=
groupService
.
queryHmGroupSettingList
(
groupQueryDTO
);
System
.
out
.
println
(
JSON
.
toJSONString
(
pageServiceResponse
));
}
...
...
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