mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 19:45:09 +08:00
38 lines
1.2 KiB
Java
38 lines
1.2 KiB
Java
package com.jsowell.thirdparty.common;
|
|
|
|
import com.jsowell.pile.domain.ThirdPartyStationRelation;
|
|
import com.jsowell.pile.dto.PushStationInfoDTO;
|
|
import com.jsowell.pile.service.ThirdPartyStationRelationService;
|
|
import com.jsowell.pile.vo.base.ThirdPartyStationRelationVO;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
/**
|
|
* TODO
|
|
*
|
|
* @author Lemon
|
|
* @Date 2024/1/18 15:11:32
|
|
*/
|
|
@Service
|
|
public class CommonService {
|
|
|
|
@Autowired
|
|
private ThirdPartyStationRelationService thirdPartyStationRelationService;
|
|
|
|
/**
|
|
* 将站点--第三方平台类型对应关系存入关系表
|
|
* @param dto
|
|
*/
|
|
public void insertInfo2DataBase(PushStationInfoDTO dto) {
|
|
ThirdPartyStationRelation relation = new ThirdPartyStationRelation();
|
|
relation.setStationId(dto.getStationId());
|
|
relation.setThirdPartyType(dto.getThirdPartyType());
|
|
ThirdPartyStationRelationVO vo = thirdPartyStationRelationService.selectRelationInfo(relation);
|
|
if (vo != null) {
|
|
return;
|
|
}
|
|
// 新增数据库
|
|
thirdPartyStationRelationService.insertThirdPartyStationRelation(relation);
|
|
}
|
|
}
|