|
|
@@ -91,26 +91,38 @@ public class StatisticController extends TblBaseController {
|
|
|
return R.fail("参数不对");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
Map<String,Object> temp = new HashMap<>();
|
|
|
try{
|
|
|
- TblCarInfoBo bo = new TblCarInfoBo();
|
|
|
- getDepts(dataScopeService,bo);
|
|
|
- if(bo.getParams().get("depts")!=null){
|
|
|
+ if(data.get("depts")!=null || data.get("carnum")!=null) {
|
|
|
+
|
|
|
+
|
|
|
+ TblCarInfoBo bo = new TblCarInfoBo();
|
|
|
+ try {
|
|
|
+ if (data.get("depts") != null) {
|
|
|
+ bo.getParams().put("depts", data.get("depts"));
|
|
|
+ }
|
|
|
+ if (data.get("carnum") != null) {
|
|
|
+ bo.setCarNum(data.get("carnum").toString());
|
|
|
+ }
|
|
|
+ } catch (Exception e) {
|
|
|
+
|
|
|
+ }
|
|
|
+ getDepts(dataScopeService, bo);
|
|
|
List<String> allcodes = new ArrayList<>();
|
|
|
- List<TblCarInfoVo> carInfos = carInfoService.queryList(bo);
|
|
|
-
|
|
|
- carInfos.forEach(carInfo->{
|
|
|
- try{
|
|
|
- JSONUtil.parseArray(carInfo.getDeviceInfos()).toList(JSONObject.class).forEach(deviceInfo -> {
|
|
|
- if(deviceInfo.getStr("type").equals("people_count")){
|
|
|
- allcodes.add(StrUtil.format("'{}'",deviceInfo.getStr("code")));
|
|
|
- }
|
|
|
- });
|
|
|
- }catch (Exception e){}
|
|
|
- });
|
|
|
- temp.put("devicecodes",allcodes.stream().collect(Collectors.joining(",")));
|
|
|
+ List<TblCarInfoVo> carInfos = carInfoService.queryList(bo);
|
|
|
+ if (carInfos.size() > 0) {
|
|
|
+ carInfos.forEach(carInfo -> {
|
|
|
+ try {
|
|
|
+ JSONUtil.parseArray(carInfo.getDeviceInfos()).toList(JSONObject.class).forEach(deviceInfo -> {
|
|
|
+ if (deviceInfo.getStr("type").equals("people_count")) {
|
|
|
+ allcodes.add(StrUtil.format("'{}'", deviceInfo.getStr("code")));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } catch (Exception e) {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ temp.put("devicecodes", allcodes.stream().collect(Collectors.joining(",")));
|
|
|
+ }
|
|
|
}
|
|
|
}catch (Exception e){}
|
|
|
|