|
|
|
|
@ -6,10 +6,7 @@ import com.github.pagehelper.PageHelper;
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
import com.zhehekeji.core.util.Assert;
|
|
|
|
|
import com.zhehekeji.web.config.ConfigProperties;
|
|
|
|
|
import com.zhehekeji.web.entity.LightSource;
|
|
|
|
|
import com.zhehekeji.web.entity.RFID;
|
|
|
|
|
import com.zhehekeji.web.entity.SensorGun;
|
|
|
|
|
import com.zhehekeji.web.entity.Street;
|
|
|
|
|
import com.zhehekeji.web.entity.*;
|
|
|
|
|
import com.zhehekeji.web.mapper.LightSourceMapper;
|
|
|
|
|
import com.zhehekeji.web.mapper.RFIDMapper;
|
|
|
|
|
import com.zhehekeji.web.mapper.SensorGunMapper;
|
|
|
|
|
@ -34,6 +31,7 @@ import java.util.ArrayList;
|
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
|
|
|
|
@Service
|
|
|
|
|
@Slf4j
|
|
|
|
|
@ -248,4 +246,16 @@ public class StreetService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public List<StreetVO> streetStockStatus() {
|
|
|
|
|
List<Stock> stockList = stockService.list();
|
|
|
|
|
Map<Integer, Map<Integer, Long>> map = stockList.stream().collect(Collectors.groupingBy(Stock::getStreetId,Collectors.groupingBy(Stock::getStatus,Collectors.counting())));
|
|
|
|
|
List<StreetVO> streetVOList = list();
|
|
|
|
|
for(StreetVO streetVO :streetVOList){
|
|
|
|
|
if(map.get(streetVO.getId()) != null && map.get(streetVO.getId()).get(0) != null){
|
|
|
|
|
streetVO.setStatusCount(map.get(streetVO.getId()).get(0));
|
|
|
|
|
}else streetVO.setStatusCount(0L);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return streetVOList ;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|