|
|
@@ -6,6 +6,7 @@ import com.alibaba.excel.read.metadata.ReadSheet;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.sckw.core.common.enums.enums.DictTypeEnum;
|
|
|
import com.sckw.core.common.enums.enums.FileEnum;
|
|
|
@@ -36,6 +37,7 @@ import com.sckw.fleet.model.request.TruckInfoReq;
|
|
|
import com.sckw.fleet.model.vo.*;
|
|
|
import com.sckw.fleet.repository.KwfFleetRepository;
|
|
|
import com.sckw.fleet.repository.KwfFleetTruckRepository;
|
|
|
+import com.sckw.fleet.repository.KwfTruckReportRepository;
|
|
|
import com.sckw.fleet.repository.KwfTruckRepository;
|
|
|
import com.sckw.system.api.RemoteSystemService;
|
|
|
import com.sckw.system.api.RemoteUserService;
|
|
|
@@ -86,6 +88,8 @@ public class KwfTruckService {
|
|
|
KwfTruckImportMapper kwfTruckImportDao;
|
|
|
@Autowired
|
|
|
KwfFleetTruckMapper fleetTruckDao;
|
|
|
+
|
|
|
+ private final KwfTruckReportRepository kwfTruckReportRepository;
|
|
|
private final KwfTruckRepository kwfTruckRepository;
|
|
|
private final KwfFleetRepository kwfFleetRepository;
|
|
|
private final UrlConfigProperties urlConfigProperties;
|
|
|
@@ -264,11 +268,17 @@ public class KwfTruckService {
|
|
|
List<String> dictKey = new ArrayList<>();
|
|
|
|
|
|
for (KwfTruckVo truck : trucks) {
|
|
|
+ //创建人id
|
|
|
createBys.add(Long.parseLong(truck.getCreateBy()));
|
|
|
+ //企业id
|
|
|
entIds.add(Long.parseLong(truck.getEntId()));
|
|
|
+ //车牌颜色
|
|
|
dictKey.add(truck.getColor() != null ? DictTypeEnum.COLOR_TYPE.getType() + pound + truck.getColor() : null);
|
|
|
+ //车辆类型
|
|
|
dictKey.add(truck.getType() != null ? DictTypeEnum.TRUCK_TYPE.getType() + pound + truck.getType() : null);
|
|
|
+ //使用性质
|
|
|
dictKey.add(truck.getUseType() != null ? DictTypeEnum.USE_TYPE.getType() + pound + truck.getUseType() : null);
|
|
|
+ //能源类型
|
|
|
dictKey.add(truck.getEnergyType() != null ? DictTypeEnum.ENERGY_TYPE.getType() + pound + truck.getEnergyType() : null);
|
|
|
}
|
|
|
//用户数据集
|
|
|
@@ -294,10 +304,32 @@ public class KwfTruckService {
|
|
|
truck.setTruckTypeName(type != null ? type.getLabel() : null);
|
|
|
truck.setUseTypeName(useType != null ? useType.getLabel() : null);
|
|
|
truck.setEnergyTypeName(energyType != null ? energyType.getLabel() : null);
|
|
|
+
|
|
|
+ //查询司机信息
|
|
|
+ KwfTruckReport truckReport = getKwfTruckReport(truck, ents);
|
|
|
+ truck.setDriverName(truckReport.getRemark());
|
|
|
}
|
|
|
return trucks;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 根据企业id和车辆id查询司机信息
|
|
|
+ * @param truck
|
|
|
+ * @param ents
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private KwfTruckReport getKwfTruckReport(KwfTruckVo truck, Map<Long, EntCacheResDto> ents) {
|
|
|
+ //查询车辆关联司机信息
|
|
|
+ KwfTruckReport truckReport = kwfTruckReportRepository.getOne(Wrappers.<KwfTruckReport>lambdaQuery()
|
|
|
+ .eq(BaseModel::getDelFlag, 0)
|
|
|
+ .eq(KwfTruckReport::getTruckId, truck.getId())
|
|
|
+ .eq(KwfTruckReport::getEntId, ents.get(Long.parseLong(truck.getEntId()))));
|
|
|
+ if (truckReport == null) {
|
|
|
+ return new KwfTruckReport();
|
|
|
+ }
|
|
|
+ return truckReport;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* @param params 分页参数
|
|
|
* @desc 分页查询
|