Browse Source

# 接站站点推送FDP接口调整修改

zhongwei
haungxing 2 years ago
parent
commit
e04a7bf955
  1. 3
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/request/StationInfoReq.java
  2. 4
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpQuestionServiceImpl.java

3
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/request/StationInfoReq.java

@ -36,4 +36,7 @@ public class StationInfoReq implements Serializable {
@ApiModelProperty("站点描述") @ApiModelProperty("站点描述")
private String stationDesc; private String stationDesc;
@ApiModelProperty("租户ID")
private String tenantId;
} }

4
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpQuestionServiceImpl.java

@ -20,6 +20,7 @@ import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springblade.core.log.exception.ServiceException; import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.log.logger.BladeLogger; import org.springblade.core.log.logger.BladeLogger;
import org.springblade.core.secure.utils.AuthUtil;
import org.springblade.core.tool.api.R; import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.Func; import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil; import org.springblade.core.tool.utils.StringUtil;
@ -51,13 +52,16 @@ public class FdpQuestionServiceImpl implements IFdpQuestionService {
R<StationEntity> stationResult = stationClient.getStationByCode(stationCode); R<StationEntity> stationResult = stationClient.getStationByCode(stationCode);
if(stationResult.isSuccess()) { if(stationResult.isSuccess()) {
StationEntity stationEntity = stationResult.getData(); StationEntity stationEntity = stationResult.getData();
log.info("请求体为:{}",AuthUtil.getTenantId());
StationInfoReq infoReq = StationInfoReq.builder() StationInfoReq infoReq = StationInfoReq.builder()
.stationId(stationCode) .stationId(stationCode)
.stationName(stationEntity.getName()) .stationName(stationEntity.getName())
.type(this.getStationType(stationEntity.getType())) .type(this.getStationType(stationEntity.getType()))
.stationDesc(Optional.ofNullable(stationDesc).orElse("")) .stationDesc(Optional.ofNullable(stationDesc).orElse(""))
.tenantId("200000")
.build(); .build();
if(Func.isNotEmpty(infoReq.getType())) { if(Func.isNotEmpty(infoReq.getType())) {
log.info("请求体为:{}",JSON.toJSONString(infoReq));
HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getSubmitStationInfo()) HttpResponse httpResponse = HttpRequest.post(fdpUrlConfiguration.getSubmitStationInfo())
.body(JSON.toJSONString(infoReq)) .body(JSON.toJSONString(infoReq))
.execute(); .execute();

Loading…
Cancel
Save