增加返回字段

This commit is contained in:
bianyadong
2024-05-09 13:42:23 +08:00
parent 26cc7cd504
commit 57a6fce644
3 changed files with 17 additions and 0 deletions

View File

@@ -38,6 +38,7 @@
u.shop_id as shopId,
u.register_time as registerTime,
s.shop_name as shopName,
u.line_id as lineId,
e.id as employeeTrainingId,
e.assessment_num as assessmentNum,
e.assessment_total_num as assessmentTotalNum,

View File

@@ -15,9 +15,15 @@ public class EmployeeTrainingVO {
@ApiModelProperty("id")
private Long id;
@ApiModelProperty("线索id")
private Long lineId;
@ApiModelProperty("名字")
private String username;
@ApiModelProperty("加盟商名字")
private String franchiseeName;
@ApiModelProperty("手机号")
private String mobile;

View File

@@ -7,6 +7,7 @@ import com.cool.store.dao.*;
import com.cool.store.dto.SmallVideoDTO;
import com.cool.store.dto.SmallVideoInfoDTO;
import com.cool.store.dto.StaffExamInfoDTO;
import com.cool.store.dto.openPreparation.PlanLineDTO;
import com.cool.store.entity.*;
import com.cool.store.enums.AssessmentTemplateType;
import com.cool.store.enums.ExamStatusEnum;
@@ -79,6 +80,9 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
@Resource
private XfsgEhrService xfsgEhrService;
@Resource
private LineInfoDAO lineInfoDAO;
@Override
public PageInfo<EmployeeTrainingVO> employeeTrainingList(String userId, EmployeeTrainingRequest request) {
List<String> authRegionIdList = new ArrayList<>();
@@ -103,6 +107,8 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
List<Long> regionIds = list.stream().map(EmployeeTrainingVO::getRegionId).distinct().collect(Collectors.toList());
List<Long> lineIdList = list.stream().map(EmployeeTrainingVO::getLineId).distinct().collect(Collectors.toList());
List<String> storeIdList = list.stream().map(EmployeeTrainingVO::getTrainingStoreId).distinct().collect(Collectors.toList());
List<StoreDO> storeDOList = storeDAO.getEffectiveStoreByStoreIds(storeIdList);
@@ -117,6 +123,9 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
userIdList.addAll(practicalUserIdList);
}
List<PlanLineDTO> lineInfoList = lineInfoDAO.getLines(lineIdList);
Map<Long, String> lineInfoMap = lineInfoList.stream().collect(Collectors.toMap(PlanLineDTO::getLineId, PlanLineDTO::getUsername));
Map<String, String> userNameMap = enterpriseUserDAO.getUserNameMap(userIdList);
Map<Long, String> regionNameMap = regionService.getBelongWarRegionNameMap(regionIds);
@@ -126,6 +135,7 @@ public class EmployeeTrainingServiceImpl implements EmployeeTrainingService {
item.setTrainingStoreName(storeNameMap.get(item.getTrainingStoreId()));
item.setTrainingTeacherUserName(userNameMap.get(item.getTrainingTeacherUserId()));
item.setPracticalAssessmentUserName(userNameMap.get(item.getPracticalAssessmentUserId()));
item.setFranchiseeName(lineInfoMap.get(item.getLineId()));
});
return new PageInfo<>(list);
}