From 7511a9d9f260a9bf5b6736fbed56986cdb3a7f64 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Fri, 1 Jul 2022 14:35:24 +0800 Subject: [PATCH 1/2] =?UTF-8?q?1.=E7=94=B3=E8=B4=AD=E8=BD=A6=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E7=BB=93=E6=9E=9C=E6=96=B0=E5=A2=9E=E5=AD=97=E6=AE=B5?= =?UTF-8?q?=202.=E6=A0=B9=E6=8D=AE=E7=94=B3=E8=AF=B7=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=91=84=E5=83=8F=E5=A4=B4=E5=88=97=E8=A1=A8=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=203.=E4=BF=AE=E6=94=B9=E6=96=B0=E5=A2=9E=E6=94=B6=E8=97=8F?= =?UTF-8?q?=E5=9B=A0=E4=B8=BA=E5=BC=82=E6=AD=A5=E5=AF=BC=E8=87=B4=E7=9A=84?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=AD=BB=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resource/service/impl/ResourceServiceImpl.java | 13 ++++++++++++- .../service/impl/ResourceCollectionServiceImpl.java | 10 +++++----- .../resources/mapper/resourceCar/ResourceCarDao.xml | 3 ++- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 4b76a8b8..50069398 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -16,6 +16,7 @@ import io.renren.common.page.PageData; import io.renren.common.service.impl.CrudServiceImpl; import io.renren.common.utils.ConvertUtils; import io.renren.common.utils.DateUtils; +import io.renren.modules.monitor.dto.CameraChannelDto1; import io.renren.modules.monitor.entity.CameraChannel; import io.renren.modules.monitor.mapper.CameraChannelMapper; import io.renren.modules.processForm.dao.TAbilityApplicationDao; @@ -551,6 +552,11 @@ public class ResourceServiceImpl extends CrudServiceImpl() { { QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("check_status", 1) + .ne("gps_x", "") + .ne("gps_y", "") + .isNotNull("gps_x") + .isNotNull("gps_y"); put("count", cameraChannelMapper.selectCount(queryWrapper) + ""); put("type", "基础设施"); } @@ -904,7 +910,12 @@ public class ResourceServiceImpl extends CrudServiceImpl applicationEntities = tAbilityApplicationDao.selectList(queryWrapper); ArrayList cameraList = new ArrayList(); - applicationEntities.forEach(index -> cameraList.add(cameraChannelMapper.selectByChannelCode(index.getCameraList()))); + applicationEntities.forEach(index -> { + List channelDto1s = cameraChannelMapper.selectByChannelCode(index.getCameraList().replaceAll("\"", "")); + if (!channelDto1s.isEmpty()) { + cameraList.add(channelDto1s.get(0)); + } + }); return cameraList; } diff --git a/renren-admin/src/main/java/io/renren/modules/resourceCollection/service/impl/ResourceCollectionServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resourceCollection/service/impl/ResourceCollectionServiceImpl.java index a999fec1..0a246cf5 100644 --- a/renren-admin/src/main/java/io/renren/modules/resourceCollection/service/impl/ResourceCollectionServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resourceCollection/service/impl/ResourceCollectionServiceImpl.java @@ -73,11 +73,11 @@ public class ResourceCollectionServiceImpl extends CrudServiceImpl collectionEntities = resourceCollectionDao.selectByMap(selectMap); if (collectionEntities.isEmpty()) { resourceCollectionDao.insert(item); - CompletableFuture.runAsync(() -> { - jdbcTemplate.update("update tb_data_resource,\n" + - "tb_data_resource_assignmark\n" + - "SET tb_data_resource.total = round(tb_data_resource_assignmark.total) WHERE tb_data_resource.id =" + item.getResourceId()); - }); + + jdbcTemplate.update("update tb_data_resource,\n" + + "tb_data_resource_assignmark\n" + + "SET tb_data_resource.total = round(tb_data_resource_assignmark.total) WHERE tb_data_resource.id =" + item.getResourceId()); + } }); } diff --git a/renren-admin/src/main/resources/mapper/resourceCar/ResourceCarDao.xml b/renren-admin/src/main/resources/mapper/resourceCar/ResourceCarDao.xml index 4f8f4f91..1d96417b 100644 --- a/renren-admin/src/main/resources/mapper/resourceCar/ResourceCarDao.xml +++ b/renren-admin/src/main/resources/mapper/resourceCar/ResourceCarDao.xml @@ -89,7 +89,8 @@ res.type, res.del_flag AS "delFlag", car.note1, - car.create_date AS "time" + car.create_date AS "time", + res.del_flag AS "delFlag" FROM tb_resource_car car, tb_data_resource res From c72f5987806ca7837e55f8f3abe48a59f27f2bf3 Mon Sep 17 00:00:00 2001 From: yitonglei Date: Fri, 1 Jul 2022 14:38:11 +0800 Subject: [PATCH 2/2] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E8=83=BD?= =?UTF-8?q?=E5=8A=9B=E7=BB=9F=E8=AE=A1=E5=88=97=E8=A1=A8=E5=92=8C=E8=AF=A6?= =?UTF-8?q?=E6=83=85-=E7=BB=84=E4=BB=B6=E6=9C=8D=E5=8A=A1-=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=83=85=E5=86=B5=E7=BB=9F=E8=AE=A1-=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=BB=84=E4=BB=B6=E8=AF=84=E5=88=86TOP5=E7=9A=84sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/renren/common/controller/CensusControllerV3.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java index 2c2af00b..6d204c1f 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusControllerV3.java @@ -299,10 +299,10 @@ public class CensusControllerV3 { }) public Result>> assemblerUseScoreTopInfo(@ApiIgnore @RequestParam Map params){ Object[] ps = {params.get("resourceType"),params.get("id"),params.get("id")}; - List> maps = jdbcTemplate.queryForList("SELECT AVG(a.score) as score,b.name FROM tb_resource_score a INNER JOIN tb_data_resource b on a.resource_id = b.id\n" + - "INNER JOIN sys_dept c ON b.dept_id = c.id\n" + - "WHERE a.del_flag = 0 AND b.type = ? AND (c.id = ? OR INSTR(c.pids,?))\n" + - "group by b.name order by score desc limit 5", ps); + List> maps = jdbcTemplate.queryForList("SELECT SUM(IFNULL(e.score,0)) as score,c.name FROM tb_data_resource_rel a INNER JOIN sys_user b ON a.creator = b.id INNER JOIN tb_data_resource c ON a.reference_id = c.id\n" + + "INNER JOIN sys_dept d ON b.dept_id = d.id INNER JOIN tb_resource_score e ON a.reference_id = e.resource_id \n" + + "WHERE a.del_flag = 0 AND c.type = ? AND c.del_flag = 0 AND (d.id = ? OR INSTR(d.pids,?)) AND e.del_flag = 0\n" + + "group by c.name order by score desc limit 5", ps); return new Result>>().ok(maps); }