修改问题。

dev_0531
kevin jiang 6 years ago
parent 11d4160682
commit 9bb0750757

@ -24,6 +24,7 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;
@ -396,7 +397,7 @@ public class RetailCompanyService {
organizationalVO.setDelRate(check(new Long(allAge), count));
}
Integer avgStoreCustomer = organizationalVO.getAllCustomer() / stores.size();
Integer avgStoreCustomer = new BigDecimal(organizationalVO.getAllCustomer()).divide(new BigDecimal(stores.size()), BigDecimal.ROUND_HALF_UP).intValue();
organizationalVO.setAvgStoreCustomer(avgStoreCustomer);
list.add(organizationalVO);
});

@ -18,6 +18,8 @@ import java.util.HashSet;
import java.util.List;
import java.util.Set;
import static java.util.stream.Collectors.toList;
/**
*
*/
@ -83,4 +85,25 @@ public class PoiStoreService {
List<PoiStore> baseShopDOS = poiStoreDOMapper.selectList(null);
return baseShopDOS;
}
/**
* id
* @param companyId ID
*/
public List<PoiStore> getStoreByCompanyId(long userId,Long companyId){
List<PoiStore> poiStores = new ArrayList<>();
//找到店铺集合
List<Long> shopsIds = privilageDomainService.listUserDatePermission(userId);
if(!companyId.equals(0L)){
Set<Long> shops = customerViewService.getCompanyShop(companyId,userId);
if(shops.size() > 0){
List<PoiStore> regionPoiStores = poiStoreDOMapper.selectBatchIds(shops);
List<PoiStore> intersection = regionPoiStores.stream().filter(item -> shops.contains(item.getId())).collect(toList());
return intersection;
}
}else{
poiStores = poiStoreDOMapper.selectBatchIds(shopsIds);
}
return poiStores;
}
}

Loading…
Cancel
Save