package com.fzzy.push.gb2022;
|
|
import com.fzzy.api.data.ApiParam;
|
import com.fzzy.api.data.PushProtocol;
|
import com.fzzy.api.service.PushService12;
|
import com.fzzy.push.impl.ComPushService12;
|
import lombok.extern.slf4j.Slf4j;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.stereotype.Component;
|
|
/**
|
* 粮食购销-推送
|
*/
|
@Slf4j
|
@Component
|
public class GBPushService12 implements PushService12 {
|
|
// @Autowired
|
// private Api1201Rep api1201Rep;
|
// @Autowired
|
// private Api1202Rep api1202Rep;
|
// @Autowired
|
// private Api1203Rep api1203Rep;
|
// @Autowired
|
// private Api1204Rep api1204Rep;
|
// @Autowired
|
// private Api1205Rep api1205Rep;
|
// @Autowired
|
// private Api1206Rep api1206Rep;
|
// @Autowired
|
// private Api1208Rep api1208Rep;
|
// @Autowired
|
// private Api1209Rep api1209Rep;
|
@Autowired
|
private GBApiRemoteService apiRemoteService;
|
|
@Autowired
|
private ComPushService12 pushService;
|
|
|
@Override
|
public String getProtocol() {
|
return PushProtocol.GB_2022.getCode();
|
}
|
|
|
@Override
|
public void pushData(ApiParam param) {
|
|
log.info("------->>>>粮食购销 接口模块上报开始");
|
|
pushService.pushData1201(apiRemoteService, param);
|
|
pushService.pushData1202(apiRemoteService, param);
|
|
pushService.pushData1203(apiRemoteService, param);
|
|
pushService.pushData1204(apiRemoteService, param);
|
|
pushService.pushData1205(apiRemoteService, param);
|
|
pushService.pushData1206(apiRemoteService, param);
|
|
pushService.pushData1208(apiRemoteService, param);
|
|
pushService.pushData1209(apiRemoteService, param);
|
|
log.info("------->>>>粮食购销 接口模块上报结束");
|
}
|
|
// /**
|
// * 1201 合同信息数据接口
|
// *
|
// * @param param
|
// */
|
// private void pushData1201(ApiParam param) {
|
//
|
// List<Api1201> items = api1201Rep.findPushData(param.getKqdm());
|
//
|
// if (null == items || items.isEmpty()) {
|
// return;
|
// }
|
//
|
// param.setInteCategory(Constant.API_CATEGORY_12);
|
// param.setInteId(Constant.API_CODE_1201);
|
//
|
// ResponseDto responseDto;
|
// Api1201 apiData;
|
//
|
// for (Api1201 data : items) {
|
// apiData = new Api1201();
|
// BeanUtils.copyProperties(data, apiData);
|
// param.setBizId(data.getBizId());
|
//
|
// responseDto = apiRemoteService.pushData(param, apiData);
|
// if (responseDto.getSuccess() == 0) {
|
// if (Constant.CZBZ_I.equals(apiData.getCzbz())) {
|
// api1201Rep.updateStatus(apiData.getHth(), Constant.CZBZ_U);
|
// }
|
// }
|
// }
|
// }
|
//
|
// /**
|
// * 接口编码-1202 粮食入库信息数据接口
|
// */
|
// private void pushData1202(ApiParam param) {
|
// List<ShjdjwApi1202> items = api1202Rep.findPushData(param.getKqdm());
|
// if (null == items || items.isEmpty()) {
|
// return;
|
// }
|
// param.setInteCategory(Constant.API_CATEGORY_12);
|
// param.setInteId(Constant.API_CODE_1202);
|
//
|
// ResponseDto responseDto;
|
// for (ShjdjwApi1202 data : items) {
|
// responseDto = apiRemoteService.pushData(param, data);
|
// if (responseDto.getSuccess() == 0) {
|
// if (Constant.CZBZ_I.equals(data.getCzbz())) {
|
// api1202Rep.updateStatus(data.getId(), Constant.CZBZ_U);
|
// }
|
// }
|
// }
|
// }
|
//
|
// /**
|
// * 1203
|
// *
|
// * @param kqdm
|
// * @param start
|
// * @param end
|
// */
|
// private void pushData1203(ApiParam param) {
|
//
|
// List<Api1203> items = api1203Rep.findPushData(param.getKqdm());
|
//
|
// if (null == items || items.isEmpty()) {
|
// return;
|
// }
|
//
|
// param.setInteCategory(Constant.API_CATEGORY_12);
|
// param.setInteId(Constant.API_CODE_1203);
|
//
|
// ResponseDto responseDto;
|
// Api1203 apiData;
|
// for (Api1203 data : items) {
|
// apiData = new Api1203();
|
//
|
// BeanUtils.copyProperties(data, apiData);
|
// param.setBizId(data.getBizId());
|
// responseDto = apiRemoteService.pushData(param, apiData);
|
//
|
// if (responseDto.getSuccess() == 0) {
|
// if (Constant.CZBZ_I.equals(apiData.getCzbz())) {
|
// api1203Rep.updateStatus(apiData.getId(), Constant.CZBZ_U);
|
// }
|
// }
|
// }
|
// }
|
//
|
// /**
|
// * 1204
|
// *
|
// * @param kqdm
|
// * @param start
|
// * @param end
|
// */
|
// private void pushData1204(ApiParam param) {
|
//
|
// List<Api1204> items = api1204Rep.findPushData(param.getKqdm());
|
//
|
// if (null == items || items.isEmpty()) {
|
// return;
|
// }
|
//
|
// param.setInteCategory(Constant.API_CATEGORY_12);
|
// param.setInteId(Constant.API_CODE_1204);
|
//
|
// ResponseDto responseDto;
|
// Api1204 apiData;
|
// for (Api1204 data : items) {
|
// apiData = new Api1204();
|
// BeanUtils.copyProperties(data, apiData);
|
//
|
// param.setBizId(data.getBizId());
|
// responseDto = apiRemoteService.pushData(param, apiData);
|
//
|
// if (responseDto.getSuccess() == 0) {
|
// if (Constant.CZBZ_I.equals(apiData.getCzbz())) {
|
// api1204Rep.updateStatus(apiData.getRkjsdh(), Constant.CZBZ_U);
|
// }
|
// }
|
// }
|
// }
|
//
|
// /**
|
// * 1205
|
// *
|
// * @param kqdm
|
// * @param start
|
// * @param end
|
// */
|
// private void pushData1205(ApiParam param) {
|
//
|
// List<Api1205> items = api1205Rep.findPushData(param.getKqdm());
|
//
|
// if (null == items || items.isEmpty()) {
|
// return;
|
// }
|
//
|
// param.setInteCategory(Constant.API_CATEGORY_12);
|
// param.setInteId(Constant.API_CODE_1205);
|
//
|
//
|
// ResponseDto responseDto;
|
// Api1205 apiData;
|
// for (Api1205 data : items) {
|
// apiData = new Api1205();
|
// BeanUtils.copyProperties(data, apiData);
|
// param.setBizId(data.getBizId());
|
// responseDto = apiRemoteService.pushData(param, apiData);
|
//
|
// if (responseDto.getSuccess() == 0) {
|
// if (Constant.CZBZ_I.equals(apiData.getCzbz())) {
|
// api1205Rep.updateStatus(apiData.getId(), Constant.CZBZ_U);
|
// }
|
// }
|
// }
|
// }
|
//
|
// /**
|
// * 1206
|
// *
|
// * @param kqdm
|
// * @param start
|
// * @param end
|
// */
|
// private void pushData1206(ApiParam param) {
|
//
|
// List<Api1206> items = api1206Rep.findPushData(param.getKqdm());
|
//
|
// if (null == items || items.isEmpty()) {
|
// return;
|
// }
|
//
|
// param.setInteCategory(Constant.API_CATEGORY_12);
|
// param.setInteId(Constant.API_CODE_1206);
|
//
|
//
|
// ResponseDto responseDto;
|
// Api1206 apiData;
|
// for (Api1206 data : items) {
|
// apiData = new Api1206();
|
// BeanUtils.copyProperties(data, apiData);
|
//
|
// param.setBizId(data.getBizId());
|
//
|
// responseDto = apiRemoteService.pushData(param, apiData);
|
//
|
// if (responseDto.getSuccess() == 0) {
|
// if (Constant.CZBZ_I.equals(apiData.getCzbz())) {
|
// api1206Rep.updateStatus(apiData.getCkjsdh(), Constant.CZBZ_U);
|
// }
|
// }
|
// }
|
// }
|
//
|
// /**
|
// * 1208
|
// *
|
// * @param kqdm
|
// * @param start
|
// * @param end
|
// */
|
// private void pushData1208(ApiParam param) {
|
//
|
// List<Api1208> items = api1208Rep.findPushData(param.getKqdm());
|
//
|
// if (null == items || items.isEmpty()) {
|
// return;
|
// }
|
//
|
// param.setInteCategory(Constant.API_CATEGORY_12);
|
// param.setInteId(Constant.API_CODE_1208);
|
//
|
//
|
// ResponseDto responseDto;
|
// Api1208 apiData;
|
// for (Api1208 data : items) {
|
// apiData = new Api1208();
|
// BeanUtils.copyProperties(data, apiData);
|
//
|
// param.setBizId(data.getBizId());
|
// responseDto = apiRemoteService.pushData(param, apiData);
|
//
|
// if (responseDto.getSuccess() == 0) {
|
// if (Constant.CZBZ_I.equals(apiData.getCzbz())) {
|
// api1208Rep.updateStatus(apiData.getId(), Constant.CZBZ_U);
|
// }
|
// }
|
// }
|
// }
|
//
|
// /**
|
// * 1209
|
// *
|
// * @param param
|
// */
|
// private void pushData1209(ApiParam param) {
|
//
|
// List<Api1209> items = api1209Rep.findPushData(param.getKqdm());
|
//
|
// if (null == items || items.isEmpty()) {
|
// return;
|
// }
|
//
|
// param.setInteCategory(Constant.API_CATEGORY_12);
|
// param.setInteId(Constant.API_CODE_1209);
|
//
|
// ResponseDto responseDto;
|
// Api1209 apiData;
|
// for (Api1209 data : items) {
|
// apiData = new Api1209();
|
// BeanUtils.copyProperties(data, apiData);
|
// param.setBizId(data.getBizId());
|
// responseDto = apiRemoteService.pushData(param, apiData);
|
//
|
// if (responseDto.getSuccess() == 0) {
|
// if (Constant.CZBZ_I.equals(apiData.getCzbz())) {
|
// api1209Rep.updateStatus(apiData.getSydh(), Constant.CZBZ_U);
|
// }
|
// }
|
// }
|
// }
|
|
|
}
|