1.国网工具类提交
This commit is contained in:
@@ -13,5 +13,6 @@ import java.util.List;
|
||||
public class SendParam {
|
||||
|
||||
private String provinceId;
|
||||
private String secretKey="lW2xr6zKjbaqVDOSgQpcGrM6Rg0=";
|
||||
private List stats;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
@@ -55,12 +56,14 @@ public class SupvFile {
|
||||
private String uploaderName;
|
||||
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime uploadTime;
|
||||
|
||||
@ApiModelProperty("上传人id")
|
||||
private String uploaderId;
|
||||
|
||||
@ApiModelProperty("创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@ApiModelProperty("0.未上送 1.已上送 2.取消上送")
|
||||
|
||||
@@ -59,6 +59,7 @@ import java.util.stream.Stream;
|
||||
public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
|
||||
private final SupvPlanMapper supvPlanMapper;
|
||||
private final ISupvPlanService iSupvPlanService;
|
||||
|
||||
private final SupvProblemMapper supvProblemMapper;
|
||||
|
||||
@@ -418,45 +419,12 @@ public class SupvPushGwServiceImpl implements SupvPushGwService {
|
||||
if (count > 0) {
|
||||
throw new BusinessException("请选择已上送计划");
|
||||
}
|
||||
|
||||
List<SupvPlan> supvPlanList = new ArrayList<>();
|
||||
for (String id : planIds) {
|
||||
SupvPlan supvPlan = new SupvPlan();
|
||||
supvPlan.setPlanId(id);
|
||||
supvPlan.setDeleteFlag(null);
|
||||
supvPlanList.add(supvPlan);
|
||||
}
|
||||
|
||||
//TODO
|
||||
SendParam param = new SendParam();
|
||||
param.setStats(supvPlanList);
|
||||
param.setProvinceId(code);
|
||||
String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT);
|
||||
log.info(Thread.currentThread().getName() + "获取返回体 删除电能质量技术监督工作计划接口数据:" + s + "结束----!");
|
||||
Map<String, String> send = send(param, getUrl(6), "pqPlanDelete");
|
||||
log.info(Thread.currentThread().getName() + "获取返回体 删除电能质量技术监督工作计划接口响应结果:" + send + "结束----!");
|
||||
if (send.containsKey("succeed")) {
|
||||
String succeed = send.get("succeed");
|
||||
if (succeed.indexOf("\\\"") != -1) {
|
||||
succeed = succeed.replace("\\\"", "\"");
|
||||
}
|
||||
Map map = JSON.parseObject(succeed, Map.class);
|
||||
String status = map.get("status").toString();
|
||||
if ("000000".equals(status)) {
|
||||
for (SupvPlan supvPlan : supvPlanList) {
|
||||
supvPlanMapper.updateId(2, supvPlan.getPlanId());
|
||||
}
|
||||
String result = map.get("result").toString();
|
||||
Map mapCount = JSON.parseObject(result, Map.class);
|
||||
String countNum = mapCount.get("count").toString();
|
||||
return "操作成功:成功数据" + countNum + "条";
|
||||
} else {
|
||||
String errors = map.get("errors").toString();
|
||||
throw new BusinessException("操作失败:" + status + "_" + errors);
|
||||
}
|
||||
} else {
|
||||
throw new BusinessException("当前时间段国网上送请求过多,请稍后再试");
|
||||
}
|
||||
iSupvPlanService.update(new LambdaUpdateWrapper<SupvPlan>()
|
||||
.set(SupvPlan::getDeleteFlag, 1)
|
||||
.set(SupvPlan::getDeleteTime, LocalDateTime.now())
|
||||
.in(SupvPlan::getPlanId, planIds)
|
||||
);
|
||||
return this.pushPlan(planIds);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user