From d1c3bb562b8222ddb4868f51b6740512d1a3d436 Mon Sep 17 00:00:00 2001 From: Guoqs <123@jsowell.com> Date: Fri, 5 Dec 2025 10:07:50 +0800 Subject: [PATCH] =?UTF-8?q?add=20=E6=9B=B4=E6=96=B0=E7=AB=99=E7=82=B9?= =?UTF-8?q?=E4=BA=92=E8=81=94=E4=BA=92=E9=80=9A=E9=85=8D=E7=BD=AEV2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pile/PileStationInfoController.java | 12 ++++++++++- .../dto/ThirdPartyStationRelationDTO.java | 5 +++++ .../ThirdPartyStationRelationService.java | 2 ++ .../ThirdPartyStationRelationServiceImpl.java | 21 +++++++++++++++++++ 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java index 11f2f3618..97d3d6c52 100644 --- a/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java +++ b/jsowell-admin/src/main/java/com/jsowell/web/controller/pile/PileStationInfoController.java @@ -255,6 +255,16 @@ public class PileStationInfoController extends BaseController { return toAjax(thirdPartyStationRelationService.deleteThirdPartyStationRelation(dto.getId())); } + /** + * 更新站点互联互通配置 + */ + @PreAuthorize("@ss.hasPermi('pile:station:edit')") + @Log(title = "更新站点互联互通配置", businessType = BusinessType.UPDATE) + @PostMapping("/updateThirdPartyStationRelation") + public AjaxResult updateRelation(@RequestBody ThirdPartyStationRelationDTO dto) { + return toAjax(thirdPartyStationRelationService.updateThirdPartyStationRelation(dto)); + } + /** * 查询站点互联互通配置 * @@ -400,7 +410,7 @@ public class PileStationInfoController extends BaseController { public AjaxResult updateThirdPartyStationRelation(@RequestBody ThirdPartyStationRelationDTO dto) { AjaxResult result; try { - thirdPartyStationRelationService.updateThirdPartyStationRelation(dto); + thirdPartyStationRelationService.updateThirdPartyStationRelationV2(dto); result = AjaxResult.success(); } catch (Exception e) { logger.error("更新站点与第三方平台关系error,", e); diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/dto/ThirdPartyStationRelationDTO.java b/jsowell-pile/src/main/java/com/jsowell/pile/dto/ThirdPartyStationRelationDTO.java index b39cf16fc..2ad8c97a4 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/dto/ThirdPartyStationRelationDTO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/dto/ThirdPartyStationRelationDTO.java @@ -27,4 +27,9 @@ public class ThirdPartyStationRelationDTO { * 关系id */ private String id; + + /** + * 设备拥有者id + */ + private String equipmentOwnerId; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java index 8e9f37547..a30cfe277 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/ThirdPartyStationRelationService.java @@ -134,4 +134,6 @@ public interface ThirdPartyStationRelationService { * @return */ List getRelationInfoListV2(String stationId); + + void updateThirdPartyStationRelationV2(ThirdPartyStationRelationDTO dto); } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java index a585ce6c8..ba2b54d3c 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/service/impl/ThirdPartyStationRelationServiceImpl.java @@ -16,6 +16,7 @@ import com.jsowell.pile.service.ThirdPartyStationRelationService; import com.jsowell.pile.vo.base.MerchantInfoVO; import com.jsowell.pile.vo.base.StationInfoVO; import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -28,6 +29,7 @@ import java.util.List; * @author jsowell * @date 2023-06-06 */ +@Slf4j @Service public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRelationService { @Autowired @@ -132,6 +134,8 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe return thirdPartyStationRelationMapper.getRelationInfoListV2(stationId); } + + /** * 新增站点、第三方推送平台配置对应 * @@ -174,6 +178,23 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe return thirdPartyStationRelationMapper.batchInsert(list); } + /** + * 修改站点、第三方推送平台配置对应 + * @param dto + */ + @Override + public void updateThirdPartyStationRelationV2(ThirdPartyStationRelationDTO dto) { + ThirdPartyStationRelation thirdPartyStationRelation = thirdPartyStationRelationMapper.selectThirdPartyStationRelationById(Long.parseLong(dto.getId())); + if (thirdPartyStationRelation == null) { + log.error("修改站点、第三方推送平台配置对应信息失败,站点、第三方推送平台配置对应不存在, id:{}", dto.getId()); + return; + } + thirdPartyStationRelation.setThirdPartyType(dto.getThirdPartyType()); + thirdPartyStationRelation.setUpdateTime(DateUtils.getNowDate()); + thirdPartyStationRelation.setUpdateBy(SecurityUtils.getUsername()); + thirdPartyStationRelationMapper.updateThirdPartyStationRelation(thirdPartyStationRelation); + } + /** * 批量删除站点、第三方推送平台配置对应 *