下拉数据-全部和分车型(不含年款)

This commit is contained in:
zhn
2023-08-17 20:55:34 +08:00
parent 3c1d347e74
commit 78dd252a78
3 changed files with 55 additions and 5 deletions
@@ -81,9 +81,9 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
*/
@AutoLog(value = "下拉数据-软件版本,适用车型,市场")
@ApiOperation(value="下拉数据-软件版本,适用车型,市场", notes="下拉数据-软件版本,适用车型,市场")
@GetMapping(value = "/getOtaCarList")
public Result<?> getOtaCarList() {
Map<String, Object> result = otaManageApplyEOService.getOtaCarList();
@GetMapping(value = "/getPullDownList")
public Result<?> getPullDownList() {
Map<String, Object> result = otaManageApplyEOService.getPullDownList();
return Result.OK(result);
}
@@ -141,4 +141,12 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
return super.exportXls(request, otaManageApplyEO, OtaManageApplyEO.class, "数据对接表");
}
@AutoLog(value = "下拉数据-全部和分车型(不含年款)")
@ApiOperation(value="下拉数据-全部和分车型(不含年款)", notes="下拉数据-全部和分车型(不含年款)")
@GetMapping(value = "/getCarList")
public Result<?> getCarList() {
List<String> result = otaManageApplyEOService.getCarList();
return Result.OK(result);
}
}
@@ -84,5 +84,11 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
* 下拉数据-软件版本,适用车型,市场
* @return
*/
Map<String,Object> getOtaCarList();
Map<String,Object> getPullDownList();
/**
下拉数据-全部和分车型(不含年款)
* @return
*/
List<String> getCarList();
}
@@ -24,6 +24,7 @@ import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -222,7 +223,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
* @return
*/
@Override
public Map<String,Object> getOtaCarList() {
public Map<String,Object> getPullDownList() {
List<OtaManageApplyEO> otaManageApplyEOS = otaManageApplyEOMapper.getOtaCarList();
Map<String,Object> result = new HashMap<>();
if(!otaManageApplyEOS.isEmpty()){
@@ -262,4 +263,39 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
}
return result;
}
/**
* 下拉数据-全部和分车型(不含年款)
* @return
*/
@Override
public List<String> getCarList() {
List<OtaManageApplyEO> otaManageApplyEOS = otaManageApplyEOMapper.getOtaCarList();
List<String> result = new LinkedList<>();
result.add("全部");
if(!otaManageApplyEOS.isEmpty()){
//适用车型 appliedVehicleProject
List<String> appliedVehicleProjectList = otaManageApplyEOS.stream()
.filter(e -> StringUtils.isNotBlank(e.getAppliedVehicleProject()))
.map(OtaManageApplyEO::getAppliedVehicleProject).distinct().collect(Collectors.toList());
//过滤掉特殊的适用车型
// List<String> otaNameList = OtaCarEnum.getOtaNameList();
Set<String> carSet = new HashSet<>();//适用车型
Set<String> marketSet = new HashSet<>();//市场
for (String appliedVehicleProject : appliedVehicleProjectList) {
for (String s : appliedVehicleProject.split(",")) {
String[] split = s.split(" ");
if (split.length == 2) {
result.add(s);
} else if (split.length == 3) {
result.add(split[0]+" "+split[2]);
}
}
}
}
result = result.stream().distinct().collect(Collectors.toList());
return result;
}
}