Files
jsowell-charger-web/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/common/CommonService.java

38 lines
1.2 KiB
Java
Raw Normal View History

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);
}
}