|
|
@@ -3,10 +3,7 @@ package com.sckw.fleet.service;
|
|
|
import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
|
import com.sckw.core.exception.SystemException;
|
|
|
import com.sckw.core.model.constant.Global;
|
|
|
-import com.sckw.core.utils.BeanUtils;
|
|
|
-import com.sckw.core.utils.CollectionUtils;
|
|
|
-import com.sckw.core.utils.RegularUtils;
|
|
|
-import com.sckw.core.utils.StringUtils;
|
|
|
+import com.sckw.core.utils.*;
|
|
|
import com.sckw.core.web.constant.HttpStatus;
|
|
|
import com.sckw.core.web.context.LoginUserHolder;
|
|
|
import com.sckw.core.web.response.HttpResult;
|
|
|
@@ -29,6 +26,7 @@ import com.sckw.system.api.model.dto.res.UserCacheResDto;
|
|
|
import org.apache.dubbo.config.annotation.DubboReference;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.util.ArrayList;
|
|
|
@@ -173,6 +171,32 @@ public class KwfTruckReportService {
|
|
|
return HttpResult.ok(truckReportDao.findList(params));
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @param params {。。。}
|
|
|
+ * @desc 上报车辆业务状态统计
|
|
|
+ * @author zk
|
|
|
+ * @date 2023/7/6
|
|
|
+ **/
|
|
|
+ public HttpResult busStatusStatistics(@RequestBody HashMap params) throws SystemException {
|
|
|
+ params.put("entId", LoginUserHolder.getEntId());
|
|
|
+ List<Map<String, Object>> trucks = truckReportDao.findList(params);
|
|
|
+ /**全部数据-处理**/
|
|
|
+ List<KwfTableTopCount> countList = new ArrayList();
|
|
|
+ countList.add(new KwfTableTopCount("全部", null, trucks != null ? trucks.size() : 0));
|
|
|
+
|
|
|
+ //状态数据计算
|
|
|
+ int idle = 0;
|
|
|
+ for (Map<String, Object> truck:trucks) {
|
|
|
+ Object obj = truck.get("businessStatus");
|
|
|
+ if (StringUtils.isNotBlank(obj) && NumberUtils.parseInt(obj) == 0) {
|
|
|
+ idle ++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ countList.add(new KwfTableTopCount("空闲", String.valueOf(0), idle));
|
|
|
+ countList.add(new KwfTableTopCount("任务", String.valueOf(1), trucks != null ? (trucks.size() - idle) : 0));
|
|
|
+ return HttpResult.ok(countList);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param {}
|
|
|
* @description 导出
|