From 9215dd458f611f80d0bf1a9d230741c58cde55e3 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Wed, 10 May 2023 08:40:20 +0800 Subject: [PATCH 1/3] =?UTF-8?q?update=20=E7=AB=99=E7=82=B9=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit e5fa93ed9fcdbf28fd982537d8667e9bf73ea3d4) --- .../pile/service/impl/PileStationInfoServiceImpl.java | 6 ++++++ .../main/java/com/jsowell/pile/vo/web/PileStationVO.java | 5 +++++ .../src/views/pile/station/components/SiteInfo.vue | 9 ++++++--- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index a346cc404..9df7f6e24 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -71,6 +71,8 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService { @Autowired private RedisCache redisCache; + + /** * 查询充电站信息 * @@ -134,6 +136,7 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService { // vo.setOrganizationCode(pileStationInfo.getor); vo.setPublicFlag(pileStationInfo.getPublicFlag()); vo.setOpenFlag(pileStationInfo.getOpenFlag()); + vo.setDeptId(pileStationInfo.getDeptId()); if (StringUtils.isNotBlank(pileStationInfo.getPictures())) { vo.setPictures(pileStationInfo.getPictures()); vo.setPictureList(Lists.newArrayList(pileStationInfo.getPictures().split(","))); @@ -255,6 +258,9 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService { redisCache.deleteObject(redisKey); pileStationInfo.setUpdateBy(SecurityUtils.getUsername()); pileStationInfo.setUpdateTime(DateUtils.getNowDate()); + // 同步组织中的名称,联系人,电话 + // sysDeptService.updateDept() + return pileStationInfoMapper.updatePileStationInfo(pileStationInfo); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileStationVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileStationVO.java index 7eb515ac7..34f28f894 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileStationVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/web/PileStationVO.java @@ -29,6 +29,11 @@ public class PileStationVO { */ private String stationName; + /** + * 组织id + */ + private String deptId; + /** * 省市辖区编码 */ diff --git a/jsowell-ui/src/views/pile/station/components/SiteInfo.vue b/jsowell-ui/src/views/pile/station/components/SiteInfo.vue index 88011f936..b1f393387 100644 --- a/jsowell-ui/src/views/pile/station/components/SiteInfo.vue +++ b/jsowell-ui/src/views/pile/station/components/SiteInfo.vue @@ -292,6 +292,7 @@ export default { ], }, fileList: [], // 用于图片回显 + dialogVisible: null, }; }, created() { @@ -324,9 +325,11 @@ export default { const res = await getStationInfo(this.stationId); console.log(res); this.station = res.data; - var pictures = res.data.pictures.split(','); - for (let i = 0; i < pictures.length; i++) { - this.fileList.push({"url": pictures[i]}); + if (res.data.pictures != null) { + var pictures = res.data.pictures.split(','); + for (let i = 0; i < pictures.length; i++) { + this.fileList.push({"url": pictures[i]}); + } } console.log("queryStationInfo表格数据", this.station); }, From 4f0f785839879b16453004394e1fb764d0ac80ea Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Wed, 10 May 2023 08:41:36 +0800 Subject: [PATCH 2/3] =?UTF-8?q?update=20=E7=AB=99=E7=82=B9=E5=9F=BA?= =?UTF-8?q?=E6=9C=AC=E8=B5=84=E6=96=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit (cherry picked from commit 4beef45bb210e39b9b6d632df3769a4ab5bb1552) --- jsowell-ui/src/views/pile/station/components/SiteInfo.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/jsowell-ui/src/views/pile/station/components/SiteInfo.vue b/jsowell-ui/src/views/pile/station/components/SiteInfo.vue index b1f393387..795ebdc4c 100644 --- a/jsowell-ui/src/views/pile/station/components/SiteInfo.vue +++ b/jsowell-ui/src/views/pile/station/components/SiteInfo.vue @@ -219,6 +219,7 @@ export default { construction: "", businessHours: "", pictures: "", + deptId: "", }, stationId: this.$route.params.id, publicFlagOptions: [ From f482f71007de7b041a6070dbab46a82b760797f5 Mon Sep 17 00:00:00 2001 From: "autumn.g@foxmail.com" Date: Wed, 10 May 2023 08:50:19 +0800 Subject: [PATCH 3/3] update (cherry picked from commit 0bb109f52368043769399395ebfb28b1d872afb0) --- .../impl/PileStationInfoServiceImpl.java | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java index 9df7f6e24..89f0795b8 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/PileStationInfoServiceImpl.java @@ -252,16 +252,29 @@ public class PileStationInfoServiceImpl implements IPileStationInfoService { * @return 结果 */ @Override + @Transactional(readOnly = false, propagation = Propagation.REQUIRED) public int updatePileStationInfo(PileStationInfo pileStationInfo) { // 清缓存 String redisKey = CacheConstants.SELECT_PILE_STATION_INFO_BY_ID + pileStationInfo.getId(); redisCache.deleteObject(redisKey); + pileStationInfo.setUpdateBy(SecurityUtils.getUsername()); pileStationInfo.setUpdateTime(DateUtils.getNowDate()); - // 同步组织中的名称,联系人,电话 - // sysDeptService.updateDept() + int i = pileStationInfoMapper.updatePileStationInfo(pileStationInfo); - return pileStationInfoMapper.updatePileStationInfo(pileStationInfo); + // 同步组织中的名称,联系人,电话 + SysDept sysDept = sysDeptService.selectDeptById(Long.parseLong(pileStationInfo.getDeptId())); + if (sysDept != null) { + sysDept.setDeptName(pileStationInfo.getStationName()); + sysDept.setLeader(pileStationInfo.getStationAdminName()); + sysDept.setPhone(pileStationInfo.getStationTel()); + sysDept.setUpdateTime(DateUtils.getNowDate()); + sysDeptService.updateDept(sysDept); + } + + // 再次清缓存 + redisCache.deleteObject(redisKey); + return i; } /**