diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java index f6f7a632..5e2b56fa 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/bigscreen/controller/ProjectBigScreenController.java @@ -24,6 +24,7 @@ import org.dromara.land.domain.BusLandTransferLedger; import org.dromara.land.service.IBusLandBlockService; import org.dromara.land.service.IBusLandTransferLedgerService; import org.dromara.manager.weathermanager.vo.WeatherVo; +import org.dromara.other.domain.OthYs7Device; import org.dromara.other.service.IOthYs7DeviceService; import org.dromara.project.domain.BusProject; import org.dromara.project.domain.vo.project.BusProjectSafetyDayVo; @@ -274,16 +275,16 @@ public class ProjectBigScreenController { public R>> getClientList(@NotNull(message = "主键不能为空") @PathVariable Long projectId) { List voList = gpsEquipmentService.getClientList(projectId); -// List othYs7DeviceList = othYs7DeviceService.lambdaQuery() -// .eq(OthYs7Device::getProjectId, projectId) -// .list(); + List othYs7DeviceList = othYs7DeviceService.lambdaQuery() + .eq(OthYs7Device::getProjectId, projectId) + .list(); List> maps = new ArrayList<>(); Map gpsMap = new HashMap<>(); Map wrjMap = new HashMap<>(); Map sxtMap = new HashMap<>(); List> gpsChildrenMap = new ArrayList<>(); -// List> wrjChildrenMap = new ArrayList<>(); -// List> sxtChildrenMap = new ArrayList<>(); + List> wrjChildrenMap = new ArrayList<>(); + List> sxtChildrenMap = new ArrayList<>(); if (voList != null && !voList.isEmpty()) { for (GpsEquipmentSonVo item : voList) { Map gps = new HashMap<>(); @@ -297,20 +298,20 @@ public class ProjectBigScreenController { gpsChildrenMap.add(gps); } } -// if (othYs7DeviceList != null && !othYs7DeviceList.isEmpty()) { -// for (OthYs7Device item : othYs7DeviceList) { -// Map sxt = new HashMap<>(); -// sxt.put("id", item.getDeviceSerial()); -// sxt.put("label", item.getDeviceSerial()); -// sxt.put("name", item.getDeviceName()); -// sxt.put("type", "shexiangtou"); -//// sxt.put("lat", item.getLocLatitude()); -//// sxt.put("lng", item.getLocLongitude()); -//// sxt.put("alt", item.getLocAltitude()); -// sxtChildrenMap.add(sxt); -// } -// } - List> maps1 = setSxt(); + if (othYs7DeviceList != null && !othYs7DeviceList.isEmpty()) { + for (OthYs7Device item : othYs7DeviceList) { + Map sxt = new HashMap<>(); + sxt.put("id", item.getDeviceSerial()); + sxt.put("label", item.getDeviceSerial()); + sxt.put("name", item.getDeviceName()); + sxt.put("type", "shexiangtou"); + sxt.put("lat", item.getLatitude()); + sxt.put("lng", item.getLongitude()); + sxt.put("alt", item.getAltitude()); + sxtChildrenMap.add(sxt); + } + } +// List> maps1 = setSxt(); List> maps2 = setWrj(); gpsMap.put("id", 1); @@ -318,8 +319,8 @@ public class ProjectBigScreenController { gpsMap.put("children", gpsChildrenMap); sxtMap.put("id", 2); sxtMap.put("label", "摄像头"); -// sxtMap.put("children",sxtChildrenMap); - sxtMap.put("children", maps1); + sxtMap.put("children",sxtChildrenMap); +// sxtMap.put("children", maps1); wrjMap.put("id", 3); wrjMap.put("label", "无人机"); // wrjMap.put("children",wrjChildrenMap); @@ -354,111 +355,111 @@ public class ProjectBigScreenController { } - public List> setSxt() { - List> sxtChildrenMap = new ArrayList<>(); - HashMap map1 = new HashMap<>(); - map1.put("id", "55"); - map1.put("label", "那荷4号方阵-1"); - map1.put("name", "22"); - map1.put("type", "camera"); - map1.put("lng", 107.111325); - map1.put("lat", 23.820919); - map1.put("alt", 0); - HashMap map2 = new HashMap<>(); - map2.put("id", "56"); - map2.put("label", "甫必 1号方阵"); - map2.put("name", "23"); - map2.put("type", "camera"); - map2.put("lng", 107.091297); - map2.put("lat", 23.813567); - map2.put("alt", 0); - HashMap map3 = new HashMap<>(); - map3.put("id", "57"); - map3.put("label", "1222224"); - map3.put("name", "24"); - map3.put("type", "camera"); - map3.put("lng", 107.085442); - map3.put("lat", 23.811958); - map3.put("alt", 0); - HashMap map4 = new HashMap<>(); - map4.put("id", "58"); - map4.put("label", "甫必2号方阵-1"); - map4.put("name", "25"); - map4.put("type", "camera"); - map4.put("lng", 107.085181); - map4.put("lat", 23.810556); - map4.put("alt", 0); - HashMap map5 = new HashMap<>(); - map5.put("id", "58"); - map5.put("label", "甫必 4号方阵"); - map5.put("name", "25"); - map5.put("type", "camera"); - map5.put("lng", 107.081747); - map5.put("lat", 23.808131); - map5.put("alt", 0); - HashMap map6 = new HashMap<>(); - map6.put("id", "58"); - map6.put("label", "甫必 7号方阵-1"); - map6.put("name", "25"); - map6.put("type", "camera"); - map6.put("lng", 107.077922); - map6.put("lat", 23.798344); - map6.put("alt", 0); - HashMap map7 = new HashMap<>(); - map7.put("id", "58"); - map7.put("label", "68甫必6"); - map7.put("name", "25"); - map7.put("type", "camera"); - map7.put("lng", 107.077333); - map7.put("lat", 23.797969); - map7.put("alt", 0); - HashMap map8 = new HashMap<>(); - map8.put("id", "58"); - map8.put("label", "甫必5号方阵"); - map8.put("name", "25"); - map8.put("type", "camera"); - map8.put("lng", 107.075853); - map8.put("lat", 23.796711); - map8.put("alt", 0); - HashMap map9 = new HashMap<>(); - map9.put("id", "58"); - map9.put("label", "西牛2号方阵"); - map9.put("name", "25"); - map9.put("type", "camera"); - map9.put("lng", 107.078942); - map9.put("lat", 23.789306); - map9.put("alt", 0); - HashMap map10 = new HashMap<>(); - map10.put("id", "58"); - map10.put("label", "福绿1号方阵"); - map10.put("name", "25"); - map10.put("type", "camera"); - map10.put("lng", 107.090061); - map10.put("lat", 23.790411); - map10.put("alt", 0); - HashMap map11 = new HashMap<>(); - map11.put("id", "58"); - map11.put("label", "福绿6号方阵-2"); - map11.put("name", "25"); - map11.put("type", "camera"); - map11.put("lng", 107.112883); - map11.put("lat", 23.771378); - map11.put("alt", 0); - - sxtChildrenMap.add(map1); - sxtChildrenMap.add(map2); - sxtChildrenMap.add(map3); - sxtChildrenMap.add(map4); - sxtChildrenMap.add(map5); - sxtChildrenMap.add(map6); - sxtChildrenMap.add(map7); - sxtChildrenMap.add(map8); - sxtChildrenMap.add(map9); - sxtChildrenMap.add(map10); - sxtChildrenMap.add(map11); - - return sxtChildrenMap; - } +// public List> setSxt() { +// List> sxtChildrenMap = new ArrayList<>(); +// HashMap map1 = new HashMap<>(); +// map1.put("id", "55"); +// map1.put("label", "那荷4号方阵-1"); +// map1.put("name", "22"); +// map1.put("type", "camera"); +// map1.put("lng", 107.111325); +// map1.put("lat", 23.820919); +// map1.put("alt", 0); +// HashMap map2 = new HashMap<>(); +// map2.put("id", "56"); +// map2.put("label", "甫必 1号方阵"); +// map2.put("name", "23"); +// map2.put("type", "camera"); +// map2.put("lng", 107.091297); +// map2.put("lat", 23.813567); +// map2.put("alt", 0); +// HashMap map3 = new HashMap<>(); +// map3.put("id", "57"); +// map3.put("label", "1222224"); +// map3.put("name", "24"); +// map3.put("type", "camera"); +// map3.put("lng", 107.085442); +// map3.put("lat", 23.811958); +// map3.put("alt", 0); +// HashMap map4 = new HashMap<>(); +// map4.put("id", "58"); +// map4.put("label", "甫必2号方阵-1"); +// map4.put("name", "25"); +// map4.put("type", "camera"); +// map4.put("lng", 107.085181); +// map4.put("lat", 23.810556); +// map4.put("alt", 0); +// HashMap map5 = new HashMap<>(); +// map5.put("id", "58"); +// map5.put("label", "甫必 4号方阵"); +// map5.put("name", "25"); +// map5.put("type", "camera"); +// map5.put("lng", 107.081747); +// map5.put("lat", 23.808131); +// map5.put("alt", 0); +// HashMap map6 = new HashMap<>(); +// map6.put("id", "58"); +// map6.put("label", "甫必 7号方阵-1"); +// map6.put("name", "25"); +// map6.put("type", "camera"); +// map6.put("lng", 107.077922); +// map6.put("lat", 23.798344); +// map6.put("alt", 0); +// HashMap map7 = new HashMap<>(); +// map7.put("id", "58"); +// map7.put("label", "68甫必6"); +// map7.put("name", "25"); +// map7.put("type", "camera"); +// map7.put("lng", 107.077333); +// map7.put("lat", 23.797969); +// map7.put("alt", 0); +// HashMap map8 = new HashMap<>(); +// map8.put("id", "58"); +// map8.put("label", "甫必5号方阵"); +// map8.put("name", "25"); +// map8.put("type", "camera"); +// map8.put("lng", 107.075853); +// map8.put("lat", 23.796711); +// map8.put("alt", 0); +// HashMap map9 = new HashMap<>(); +// map9.put("id", "58"); +// map9.put("label", "西牛2号方阵"); +// map9.put("name", "25"); +// map9.put("type", "camera"); +// map9.put("lng", 107.078942); +// map9.put("lat", 23.789306); +// map9.put("alt", 0); +// HashMap map10 = new HashMap<>(); +// map10.put("id", "58"); +// map10.put("label", "福绿1号方阵"); +// map10.put("name", "25"); +// map10.put("type", "camera"); +// map10.put("lng", 107.090061); +// map10.put("lat", 23.790411); +// map10.put("alt", 0); +// HashMap map11 = new HashMap<>(); +// map11.put("id", "58"); +// map11.put("label", "福绿6号方阵-2"); +// map11.put("name", "25"); +// map11.put("type", "camera"); +// map11.put("lng", 107.112883); +// map11.put("lat", 23.771378); +// map11.put("alt", 0); +// +// sxtChildrenMap.add(map1); +// sxtChildrenMap.add(map2); +// sxtChildrenMap.add(map3); +// sxtChildrenMap.add(map4); +// sxtChildrenMap.add(map5); +// sxtChildrenMap.add(map6); +// sxtChildrenMap.add(map7); +// sxtChildrenMap.add(map8); +// sxtChildrenMap.add(map9); +// sxtChildrenMap.add(map10); +// sxtChildrenMap.add(map11); +// +// return sxtChildrenMap; +// } public List> setWrj() { List> sxtChildrenMap = new ArrayList<>(); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/cailiaoshebei/controller/BusMrpBaseController.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/cailiaoshebei/controller/BusMrpBaseController.java index cf023d7e..d9825953 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/cailiaoshebei/controller/BusMrpBaseController.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/cailiaoshebei/controller/BusMrpBaseController.java @@ -179,7 +179,8 @@ public class BusMrpBaseController extends BaseController { */ @SaCheckPermission("cailiaoshebei:purchaseDoc:coryEngineeringList") @GetMapping("/coryEngineeringList") - public R> obtainTheList(CoryObtainTheListReq req) { + public R> obtainTheList(CoryObtainTheListReq req) { +// public R> obtainTheList(CoryObtainTheListReq req) { BusBillofquantitiesVersions one = busBillofquantitiesVersionsService.getOne(Wrappers.lambdaQuery() .eq(BusBillofquantitiesVersions::getWorkOrderType, "3") //物资工程量清单 .eq(BusBillofquantitiesVersions::getProjectId, req.getProjectId()) @@ -193,19 +194,20 @@ public class BusMrpBaseController extends BaseController { List list = busBillofquantitiesService.list(Wrappers.lambdaQuery() .eq(BusBillofquantities::getVersions, one.getVersions()) ); - List obtainTheListRes = new ArrayList<>(); - list.forEach(billofquantities -> { - ObtainTheListRes res = new ObtainTheListRes(); - BeanUtils.copyProperties(billofquantities, res); - obtainTheListRes.add(res); - }); - - Map> parentMap = obtainTheListRes.stream() - .collect(Collectors.groupingBy(ObtainTheListRes::getPid)); - - // 3. 递归组装树形结构,从顶级节点(pid=0)开始 - List treeList = buildTree("0", parentMap); - return R.ok(treeList); +// List obtainTheListRes = new ArrayList<>(); +// list.forEach(billofquantities -> { +// ObtainTheListRes res = new ObtainTheListRes(); +// BeanUtils.copyProperties(billofquantities, res); +// obtainTheListRes.add(res); +// }); +// +// Map> parentMap = obtainTheListRes.stream() +// .collect(Collectors.groupingBy(ObtainTheListRes::getPid)); +// +// // 3. 递归组装树形结构,从顶级节点(pid=0)开始 +// List treeList = buildTree("0", parentMap); +// return R.ok(treeList); + return R.ok(list); } private List buildTree(String parentId, Map> parentMap) { diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/cailiaoshebei/service/impl/BusMrpBaseServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/cailiaoshebei/service/impl/BusMrpBaseServiceImpl.java index 11481301..78cc1f0e 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/cailiaoshebei/service/impl/BusMrpBaseServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/cailiaoshebei/service/impl/BusMrpBaseServiceImpl.java @@ -232,11 +232,11 @@ public class BusMrpBaseServiceImpl extends ServiceImpl plans = MapstructUtils.convert(dto.getPlanList(), BusMaterialbatchdemandplan.class); plans.forEach(item -> { - BusBillofquantities byId = busBillofquantitiesService.getById(item.getSuppliespriceId()); - if (!"0".equals(byId.getPid())) { - BusBillofquantities one = busBillofquantitiesService.getOne(new LambdaQueryWrapper().eq(BusBillofquantities::getSid, byId.getPid())); - item.setSuppliespricePid(one.getId()); - } +// BusBillofquantities byId = busBillofquantitiesService.getById(item.getSuppliespriceId()); +// if (!"0".equals(byId.getPid())) { +// BusBillofquantities one = busBillofquantitiesService.getOne(new LambdaQueryWrapper().eq(BusBillofquantities::getSid, byId.getPid())); +// item.setSuppliespricePid(one.getId()); +// } item.setMrpBaseId(convert.getId()); item.setProjectId(convert.getProjectId()); }); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/BusBillofquantitiesVersionsServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/BusBillofquantitiesVersionsServiceImpl.java index 2f08166b..b97ee357 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/BusBillofquantitiesVersionsServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/design/service/impl/BusBillofquantitiesVersionsServiceImpl.java @@ -217,7 +217,7 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl allMaterials = new ArrayList<>(); for (ExcelReader.SheetData sheetData : excelData.getSheetDataList()) { @@ -239,26 +239,26 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl dataList = ExcelDynamicReader.readExcel( -// file, // 上传的文件 -// 1, // 跳过1行(表头) -// 0, // 从第0列开始 -// 5, // 到第5列结束 -// MaterialsAndEquipmentExcelDto.class // 目标实体类 -// ); -// List busBillofquantities = BeanUtil.copyToList(dataList, BusBillofquantities.class); -// for (BusBillofquantities busBillofquantity : busBillofquantities) { -// busBillofquantity.setProjectId(bo.getProjectId()); -// busBillofquantity.setVersions(banBen); -// } -// boolean b = busBillofquantitiesService.saveBatch(busBillofquantities); -// if (!b) { -// throw new RuntimeException("导入失败"); -// } -// return true; -// } + } else { + // 跳过1行(表头),读取0到6列(共7列),映射到ExcelData实体类 + List dataList = ExcelDynamicReader.readExcel( + file, // 上传的文件 + 1, // 跳过1行(表头) + 0, // 从第0列开始 + 5, // 到第5列结束 + MaterialsAndEquipmentExcelDto.class // 目标实体类 + ); + List busBillofquantities = BeanUtil.copyToList(dataList, BusBillofquantities.class); + for (BusBillofquantities busBillofquantity : busBillofquantities) { + busBillofquantity.setProjectId(bo.getProjectId()); + busBillofquantity.setVersions(banBen); + } + boolean b = busBillofquantitiesService.saveBatch(busBillofquantities); + if (!b) { + throw new RuntimeException("导入失败"); + } + return true; + } } @@ -270,9 +270,9 @@ public class BusBillofquantitiesVersionsServiceImpl extends ServiceImpl> parentMap = flatList.stream() .collect(Collectors.groupingBy(ObtainTheListRes::getPid)); diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/OthYs7Device.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/OthYs7Device.java index c04b9be3..462e8bb0 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/OthYs7Device.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/other/domain/OthYs7Device.java @@ -6,6 +6,7 @@ import lombok.Data; import java.io.Serial; import java.io.Serializable; +import java.math.BigDecimal; import java.util.Date; /** @@ -67,6 +68,19 @@ public class OthYs7Device implements Serializable { */ private String position; + /** + * 纬度(精确到6位小数) + */ + private BigDecimal latitude; + /** + * 经度(精确到6位小数) + */ + private BigDecimal longitude; + /** + * 海拔高度(单位未明确,默认0) + */ + private BigDecimal altitude; + /** * 设备添加时间 */ diff --git a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusBillofquantitiesLimitListServiceImpl.java b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusBillofquantitiesLimitListServiceImpl.java index aa5bb0b1..83f59d5c 100644 --- a/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusBillofquantitiesLimitListServiceImpl.java +++ b/xinnengyuan/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/tender/service/impl/BusBillofquantitiesLimitListServiceImpl.java @@ -203,9 +203,9 @@ public class BusBillofquantitiesLimitListServiceImpl extends ServiceImpl { item.setPrice(item.getUnitPrice().multiply(item.getQuantity()).setScale(4, RoundingMode.HALF_UP)); }); -// if (bo.getType().equals(LimitListTypeEnum.SPECIAL.getCode())) { -// return listVoList; -// } + if (bo.getType().equals(LimitListTypeEnum.SPECIAL.getCode())) { + return listVoList; + } //构建父子映射 Map> parentMap = listVoList.stream()