1.技术监督:国网上送接口修改

This commit is contained in:
wr
2023-07-10 18:52:30 +08:00
parent bd8d416bb0
commit 0a3e91aaca
2 changed files with 43 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ package com.njcn.process.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.njcn.common.pojo.exception.BusinessException;
import com.njcn.oss.utils.FileStorageUtil;
@@ -177,7 +178,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
//TODO 调用国网接口
// Map map = postStatsUrl(getUrl(1), null, supvPlanList);
JSONArray objects = new JSONArray(Collections.singletonList(supvPlanList));
String s = objects.toString();
log.info(Thread.currentThread().getName() + "获取返回体 推送技术监督工作计划:" + s + "结束----");
for(SupvPlan supvPlan: supvPlanList){
SupvPlan supvPlanPO = new SupvPlan();
supvPlanPO.setPlanId(supvPlan.getPlanId());
@@ -231,7 +234,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
// 目前一个问题对应一个措施,上送一个问题需要调用问题接口和整改措施接口
// Map map = postStatsUrl(getUrl(2), null, supvProblemList);
// Map map = postStatsUrl(getUrl(3), null, supvProblemList);
JSONArray objects = new JSONArray(Collections.singletonList(supvProblemList));
String s = objects.toString();
log.info(Thread.currentThread().getName() + "获取返回体 推送技术监督实施问题:" + s + "结束----");
for(SupvProblem supvProblem:supvProblemList){
SupvProblem supvProblemPO = new SupvProblem();
supvProblemPO.setProblemId(supvProblem.getProblemId());
@@ -244,11 +249,14 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
@Override
public boolean pushFile(List<String> busIds) throws IOException {
LambdaQueryWrapper<SupvFile> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SupvFile::getBusiId,busIds);
lambdaQueryWrapper.in(SupvFile::getBusiId,busIds);
List<SupvFile> supvFiles = supvFileMapper.selectList(lambdaQueryWrapper);
if(supvFiles.size()>100){
throw new BusinessException("一次最多上送100条数据");
}
JSONArray objects = new JSONArray(Collections.singletonList(supvFiles));
String s = objects.toString();
log.info(Thread.currentThread().getName() + "获取返回体 推送附件接口:" + s + "结束----");
//TODO 调用上送接口
// for (SupvFile supvFile : supvFiles) {
// Map map = postFileUrl(getUrl(4), null, supvFile);
@@ -259,7 +267,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
@Override
public boolean pushMonthReportStatistic(List<String> monthReportId) {
LambdaQueryWrapper<SupvReportM> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(SupvReportM::getMonthReportId,monthReportId);
lambdaQueryWrapper.in(SupvReportM::getMonthReportId,monthReportId);
List<SupvReportM> supvReportMList = supvReportMMapper.selectList(lambdaQueryWrapper);
if(supvReportMList.size()>100){
@@ -267,7 +275,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
}
//TODO 调用上送接口
// Map map = postStatsUrl(getUrl(5), null, supvReportMList);
JSONArray objects = new JSONArray(Collections.singletonList(supvReportMList));
String s = objects.toString();
log.info(Thread.currentThread().getName() + "获取返回体 推送技术监督月报统计数据接口:" + s + "结束----");
for(SupvReportM supvReportM : supvReportMList){
SupvReportM supvReportMPO = new SupvReportM();
supvReportMPO.setMonthReportId(supvReportM.getMonthReportId());
@@ -297,7 +307,9 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
//TODO
// Map map = postStatsUrl(getUrl(6), null, supvPlanList);
JSONArray objects = new JSONArray(Collections.singletonList(supvPlanList));
String s = objects.toString();
log.info(Thread.currentThread().getName() + "获取返回体 取消电能质量技术监督工作计划接口:" + s + "结束----");
for(SupvPlan supvPlan : supvPlanList) {
supvPlan.setIsUploadHead(2);
supvPlanMapper.updateById(supvPlan);
@@ -396,7 +408,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
* @return
*/
public static String getUrl(Integer type){
String url="http://ip:port";
String url="http://25.36.214.86:32234";
switch (type){
case 1: