Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bill-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
bill-platform
Commits
973ccbc1
Commit
973ccbc1
authored
Aug 01, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加统计子站点
parent
3d60a94f
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
22 deletions
+55
-22
bill-manager/src/main/java/com/mortals/xhx/module/access/service/impl/AccessServiceImpl.java
...als/xhx/module/access/service/impl/AccessServiceImpl.java
+46
-19
bill-manager/src/test/java/com/mortals/httpclient/access/AccessController.http
.../java/com/mortals/httpclient/access/AccessController.http
+8
-2
bill-manager/src/test/java/com/mortals/httpclient/system.http
...-manager/src/test/java/com/mortals/httpclient/system.http
+1
-1
No files found.
bill-manager/src/main/java/com/mortals/xhx/module/access/service/impl/AccessServiceImpl.java
View file @
973ccbc1
package
com.mortals.xhx.module.access.service.impl
;
package
com.mortals.xhx.module.access.service.impl
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.module.access.dao.AccessDao
;
import
com.mortals.xhx.module.access.dao.AccessDao
;
import
com.mortals.xhx.module.access.model.AccessEntity
;
import
com.mortals.xhx.module.access.model.AccessEntity
;
import
com.mortals.xhx.module.access.service.AccessService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
com.mortals.xhx.module.access.model.AccessSystemEntity
;
import
com.mortals.xhx.module.access.model.AccessSystemEntity
;
import
com.mortals.xhx.module.access.model.AccessSystemQuery
;
import
com.mortals.xhx.module.access.model.AccessSystemQuery
;
import
com.mortals.xhx.module.access.service.AccessService
;
import
com.mortals.xhx.module.access.service.AccessSystemService
;
import
com.mortals.xhx.module.access.service.AccessSystemService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Date
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
lombok.extern.slf4j.Slf4j
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* AccessService
* AccessService
* 区域接入 service实现
* 区域接入 service实现
*
*
* @author zxfei
* @author zxfei
* @date 2024-07-02
* @date 2024-07-02
*/
*/
@Service
(
"accessService"
)
@Service
(
"accessService"
)
@Slf4j
@Slf4j
public
class
AccessServiceImpl
extends
AbstractCRUDServiceImpl
<
AccessDao
,
AccessEntity
,
Long
>
implements
AccessService
{
public
class
AccessServiceImpl
extends
AbstractCRUDServiceImpl
<
AccessDao
,
AccessEntity
,
Long
>
implements
AccessService
{
@Autowired
@Autowired
private
AccessSystemService
accessSystemService
;
private
AccessSystemService
accessSystemService
;
@Override
protected
void
findAfter
(
AccessEntity
params
,
PageInfo
pageInfo
,
Context
context
,
List
<
AccessEntity
>
list
)
throws
AppException
{
fillSubData
(
list
);
super
.
findAfter
(
params
,
pageInfo
,
context
,
list
);
}
@Override
protected
void
findAfter
(
AccessEntity
params
,
Context
context
,
List
<
AccessEntity
>
list
)
throws
AppException
{
fillSubData
(
list
);
super
.
findAfter
(
params
,
context
,
list
);
}
private
void
fillSubData
(
List
<
AccessEntity
>
list
)
{
List
<
Long
>
idList
=
list
.
stream
().
map
(
i
->
i
.
getId
()).
collect
(
Collectors
.
toList
());
AccessSystemQuery
accessSystemQuery
=
new
AccessSystemQuery
();
accessSystemQuery
.
setAccessIdList
(
idList
);
Map
<
Long
,
List
<
AccessSystemEntity
>>
accessSystemListMap
=
accessSystemService
.
find
(
accessSystemQuery
).
stream
().
collect
(
Collectors
.
groupingBy
(
AccessSystemEntity:
:
getAccessId
));
list
.
forEach
(
item
->
item
.
setAccessSystemList
(
accessSystemListMap
.
get
(
item
.
getId
())));
}
@Override
@Override
protected
void
saveAfter
(
AccessEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
saveAfter
(
AccessEntity
entity
,
Context
context
)
throws
AppException
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getAccessSystemList
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getAccessSystemList
()))
{
entity
.
getAccessSystemList
().
stream
().
peek
(
item
->
{
entity
.
getAccessSystemList
().
stream
().
peek
(
item
->
{
item
.
setAccessId
(
entity
.
getId
());
item
.
setAccessId
(
entity
.
getId
());
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateTime
(
new
Date
());
item
.
setCreateTime
(
new
Date
());
...
@@ -43,10 +70,10 @@ public class AccessServiceImpl extends AbstractCRUDServiceImpl<AccessDao, Access
...
@@ -43,10 +70,10 @@ public class AccessServiceImpl extends AbstractCRUDServiceImpl<AccessDao, Access
@Override
@Override
protected
void
updateAfter
(
AccessEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
updateAfter
(
AccessEntity
entity
,
Context
context
)
throws
AppException
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getAccessSystemList
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getAccessSystemList
()))
{
Long
[]
accessSystemIds
=
accessSystemService
.
find
(
new
AccessSystemQuery
().
accessId
(
entity
.
getId
())).
stream
().
map
(
AccessSystemEntity:
:
getId
).
toArray
(
Long
[]::
new
);
Long
[]
accessSystemIds
=
accessSystemService
.
find
(
new
AccessSystemQuery
().
accessId
(
entity
.
getId
())).
stream
().
map
(
AccessSystemEntity:
:
getId
).
toArray
(
Long
[]::
new
);
accessSystemService
.
remove
(
accessSystemIds
,
context
);
accessSystemService
.
remove
(
accessSystemIds
,
context
);
entity
.
getAccessSystemList
().
stream
().
peek
(
item
->{
entity
.
getAccessSystemList
().
stream
().
peek
(
item
->
{
item
.
setAccessId
(
entity
.
getId
());
item
.
setAccessId
(
entity
.
getId
());
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateUserId
(
this
.
getContextUserId
(
context
));
item
.
setCreateTime
(
new
Date
());
item
.
setCreateTime
(
new
Date
());
...
@@ -61,7 +88,7 @@ public class AccessServiceImpl extends AbstractCRUDServiceImpl<AccessDao, Access
...
@@ -61,7 +88,7 @@ public class AccessServiceImpl extends AbstractCRUDServiceImpl<AccessDao, Access
@Override
@Override
protected
void
removeAfter
(
Long
[]
ids
,
Context
context
,
int
result
)
throws
AppException
{
protected
void
removeAfter
(
Long
[]
ids
,
Context
context
,
int
result
)
throws
AppException
{
List
<
AccessSystemEntity
>
accessSystemlist
=
accessSystemService
.
find
(
new
AccessSystemQuery
().
accessIdList
(
Arrays
.
asList
(
ids
)));
List
<
AccessSystemEntity
>
accessSystemlist
=
accessSystemService
.
find
(
new
AccessSystemQuery
().
accessIdList
(
Arrays
.
asList
(
ids
)));
accessSystemService
.
removeList
(
accessSystemlist
,
context
);
accessSystemService
.
removeList
(
accessSystemlist
,
context
);
super
.
removeAfter
(
ids
,
context
,
result
);
super
.
removeAfter
(
ids
,
context
,
result
);
}
}
}
}
\ No newline at end of file
bill-manager/src/test/java/com/mortals/httpclient/access/AccessController.http
View file @
973ccbc1
...
@@ -35,8 +35,14 @@ Content-Type: application/json
...
@@ -35,8 +35,14 @@ Content-Type: application/json
"bigPath":"5EdNCy",
"bigPath":"5EdNCy",
"tag":"Nu6DiD",
"tag":"Nu6DiD",
"sort":0,
"sort":0,
"remark":"IWuGf0",
"accessSystemList":[{
}
"systemName":"7oX31m",
"systemCode":"aooVxK",
"enabled":0,
"accessTime":"1719504000000",
"sort":0,
"remark":"yIVksS"}],
"remark":"IWuGf0"}
> {%
> {%
client.global.set("Access_id", JSON.parse(response.body).data.id);
client.global.set("Access_id", JSON.parse(response.body).data.id);
...
...
bill-manager/src/test/java/com/mortals/httpclient/system.http
View file @
973ccbc1
...
@@ -66,7 +66,7 @@ POST {{baseUrl}}/stat/stat
...
@@ -66,7 +66,7 @@ POST {{baseUrl}}/stat/stat
Content-Type: application/json
Content-Type: application/json
{
{
"createTimeStart": "202
4
-01-01",
"createTimeStart": "202
3
-01-01",
"createTimeEnd": "2024-07-29"
"createTimeEnd": "2024-07-29"
}
}
...
...
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