Commit 997c3097 by 墨竹

fix:空判断

parent fc359d00
......@@ -104,20 +104,19 @@ public class ClerkController extends WebBaseController {
List<String> staffIds = list.stream().map(StaffClerkRelationDTO::getStaffId).collect(Collectors.toList());
List<StaffDTO> resultlist = staffApiService.listByIds(staffIds);
Map<String, StaffDTO> map = com.gic.commons.util.CollectionUtil.toMap(resultlist, "staffId");
List<StaffVO> resultList = new ArrayList<>();
for (StaffClerkRelationDTO staffClerkRelationDTO : list) {
StaffDTO dto = map.get(staffClerkRelationDTO.getStaffId());
StaffVO vo = EntityUtil.changeEntityByJSON(StaffVO.class, dto);
StaffDTO staffDTO = map.get(staffClerkRelationDTO.getStaffId());
ClerkDTO clerk = clerkService.getClerkByClerkCode(staffClerkRelationDTO.getEnterpriseId(), staffClerkRelationDTO.getClerkCode());
if (clerk != null) {
long memberCount = distributeApiService.getClerkMemberCount(staffClerkRelationDTO.getEnterpriseId(), clerk.getClerkId(), storeId);
logger.info("【获取会员数】enterpriseId={},clerkId={},storeId={},memberCount={}", staffClerkRelationDTO.getEnterpriseId(), clerk.getClerkId(), storeId, memberCount);
if (memberCount != 0) {
vo.setMemberCount(memberCount);
logger.info("会员数为:{}", memberCount);
staffDTO.setMemberCount(memberCount);
}
vo.setClerkId(clerk.getClerkId());
resultList.add(vo);
staffDTO.setClerkId(clerk.getClerkId());
resultList.add(EntityUtil.changeEntityNew(StaffVO.class, staffDTO));
}
}
return resultResponse(HaoBanErrCode.ERR_1, resultList);
......
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