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); + } + /** * 批量删除站点、第三方推送平台配置对应 *