|  |  |  | 
|---|
|  |  |  | import com.fzzy.api.Constant; | 
|---|
|  |  |  | import com.fzzy.api.data.ApiParam; | 
|---|
|  |  |  | import com.fzzy.api.dto.ResponseDto; | 
|---|
|  |  |  | import com.fzzy.api.entity.Api1403; | 
|---|
|  |  |  | import com.fzzy.api.entity.Api1404; | 
|---|
|  |  |  | import com.fzzy.api.entity.*; | 
|---|
|  |  |  | import com.fzzy.api.service.ApiRemoteService; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.Api1403Rep; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.Api1404Rep; | 
|---|
|  |  |  | import com.fzzy.push.gd2020.GDApiRemoteService; | 
|---|
|  |  |  | import com.fzzy.api.view.repository.*; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | public class ComPushService14 { | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1401Rep api1401Rep; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1402Rep api1402Rep; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1403Rep api1403Rep; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1404Rep api1404Rep; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private Api1405Rep api1405Rep; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1401(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1401> items = api1401Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有轮换计划需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_14); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1401); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1401 data : items) { | 
|---|
|  |  |  | param.setBizId(data.getBizId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(data.getCzbz())) { | 
|---|
|  |  |  | data.setCzbz(Constant.CZBZ_U); | 
|---|
|  |  |  | api1401Rep.save(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1402(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1402> items = api1402Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有轮换计划需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_14); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1402); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1402 data : items) { | 
|---|
|  |  |  | param.setBizId(data.getBizId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(data.getCzbz())) { | 
|---|
|  |  |  | data.setCzbz(Constant.CZBZ_U); | 
|---|
|  |  |  | api1402Rep.save(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1403(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1403> items = api1403Rep.findPushData(param.getKqdm()); | 
|---|
|  |  |  | List<Api1403> items = api1403Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有轮换计划需要推送-----------"); | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1404(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1404> items = api1404Rep.findPushData(param.getKqdm()); | 
|---|
|  |  |  | List<Api1404> items = api1404Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有轮换计划明细信息需要推送-----------"); | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void pushData1405(ApiRemoteService apiRemoteService, ApiParam param) { | 
|---|
|  |  |  | //获取需要推送的数据 | 
|---|
|  |  |  | List<Api1405> items = api1405Rep.findPushDataByTime(param.getKqdm(), param.getStart(), param.getEnd()); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (null == items || items.isEmpty()) { | 
|---|
|  |  |  | log.info("-------------没有轮换计划需要推送-----------"); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | param.setInteCategory(Constant.API_CATEGORY_14); | 
|---|
|  |  |  | param.setInteId(Constant.API_CODE_1403); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | ResponseDto responseDto; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | for (Api1405 data : items) { | 
|---|
|  |  |  | param.setBizId(data.getBizId()); | 
|---|
|  |  |  | responseDto = apiRemoteService.pushData(param, data); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if (responseDto.getSuccess() == 0) { | 
|---|
|  |  |  | if (Constant.CZBZ_I.equals(data.getCzbz())) { | 
|---|
|  |  |  | data.setCzbz(Constant.CZBZ_U); | 
|---|
|  |  |  | api1405Rep.save(data); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|