1.下发接口修改
2.工单接口开发
This commit is contained in:
@@ -35,6 +35,11 @@ public enum GWSendEnum {
|
||||
SUBSTATION_MONITOR("pqSubstationMonitorCreate", "/WMCenter/powerQuality/substationMonitor/create"),
|
||||
//接收其他干扰用户台账数据接口
|
||||
OTHER_USER_CREATE("pqOtherUserCreate", "/WMCenter/powerQuality/archivalInformation/otherUserCreate"),
|
||||
|
||||
|
||||
|
||||
//调用总部下发工单的反馈单接口
|
||||
WORK_ORDER_FEEDBACK("workOrderFeedBack", "/pms-ghq-powerquality-start/powerQuality/workOrder/receiveFeedbackInfo"),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.njcn.web.utils;
|
||||
|
||||
import cn.hutool.core.text.StrBuilder;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.csb.sdk.*;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
@@ -10,9 +11,12 @@ import com.njcn.web.pojo.param.SendParam;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
/**
|
||||
* @author wr
|
||||
@@ -106,4 +110,36 @@ public class GwSendUtil {
|
||||
}
|
||||
return token;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 用于单次调用的返回
|
||||
* @author cdf
|
||||
* @date 2024/6/18
|
||||
*/
|
||||
public static Integer returnInfoMsg(List<String> ids, Map<String, String> res) {
|
||||
if (res.containsKey("succeed")) {
|
||||
String succeed = res.get("succeed");
|
||||
if (succeed.contains("\\\"")) {
|
||||
succeed = succeed.replace("\\\"", "\"");
|
||||
}
|
||||
Map mapData = JSON.parseObject(succeed, Map.class);
|
||||
String status = mapData.get("status").toString();
|
||||
if ("000000".equals(status)) {
|
||||
//修改数据上送状态
|
||||
String result = mapData.get("result").toString();
|
||||
Map mapCount = JSON.parseObject(result, Map.class);
|
||||
String count = mapCount.get("count").toString();
|
||||
return Integer.valueOf(count);
|
||||
} else {
|
||||
String errors = mapData.get("errors").toString();
|
||||
String errorMsg = " 上送" + ids.size()+"条数据失败,错误信息:" + status + "_" + errors + " ;";
|
||||
throw new BusinessException(errorMsg);
|
||||
}
|
||||
} else {
|
||||
throw new BusinessException("当前时间段国网上送请求过多,请稍后再试");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user