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 6740cccf8..ef5237fbb 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 @@ -234,6 +234,25 @@ public class PileStationInfoController extends BaseController { return AjaxResult.success(pileService.updateStationQRCodePrefix(dto)); } + /** + * 新增站点互联互通配置 + */ + @PreAuthorize("@ss.hasPermi('pile:station:add')") + @Log(title = "新增站点互联互通配置", businessType = BusinessType.INSERT) + @PostMapping("/insertThirdPartyStationRelation") + public AjaxResult insertRelation(@RequestBody ThirdPartyStationRelationDTO dto) { + return toAjax(thirdPartyStationRelationService.insertThirdPartyStationRelation(dto.getStationId(), dto.getThirdPartyType())); + } + + /** + * 删除站点互联互通配置 + */ + @PreAuthorize("@ss.hasPermi('pile:station:remove')") + @Log(title = "删除站点互联互通配置", businessType = BusinessType.DELETE) + @PostMapping("/deleteThirdPartyStationRelation") + public AjaxResult deleteRelation(@RequestBody ThirdPartyStationRelationDTO dto) { + return toAjax(thirdPartyStationRelationService.deleteThirdPartyStationRelation(dto.getId())); + } /** * 查询站点互联互通配置 * @@ -379,7 +398,6 @@ public class PileStationInfoController extends BaseController { public AjaxResult updateThirdPartyStationRelation(@RequestBody ThirdPartyStationRelationDTO dto) { AjaxResult result; try { - // startPage(); thirdPartyStationRelationService.updateThirdPartyStationRelation(dto); result = AjaxResult.success(); } catch (Exception 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 cc3f69393..b39cf16fc 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 @@ -17,4 +17,14 @@ public class ThirdPartyStationRelationDTO { * 要推送的第三方平台类型数组 */ private List thirdPartyTypes; + + /** + * 要推送的某个第三方平台类型 + */ + private String thirdPartyType; + + /** + * 关系id + */ + private String id; } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java index db71d0da7..1ba5e5166 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/mapper/ThirdPartyStationRelationMapper.java @@ -115,4 +115,6 @@ public interface ThirdPartyStationRelationMapper { int batchInsert(List list); List getRelationInfoListV2(@Param("stationId") String stationId); + + int deleteThirdPartyStationRelation(String id); } 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 d4cb5236e..8e9f37547 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 @@ -113,6 +113,21 @@ public interface ThirdPartyStationRelationService { */ List selectStationList(String thirdPlatformType); + /** + * 新增站点与第三方平台对接关系 + */ + int insertThirdPartyStationRelation(String stationId, String thirdPlatformType); + + /** + * 删除站点对接第三方平台关系 + */ + int deleteThirdPartyStationRelation(String id); + + /** + * 修改站点对接第三方平台关系 + */ + // int updateThirdPartyStationRelation(ThirdPartyStationRelationDTO dto); + /** * 根据站点id查询该站点对接了哪些第三方平台 * @param stationId 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 64d0fd0ce..a585ce6c8 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 @@ -210,4 +210,20 @@ public class ThirdPartyStationRelationServiceImpl implements ThirdPartyStationRe public List selectStationList(String thirdPlatformType) { return thirdPartyStationRelationMapper.selectStationList(thirdPlatformType); } + + @Override + public int insertThirdPartyStationRelation(String stationId, String thirdPlatformType) { + ThirdPartyStationRelation relation = new ThirdPartyStationRelation(); + relation.setStationId(Long.parseLong(stationId)); + relation.setThirdPartyType(thirdPlatformType); + return thirdPartyStationRelationMapper.insertThirdPartyStationRelation(relation); + } + + @Override + public int deleteThirdPartyStationRelation(String id) { + ThirdPartyStationRelation relation = new ThirdPartyStationRelation(); + relation.setId(Long.parseLong(id)); + relation.setDelFlag(DelFlagEnum.DELETE.getValue()); + return thirdPartyStationRelationMapper.updateThirdPartyStationRelation(relation); + } } diff --git a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ThirdPartyStationRelationVO.java b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ThirdPartyStationRelationVO.java index 15682be50..89ffe281e 100644 --- a/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ThirdPartyStationRelationVO.java +++ b/jsowell-pile/src/main/java/com/jsowell/pile/vo/base/ThirdPartyStationRelationVO.java @@ -10,6 +10,11 @@ import lombok.Data; */ @Data public class ThirdPartyStationRelationVO { + /** + * id + */ + private String id; + /** * 站点id */ diff --git a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml index 46e19e044..ac8b994be 100644 --- a/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml +++ b/jsowell-pile/src/main/resources/mapper/pile/ThirdPartyStationRelationMapper.xml @@ -334,6 +334,7 @@ + + + + \ No newline at end of file diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java index 0faac6ebc..ee9db7d3a 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java @@ -46,10 +46,8 @@ import com.jsowell.thirdparty.service.ThirdpartySecretInfoService; import com.jsowell.thirdparty.xindiantu.service.XDTService; import com.jsowell.thirdparty.yongchengboche.dto.YCBCGetTokenDTO; import com.jsowell.thirdparty.yongchengboche.service.YCBCService; -import com.jsowell.thirdparty.zhongdianlian.service.ZDLService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.apache.logging.log4j.util.Strings; import org.bouncycastle.crypto.CryptoException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -63,7 +61,6 @@ import java.text.ParseException; import java.time.LocalTime; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.concurrent.TimeUnit; /** @@ -88,15 +85,9 @@ public class CommonService { @Autowired private ThirdPartyStationRelationService thirdPartyStationRelationService; - @Autowired - private ThirdPartyParkingConfigService thirdPartyParkingConfigService; - @Autowired private LianLianService lianLianService; - @Autowired - private ZDLService zdlService; - @Autowired private ChargeParkingDiscountService chargeParkingDiscountService;