| | |
| | | package com.fzzy.push.sh2023; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fzzy.api.Constant; |
| | | import com.fzzy.api.data.ApiParam; |
| | | import com.fzzy.api.data.PushProtocol; |
| | | import com.fzzy.api.dto.ResponseDto; |
| | | import com.fzzy.api.entity.*; |
| | | import com.fzzy.api.service.ApiRemoteService; |
| | | import com.fzzy.api.service.PushService11; |
| | | import com.fzzy.api.service.PushService12; |
| | | import com.fzzy.api.view.repository.*; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api2101; |
| | | import com.fzzy.push.sh2023.dto.SH2023Api2104; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Slf4j |
| | | @Component |
| | | public class SH2023PushService12 implements PushService11 { |
| | | public class SH2023PushService12 implements PushService12 { |
| | | |
| | | |
| | | @Autowired |
| | |
| | | */ |
| | | public void pushData2101(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取 检斤单信息 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2101); |
| | | |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_2101); |
| | | |
| | | ResponseDto responseDto; |
| | | SH2023Api2101 shApi2101; |
| | | for (ApiInfoData infoData : items) { |
| | | shApi2101 = JSONObject.parseObject(infoData.getData(), SH2023Api2101.class); |
| | | shApi2101.setCzbz(infoData.getCzbz()); |
| | | shApi2101.setZhgxsj(infoData.getUpdateTime()); |
| | | param.setBizId(infoData.getDataId()); |
| | | responseDto = apiRemoteService.pushData(param, shApi2101); |
| | | if (responseDto.getSuccess() == 0) { |
| | | if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | infoData.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(infoData); |
| | | } |
| | | } |
| | | } |
| | | // List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2101); |
| | | // |
| | | // param.setInteCategory(Constant.API_CATEGORY_12); |
| | | // param.setInteId(SH2023Constant.SH_2023_API_CODE_2101); |
| | | // |
| | | // ResponseDto responseDto; |
| | | // SH2023Api2101 shApi2101; |
| | | // for (ApiInfoData infoData : items) { |
| | | // shApi2101 = JSONObject.parseObject(infoData.getData(), SH2023Api2101.class); |
| | | // shApi2101.setCzbz(infoData.getCzbz()); |
| | | // shApi2101.setZhgxsj(infoData.getUpdateTime()); |
| | | // param.setBizId(infoData.getDataId()); |
| | | // responseDto = apiRemoteService.pushData(param, shApi2101); |
| | | // if (responseDto.getSuccess() == 0) { |
| | | // if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | // infoData.setCzbz(Constant.CZBZ_U); |
| | | // apiInfoDataRep.save(infoData); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | public void pushData2104(ApiRemoteService apiRemoteService, ApiParam param) { |
| | | //获取 检斤单信息 |
| | | List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | | // List<ApiInfoData> items = apiInfoDataRep.getDataByInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | | |
| | | param.setInteCategory(Constant.API_CATEGORY_12); |
| | | param.setInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | | |
| | | ResponseDto responseDto; |
| | | SH2023Api2104 shApi2104; |
| | | for (ApiInfoData infoData : items) { |
| | | shApi2104 = JSONObject.parseObject(infoData.getData(), SH2023Api2104.class); |
| | | shApi2104.setCzbz(infoData.getCzbz()); |
| | | shApi2104.setZhgxsj(infoData.getUpdateTime()); |
| | | |
| | | param.setBizId(infoData.getDataId()); |
| | | responseDto = apiRemoteService.pushData(param, shApi2104); |
| | | if (responseDto.getSuccess() == 0) { |
| | | if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | infoData.setCzbz(Constant.CZBZ_U); |
| | | apiInfoDataRep.save(infoData); |
| | | } |
| | | } |
| | | } |
| | | // param.setInteCategory(Constant.API_CATEGORY_12); |
| | | // param.setInteId(SH2023Constant.SH_2023_API_CODE_2104); |
| | | // |
| | | // ResponseDto responseDto; |
| | | // SH2023Api2104 shApi2104; |
| | | // for (ApiInfoData infoData : items) { |
| | | // shApi2104 = JSONObject.parseObject(infoData.getData(), SH2023Api2104.class); |
| | | // shApi2104.setCzbz(infoData.getCzbz()); |
| | | // shApi2104.setZhgxsj(infoData.getUpdateTime()); |
| | | // |
| | | // param.setBizId(infoData.getDataId()); |
| | | // responseDto = apiRemoteService.pushData(param, shApi2104); |
| | | // if (responseDto.getSuccess() == 0) { |
| | | // if (Constant.CZBZ_I.equals(infoData.getCzbz())) { |
| | | // infoData.setCzbz(Constant.CZBZ_U); |
| | | // apiInfoDataRep.save(infoData); |
| | | // } |
| | | // } |
| | | // } |
| | | } |
| | | } |