package com.fzzy.push.impl;
|
|
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSONObject;
|
import com.fzzy.api.Constant;
|
import com.fzzy.api.data.ApiParam;
|
import com.fzzy.api.dto.ResponseDto;
|
import com.fzzy.api.entity.ApiInfoData;
|
import com.fzzy.api.service.ApiRemoteService;
|
import com.fzzy.api.view.repository.ApiInfoDataRep;
|
import com.fzzy.push.gd2022.dto.Gd2022Api1023;
|
import com.fzzy.push.sh2023.SH2023Constant;
|
import com.fzzy.push.sh2023.dto.SH2023Api1115;
|
import com.fzzy.push.sh2023.dto.SH2023Api1311;
|
import com.fzzy.push.sh2023.dto.SH2023Api2103;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
|
/**
|
* @Description 各省省平台定制接口
|
* @Author CZT
|
* @Date 2024/4/22 15:31
|
*/
|
@Slf4j
|
@Service
|
public class ComPushService90 {
|
@Autowired
|
private ApiInfoDataRep apiInfoDataRep;
|
|
/*==========上海市平台定制接口 -- 开始==========*/
|
/**
|
* 9101 数据相符性接口--上海市平台
|
*/
|
public void pushData9101(ApiRemoteService apiRemoteService, ApiParam param) {
|
// 获取 视频监控接口数据
|
List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(Constant.API_CODE_9101);
|
|
if (null == items || items.isEmpty()) {
|
log.error("-----上海市平台2023版:未获取到数据相符性,不推送-----");
|
return;
|
}
|
param.setInteCategory(Constant.API_CATEGORY_90);
|
param.setInteId(Constant.API_CODE_9101);
|
|
SH2023Api1115 shApi1115;
|
ResponseDto responseDto;
|
for (ApiInfoData infoData : items) {
|
shApi1115 = JSONObject.parseObject(infoData.getData(), SH2023Api1115.class);
|
shApi1115.setZhgxsj(infoData.getUpdateTime());
|
|
param.setBizId(infoData.getDataId());
|
responseDto = apiRemoteService.pushData(param, shApi1115);
|
if (responseDto.getSuccess() == 0) {
|
if (Constant.CZBZ_I.equals(infoData.getCzbz())) {
|
infoData.setCzbz(Constant.CZBZ_U);
|
shApi1115.setCzbz(Constant.CZBZ_U);
|
infoData.setData(JSON.toJSONString(shApi1115));
|
apiInfoDataRep.save(infoData);
|
}
|
}
|
}
|
}
|
|
/**
|
* 9102 视频监控接口--上海市平台
|
*/
|
public void pushData9102(ApiRemoteService apiRemoteService, ApiParam param) {
|
// 获取 视频监控接口数据
|
List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(Constant.API_CODE_9102);
|
|
if (null == items || items.isEmpty()) {
|
log.error("-----上海市平台2023版:未获取到视频监控,不推送-----");
|
return;
|
}
|
param.setInteCategory(Constant.API_CATEGORY_90);
|
param.setInteId(Constant.API_CODE_9102);
|
|
SH2023Api1311 shApi1311;
|
ResponseDto responseDto;
|
for (ApiInfoData infoData : items) {
|
shApi1311 = JSONObject.parseObject(infoData.getData(), SH2023Api1311.class);
|
shApi1311.setZhgxsj(infoData.getUpdateTime());
|
|
param.setBizId(infoData.getDataId());
|
responseDto = apiRemoteService.pushData(param, shApi1311);
|
if (responseDto.getSuccess() == 0) {
|
if (Constant.CZBZ_I.equals(infoData.getCzbz())) {
|
infoData.setCzbz(Constant.CZBZ_U);
|
apiInfoDataRep.save(infoData);
|
}
|
}
|
}
|
}
|
|
/**
|
* 9103 倒仓倒入--上海市平台
|
*/
|
public void pushData9103(ApiRemoteService apiRemoteService, ApiParam param) {
|
log.error("-----上海市平台2023版:定化水检验暂未实现,不推送-----");
|
//TODO
|
|
}
|
|
/**
|
* 9104 粮情设备配置--上海市平台
|
*/
|
public void pushData9104(ApiRemoteService apiRemoteService, ApiParam param) {
|
|
// 获取粮情设备配置数据
|
List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(Constant.API_CODE_9104);
|
|
if (null == items || items.isEmpty()) {
|
log.error("-----上海市平台2023版:未获取到粮情设备配置,不推送-----");
|
return;
|
}
|
param.setInteCategory(Constant.API_CATEGORY_90);
|
param.setInteId(Constant.API_CODE_9104);
|
|
SH2023Api2103 shApi2103;
|
ResponseDto responseDto;
|
for (ApiInfoData infoData : items) {
|
shApi2103 = JSONObject.parseObject(infoData.getData(), SH2023Api2103.class);
|
shApi2103.setZhgxsj(infoData.getUpdateTime());
|
param.setBizId(infoData.getDataId());
|
responseDto = apiRemoteService.pushData(param, shApi2103);
|
if (responseDto.getSuccess() == 0) {
|
if (Constant.CZBZ_I.equals(infoData.getCzbz())) {
|
|
infoData.setCzbz(Constant.CZBZ_U);
|
apiInfoDataRep.save(infoData);
|
}
|
}
|
}
|
}
|
|
/**
|
* 9105 检斤单--上海市平台
|
*/
|
public void pushData9105(ApiRemoteService apiRemoteService, ApiParam param) {
|
log.error("-----上海市平台2023版:定化水检验暂未实现,不推送-----");
|
//TODO
|
|
}
|
|
/**
|
* 9106 市储驳运单--上海市平台
|
*/
|
public void pushData9106(ApiRemoteService apiRemoteService, ApiParam param) {
|
log.error("-----上海市平台2023版:定化水检验暂未实现,不推送-----");
|
//TODO
|
|
}
|
|
/**
|
* 9107 交易中心合同
|
*/
|
public void pushData9107(ApiRemoteService apiRemoteService, ApiParam param) {
|
log.error("-----上海市平台2023版:定化水检验暂未实现,不推送-----");
|
//TODO
|
}
|
|
/**
|
* 9108 定化水检验
|
*/
|
public void pushData9108(ApiRemoteService apiRemoteService, ApiParam param) {
|
log.error("-----上海市平台2023版:定化水检验暂未实现,不推送-----");
|
//TODO
|
|
}
|
|
/*==========上海市平台定制接口 -- 结束==========*/
|
|
/*==========广东省平台定制接口 -- 开始==========*/
|
/**
|
* 9201 熏蒸备案接口
|
*/
|
public void pushData9201(ApiRemoteService apiRemoteService, ApiParam param) {
|
//获取熏蒸备案信息
|
List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(Constant.API_CODE_9201);
|
|
if (null == items || items.isEmpty()) {
|
log.error("-----广东省平台2022版:未获取到熏蒸备案信息,不推送-----");
|
return;
|
}
|
param.setInteCategory(Constant.API_CATEGORY_90);
|
param.setInteId(Constant.API_CODE_9201);
|
|
Gd2022Api1023 gd2022Api1023;
|
ResponseDto responseDto;
|
for (ApiInfoData infoData : items) {
|
gd2022Api1023 = JSONObject.parseObject(infoData.getData(), Gd2022Api1023.class);
|
gd2022Api1023.setZhgxsj(infoData.getUpdateTime());
|
|
param.setBizId(infoData.getDataId());
|
responseDto = apiRemoteService.pushData(param, gd2022Api1023);
|
if (responseDto.getSuccess() == 0) {
|
if (Constant.CZBZ_I.equals(infoData.getCzbz())) {
|
infoData.setCzbz(Constant.CZBZ_U);
|
gd2022Api1023.setCzbz(Constant.CZBZ_U);
|
infoData.setData(JSON.toJSONString(gd2022Api1023));
|
apiInfoDataRep.save(infoData);
|
}
|
}
|
}
|
}
|
/*==========广东省平台定制接口 -- 结束==========*/
|
|
}
|