Commit eb8bf5d4 authored by 赵啸非's avatar 赵啸非

添加代办员工评价次数

parent 3b9f814d
...@@ -16,6 +16,6 @@ import java.util.Map; ...@@ -16,6 +16,6 @@ import java.util.Map;
public interface StaffDao extends ICRUDDao<StaffEntity,Long>{ public interface StaffDao extends ICRUDDao<StaffEntity,Long>{
Map<String,Integer> getPjTimesByAgent(Long agentUserId); Map<String,Object> getPjTimesByAgent(Long agentUserId);
} }
...@@ -23,7 +23,7 @@ public class StaffDaoImpl extends BaseCRUDDaoMybatis<StaffEntity, Long> implemen ...@@ -23,7 +23,7 @@ public class StaffDaoImpl extends BaseCRUDDaoMybatis<StaffEntity, Long> implemen
@Override @Override
public Map<String,Integer> getPjTimesByAgent(Long agentUserId) { public Map<String,Object> getPjTimesByAgent(Long agentUserId) {
return getSqlSession().selectOne(getSqlId("getPjTimesByAgent"), agentUserId); return getSqlSession().selectOne(getSqlId("getPjTimesByAgent"), agentUserId);
} }
......
...@@ -16,6 +16,7 @@ import com.mortals.xhx.module.evaluation.service.EvaluationInfoService; ...@@ -16,6 +16,7 @@ import com.mortals.xhx.module.evaluation.service.EvaluationInfoService;
import com.mortals.xhx.module.staff.model.StaffQuery; import com.mortals.xhx.module.staff.model.StaffQuery;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import java.math.BigDecimal;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -70,11 +71,15 @@ public class StaffServiceImpl extends AbstractCRUDServiceImpl<StaffDao, StaffEnt ...@@ -70,11 +71,15 @@ public class StaffServiceImpl extends AbstractCRUDServiceImpl<StaffDao, StaffEnt
super.findAfter(params, pageInfo, context, list); super.findAfter(params, pageInfo, context, list);
list.stream().forEach(item->{ list.stream().forEach(item->{
Long userId = item.getUserId(); Long userId = item.getUserId();
Map<String, Integer> pjTimesByAgent = dao.getPjTimesByAgent(userId); Map<String, Object> pjTimesByAgent = dao.getPjTimesByAgent(userId);
if(!ObjectUtils.isEmpty(pjTimesByAgent)){ if(!ObjectUtils.isEmpty(pjTimesByAgent)){
item.setPjTimes(pjTimesByAgent.getOrDefault("times",0));
item.setTotalScore(pjTimesByAgent.getOrDefault("totalScore",0)); Long times = (Long)pjTimesByAgent.getOrDefault("times", 0L);
item.setTotalNum(pjTimesByAgent.getOrDefault("totalNum",0)); Long totalNum = (Long)pjTimesByAgent.getOrDefault("totalNum", 0L);
BigDecimal totalScore = (BigDecimal)pjTimesByAgent.getOrDefault("totalScore", new BigDecimal(0));
item.setPjTimes(times.intValue());
item.setTotalScore(totalScore.intValue());
item.setTotalNum(totalNum.intValue());
} }
}); });
} }
......
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