Commit 394b9780 authored by 赵啸非's avatar 赵啸非

更新评价统计计算

parent 9957bb62
......@@ -56,9 +56,9 @@ public class DeclareController extends BaseCRUDJsonBodyMappingController<Declare
@Override
protected void doListBefore(DeclareEntity query, Map<String, Object> model, Context context) throws AppException {
//如果是管理员,如果参数中有代办人查询 删除
if (context.getUser() != null && context.getUser().isAdmin()) {
query.setAgentUserId(null);
//如果登录用户是代办人 添加查询参数
if (context.getUser() != null && context.getUser().getCustomerId()!=null) {
query.setAgentUserId(this.getContextUserId(context));
}
super.doListBefore(query, model, context);
}
......
......@@ -38,11 +38,22 @@ public class EvaluationInfoServiceImpl extends AbstractCRUDServiceImpl<Evaluatio
@Override
protected void saveAfter(EvaluationInfoEntity entity, Context context) throws AppException {
if (updateStaffScore(entity, context)) return;
super.saveAfter(entity, context);
}
private boolean updateStaffScore(EvaluationInfoEntity entity, Context context) {
//更新代办人累计评分
if(ObjectUtils.isEmpty(entity.getDeclareId())) return;
if(ObjectUtils.isEmpty(entity.getDeclareId())) return true;
DeclareEntity declareEntity = declareService.get(entity.getDeclareId(), context);
if (ObjectUtils.isEmpty(declareEntity)) return;
if (ObjectUtils.isEmpty(declareEntity)) return true;
staffService.updateAgentUserTotalScore(declareEntity.getAgentUserId(), context);
super.saveAfter(entity, context);
return false;
}
@Override
protected void updateAfter(EvaluationInfoEntity entity, Context context) throws AppException {
if (updateStaffScore(entity, context)) return;
super.updateAfter(entity, context);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment