|
@@ -9,10 +9,7 @@ import com.example.nngkxxdp.service.SellBuildService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Arrays;
|
|
|
-import java.util.Date;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
@@ -119,6 +116,52 @@ public class SellBuildServiceImpl implements SellBuildService{
|
|
|
List<SellBuild> list = sellBuildDao.queryDataByAddr(query);
|
|
|
return new pageResult<>(totals,list);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public HashMap<Object, Object> newQueryOne(SellBuildQuery query) {
|
|
|
+ HashMap<Object, Object> map = new HashMap<>();
|
|
|
+ HashSet<Object> applicationlist = new HashSet<>();
|
|
|
+ HashSet<Object> parkNames = new HashSet<>();
|
|
|
+ //分割application
|
|
|
+ String applicationsStr = query.getApplication();
|
|
|
+ if (applicationsStr != null && !applicationsStr.isEmpty()) {
|
|
|
+ String[] applications = applicationsStr.split(",");
|
|
|
+ List<String> applicationList = new ArrayList<>(Arrays.asList(applications));
|
|
|
+ query.setApplications(applicationList);
|
|
|
+ }
|
|
|
+ //分割多个园区
|
|
|
+ String parkIdsStr = query.getBelong();
|
|
|
+ if (parkIdsStr != null && !parkIdsStr.isEmpty()) {
|
|
|
+ String[] belongs = parkIdsStr.split(",");
|
|
|
+ List<String> belongList = new ArrayList<>(Arrays.asList(belongs));
|
|
|
+ query.setBelongs(belongList.stream().map(Long::valueOf).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ //分割productModule}
|
|
|
+ String productModuleStr = query.getProductModule();
|
|
|
+ if (productModuleStr != null && !productModuleStr.isEmpty()) {
|
|
|
+ String[] productModules = productModuleStr.split(",");
|
|
|
+ List<String> productModuleList = new ArrayList<>(Arrays.asList(productModules));
|
|
|
+ query.setProductModules(productModuleList);
|
|
|
+ }
|
|
|
+ List<SellBuild> ProductModules=sellBuildDao.findByProductModule(query);
|
|
|
+ //遍历
|
|
|
+ for (SellBuild productModule : ProductModules) {
|
|
|
+ String application = productModule.getApplication();
|
|
|
+ if (application != null && !application.isEmpty()) {
|
|
|
+ String[] applicationsArray = application.split("、");
|
|
|
+ for (String app : applicationsArray) {
|
|
|
+ applicationlist.add(app.trim()); // 去除前后空格
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Long parkId = productModule.getBelong();
|
|
|
+ parkNames.add(parkId);
|
|
|
+ }
|
|
|
+ map.put("sellBuild", ProductModules);
|
|
|
+ map.put("applications", applicationlist);
|
|
|
+ map.put("parkId", parkNames);
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|