Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
agent-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
赵啸非
agent-platform
Commits
9957bb62
Commit
9957bb62
authored
May 09, 2025
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新评价统计计算
parent
429ba8ee
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
8 deletions
+98
-8
agent-manager/src/main/java/com/mortals/xhx/module/declare/service/impl/DeclareServiceImpl.java
...s/xhx/module/declare/service/impl/DeclareServiceImpl.java
+3
-0
agent-manager/src/main/java/com/mortals/xhx/module/evaluation/service/impl/EvaluationInfoServiceImpl.java
...le/evaluation/service/impl/EvaluationInfoServiceImpl.java
+31
-7
agent-manager/src/main/java/com/mortals/xhx/module/staff/service/StaffService.java
...va/com/mortals/xhx/module/staff/service/StaffService.java
+8
-0
agent-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
...rtals/xhx/module/staff/service/impl/StaffServiceImpl.java
+56
-1
No files found.
agent-manager/src/main/java/com/mortals/xhx/module/declare/service/impl/DeclareServiceImpl.java
View file @
9957bb62
...
@@ -294,6 +294,9 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
...
@@ -294,6 +294,9 @@ public class DeclareServiceImpl extends AbstractCRUDServiceImpl<DeclareDao, Decl
}
}
declareFinImagesService
.
save
(
query
.
getDeclareFinImagesList
());
declareFinImagesService
.
save
(
query
.
getDeclareFinImagesList
());
}
}
staffService
.
updateAgentUserRecordNum
(
declareEntity
.
getAgentUserId
(),
context
);
return
Rest
.
ok
(
"办结工作成功!"
);
return
Rest
.
ok
(
"办结工作成功!"
);
}
}
}
}
\ No newline at end of file
agent-manager/src/main/java/com/mortals/xhx/module/evaluation/service/impl/EvaluationInfoServiceImpl.java
View file @
9957bb62
package
com.mortals.xhx.module.evaluation.service.impl
;
package
com.mortals.xhx.module.evaluation.service.impl
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.xhx.module.declare.model.DeclareEntity
;
import
com.mortals.xhx.module.declare.service.DeclareService
;
import
com.mortals.xhx.module.staff.service.StaffService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.exception.AppException
;
...
@@ -10,15 +18,31 @@ import com.mortals.xhx.module.evaluation.dao.EvaluationInfoDao;
...
@@ -10,15 +18,31 @@ import com.mortals.xhx.module.evaluation.dao.EvaluationInfoDao;
import
com.mortals.xhx.module.evaluation.model.EvaluationInfoEntity
;
import
com.mortals.xhx.module.evaluation.model.EvaluationInfoEntity
;
import
com.mortals.xhx.module.evaluation.service.EvaluationInfoService
;
import
com.mortals.xhx.module.evaluation.service.EvaluationInfoService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.ObjectUtils
;
/**
/**
* EvaluationInfoService
* EvaluationInfoService
* 用户代办帮办评价 service实现
* 用户代办帮办评价 service实现
*
*
* @author zxfei
* @author zxfei
* @date 2025-04-27
* @date 2025-04-27
*/
*/
@Service
(
"evaluationInfoService"
)
@Service
(
"evaluationInfoService"
)
@Slf4j
@Slf4j
public
class
EvaluationInfoServiceImpl
extends
AbstractCRUDServiceImpl
<
EvaluationInfoDao
,
EvaluationInfoEntity
,
Long
>
implements
EvaluationInfoService
{
public
class
EvaluationInfoServiceImpl
extends
AbstractCRUDServiceImpl
<
EvaluationInfoDao
,
EvaluationInfoEntity
,
Long
>
implements
EvaluationInfoService
{
@Autowired
private
DeclareService
declareService
;
@Autowired
private
StaffService
staffService
;
@Override
protected
void
saveAfter
(
EvaluationInfoEntity
entity
,
Context
context
)
throws
AppException
{
//更新代办人累计评分
if
(
ObjectUtils
.
isEmpty
(
entity
.
getDeclareId
()))
return
;
DeclareEntity
declareEntity
=
declareService
.
get
(
entity
.
getDeclareId
(),
context
);
if
(
ObjectUtils
.
isEmpty
(
declareEntity
))
return
;
staffService
.
updateAgentUserTotalScore
(
declareEntity
.
getAgentUserId
(),
context
);
super
.
saveAfter
(
entity
,
context
);
}
}
}
\ No newline at end of file
agent-manager/src/main/java/com/mortals/xhx/module/staff/service/StaffService.java
View file @
9957bb62
package
com.mortals.xhx.module.staff.service
;
package
com.mortals.xhx.module.staff.service
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.framework.service.ICRUDService
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.model.StaffEntity
;
import
com.mortals.xhx.module.staff.dao.StaffDao
;
import
com.mortals.xhx.module.staff.dao.StaffDao
;
...
@@ -13,4 +15,10 @@ import com.mortals.xhx.module.staff.dao.StaffDao;
...
@@ -13,4 +15,10 @@ import com.mortals.xhx.module.staff.dao.StaffDao;
public
interface
StaffService
extends
ICRUDService
<
StaffEntity
,
Long
>{
public
interface
StaffService
extends
ICRUDService
<
StaffEntity
,
Long
>{
StaffDao
getDao
();
StaffDao
getDao
();
Rest
<
Void
>
updateAgentUserRecordNum
(
Long
agentUserId
,
Context
context
);
Rest
<
Void
>
updateAgentUserTotalScore
(
Long
agentUserId
,
Context
context
);
}
}
\ No newline at end of file
agent-manager/src/main/java/com/mortals/xhx/module/staff/service/impl/StaffServiceImpl.java
View file @
9957bb62
package
com.mortals.xhx.module.staff.service.impl
;
package
com.mortals.xhx.module.staff.service.impl
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.model.PageInfo
;
import
com.mortals.framework.util.SecurityUtil
;
import
com.mortals.framework.util.SecurityUtil
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.model.UserEntity
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.base.system.user.service.UserService
;
import
com.mortals.xhx.common.code.DeclareStatusEnum
;
import
com.mortals.xhx.module.declare.model.DeclareQuery
;
import
com.mortals.xhx.module.declare.service.DeclareService
;
import
com.mortals.xhx.module.evaluation.model.EvaluationInfoEntity
;
import
com.mortals.xhx.module.evaluation.model.EvaluationInfoQuery
;
import
com.mortals.xhx.module.evaluation.service.EvaluationInfoService
;
import
com.mortals.xhx.module.staff.model.StaffQuery
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
java.util.List
;
import
java.util.function.Function
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -31,6 +41,11 @@ import org.springframework.util.ObjectUtils;
...
@@ -31,6 +41,11 @@ import org.springframework.util.ObjectUtils;
public
class
StaffServiceImpl
extends
AbstractCRUDServiceImpl
<
StaffDao
,
StaffEntity
,
Long
>
implements
StaffService
{
public
class
StaffServiceImpl
extends
AbstractCRUDServiceImpl
<
StaffDao
,
StaffEntity
,
Long
>
implements
StaffService
{
@Autowired
@Autowired
private
UserService
userService
;
private
UserService
userService
;
@Autowired
private
DeclareService
declareService
;
@Autowired
private
EvaluationInfoService
evaluationInfoService
;
@Override
@Override
...
@@ -82,7 +97,7 @@ public class StaffServiceImpl extends AbstractCRUDServiceImpl<StaffDao, StaffEnt
...
@@ -82,7 +97,7 @@ public class StaffServiceImpl extends AbstractCRUDServiceImpl<StaffDao, StaffEnt
protected
void
updateAfter
(
StaffEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
updateAfter
(
StaffEntity
entity
,
Context
context
)
throws
AppException
{
//更新用户
//更新用户
UserEntity
userEntity
=
userService
.
get
(
entity
.
getUserId
(),
context
);
UserEntity
userEntity
=
userService
.
get
(
entity
.
getUserId
(),
context
);
if
(!
ObjectUtils
.
isEmpty
(
userEntity
))
{
if
(!
ObjectUtils
.
isEmpty
(
userEntity
))
{
userEntity
.
setLoginName
(
entity
.
getLoginName
());
userEntity
.
setLoginName
(
entity
.
getLoginName
());
String
password
=
null
;
String
password
=
null
;
try
{
try
{
...
@@ -100,4 +115,44 @@ public class StaffServiceImpl extends AbstractCRUDServiceImpl<StaffDao, StaffEnt
...
@@ -100,4 +115,44 @@ public class StaffServiceImpl extends AbstractCRUDServiceImpl<StaffDao, StaffEnt
super
.
updateAfter
(
entity
,
context
);
super
.
updateAfter
(
entity
,
context
);
}
}
@Override
public
Rest
<
Void
>
updateAgentUserRecordNum
(
Long
agentUserId
,
Context
context
)
{
StaffEntity
staffEntity
=
this
.
selectOne
(
new
StaffQuery
().
userId
(
agentUserId
),
context
);
// StaffEntity staffEntity = this.get(agentUserId, context);
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
throw
new
AppException
(
"用户不存在"
);
DeclareQuery
declareQuery
=
new
DeclareQuery
();
declareQuery
.
setAgentUserId
(
staffEntity
.
getUserId
());
declareQuery
.
setDeclareStatus
(
DeclareStatusEnum
.
完结
.
getValue
());
int
count
=
declareService
.
count
(
declareQuery
,
context
);
staffEntity
.
setTotalNum
(
count
);
dao
.
update
(
staffEntity
);
return
Rest
.
ok
();
}
@Override
public
Rest
<
Void
>
updateAgentUserTotalScore
(
Long
agentUserId
,
Context
context
)
{
StaffEntity
staffEntity
=
this
.
selectOne
(
new
StaffQuery
().
userId
(
agentUserId
),
context
);
if
(
ObjectUtils
.
isEmpty
(
staffEntity
))
throw
new
AppException
(
"用户不存在"
);
DeclareQuery
declareQuery
=
new
DeclareQuery
();
declareQuery
.
setAgentUserId
(
agentUserId
);
declareQuery
.
setDeclareStatus
(
DeclareStatusEnum
.
完结
.
getValue
());
List
<
Long
>
declareIdList
=
declareService
.
find
(
declareQuery
).
stream
().
map
(
i
->
i
.
getId
()).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
declareIdList
)){
EvaluationInfoQuery
evaluationInfoQuery
=
new
EvaluationInfoQuery
();
evaluationInfoQuery
.
setDeclareIdList
(
declareIdList
);
int
sum
=
(
int
)
evaluationInfoService
.
find
(
evaluationInfoQuery
,
context
)
.
stream
().
collect
(
Collectors
.
summarizingInt
(
EvaluationInfoEntity:
:
getScore
)).
getSum
();
staffEntity
.
setTotalScore
(
sum
);
dao
.
update
(
staffEntity
);
}
return
Rest
.
ok
();
}
}
}
\ No newline at end of file
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