From 8f573106256d0a4826adbb69fea8ad474846ce72 Mon Sep 17 00:00:00 2001 From: chendaofei <857448963@qq.com> Date: Fri, 29 Nov 2024 16:35:10 +0800 Subject: [PATCH] =?UTF-8?q?1.=E7=8E=B0=E5=9C=BA=E7=9B=91=E7=9D=A3=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/njcn/web/utils/GwSendUtil.java | 2 +- .../process/pojo/param/SupvProblemParam.java | 3 +++ .../com/njcn/process/pojo/po/SupvProblem.java | 5 +++++ .../njcn/process/pojo/vo/SupvProblemVO.java | 3 +++ .../com/njcn/process/pojo/vo/gw/AlarmVO.java | 17 +++++++++++++---- .../controller/SupvAlarmController.java | 19 ++++++++++++++----- .../service/impl/SupvPushGwServiceImpl.java | 18 ++++++++++++++---- 7 files changed, 53 insertions(+), 14 deletions(-) diff --git a/pqs-common/common-web/src/main/java/com/njcn/web/utils/GwSendUtil.java b/pqs-common/common-web/src/main/java/com/njcn/web/utils/GwSendUtil.java index 70924d216..4d16257e4 100644 --- a/pqs-common/common-web/src/main/java/com/njcn/web/utils/GwSendUtil.java +++ b/pqs-common/common-web/src/main/java/com/njcn/web/utils/GwSendUtil.java @@ -47,7 +47,7 @@ public class GwSendUtil { cb = new ContentBody(""); } else { String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT); - log.info(Thread.currentThread().getName() + "1.信息:" + s); + log.info(Thread.currentThread().getName() + "1.上送网公司信息:" + s); cb = new ContentBody(s); } //ContentBody传递,要求使用post方式进行调用 diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvProblemParam.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvProblemParam.java index 9713fbfa2..2ffac4a04 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvProblemParam.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/param/SupvProblemParam.java @@ -153,6 +153,9 @@ public class SupvProblemParam extends BaseParam { @DateTimeStrValid(format="yyyy-MM-dd HH:mm:ss",message = "问题发现时间格式有误") private String discoveryTime; + @ApiModelProperty("告预警单id,当ifReleaseWarning为是时,必填") + private String workAlarmId; + @EqualsAndHashCode(callSuper = true) @Data public static class UpdateSupvProblemParam extends SupvProblemParam{ diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java index 1a7896d1b..6840375cd 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvProblem.java @@ -156,4 +156,9 @@ public class SupvProblem extends BaseEntity { @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") private LocalDateTime discoveryTime; + + @ApiModelProperty("告预警单id,当ifReleaseWarning为是时,必填") + private String workAlarmId; + + } diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvProblemVO.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvProblemVO.java index 3f49f97b8..91e2dd5ab 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvProblemVO.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/SupvProblemVO.java @@ -110,4 +110,7 @@ public class SupvProblemVO { @Excel(name = "备注",width = 40) private String remark; + @ApiModelProperty("告预警单id,当ifReleaseWarning为是时,必填") + private String workAlarmId; + } diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/gw/AlarmVO.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/gw/AlarmVO.java index 2aef8d80c..fd79db865 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/gw/AlarmVO.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/gw/AlarmVO.java @@ -76,9 +76,7 @@ public class AlarmVO { private String receiveUserName; @ApiModelProperty("编制时间 yyyy-MM-dd HH:mm:ss") - @TableField("creater_Time") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") - private LocalDateTime createrTime; + private Long createrTime; @ApiModelProperty("主管部门id,取ISC平台上的组织id") @TableField("manager_Dept_Id") @@ -120,6 +118,17 @@ public class AlarmVO { @TableField("is_upload_head") private Integer isUploadHead; + @ApiModelProperty("告预警单id,当ifReleaseWarning为是时,必填") + private String workAlarmId; + + public String getWorkAlarmId() { + return workAlarmId; + } + + public void setWorkAlarmId(String workAlarmId) { + this.workAlarmId = workAlarmId; + } + public void setAlarmId(String alarmId) { if (StrUtil.isNotBlank(alarmId)) { this.alarmId = alarmId; @@ -224,7 +233,7 @@ public class AlarmVO { } } - public void setCreaterTime(LocalDateTime createrTime) { + public void setCreaterTime(Long createrTime) { this.createrTime = createrTime; } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvAlarmController.java b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvAlarmController.java index ea54c7489..4acd531bf 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvAlarmController.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/controller/SupvAlarmController.java @@ -1,6 +1,7 @@ package com.njcn.process.controller; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.njcn.common.pojo.annotation.OperateInfo; import com.njcn.common.pojo.constant.OperateType; @@ -16,11 +17,8 @@ import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiOperation; import lombok.RequiredArgsConstructor; import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.*; -import org.springframework.web.bind.annotation.RestController; import com.njcn.web.controller.BaseController; import java.util.List; @@ -70,7 +68,7 @@ public class SupvAlarmController extends BaseController { } @PostMapping("/downAlarm") - @OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD) + @OperateInfo(info = LogEnum.BUSINESS_COMMON) @ApiOperation("导出预告警单信息") public void downAlarm(){ supvAlarmService.downAlarm(); @@ -86,5 +84,16 @@ public class SupvAlarmController extends BaseController { return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, supvPlanHisPage, methodDescribe); } + @GetMapping("/selectAlarmList") + @OperateInfo(info = LogEnum.BUSINESS_COMMON) + @ApiOperation("预告警单下拉") + public HttpResult> selectAlarmList(){ + String methodDescribe = getMethodDescribe("selectAlarmList"); + LambdaQueryWrapper lambdaQueryWrapper = new LambdaQueryWrapper<>(); + lambdaQueryWrapper.select(SupvAlarm::getAlarmId,SupvAlarm::getBillNo,SupvAlarm::getBillName).orderByDesc(SupvAlarm::getCreaterTime); + List result = supvAlarmService.list(lambdaQueryWrapper); + return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe); + } + } diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java index b72d41ad2..c16cdd970 100644 --- a/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/service/impl/SupvPushGwServiceImpl.java @@ -45,6 +45,7 @@ import org.springframework.stereotype.Service; import java.io.IOException; import java.io.InputStream; import java.time.LocalDateTime; +import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.*; import java.util.function.Function; @@ -532,7 +533,10 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { List specialityList = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.SPECIALITY_TYPE.getCode()).getData(); Map mapSpeciality = specialityList.stream().collect(Collectors.toMap(DictData::getId, Function.identity())); DictData dictData; + + List alarmVOList = new ArrayList<>(); for (SupvAlarm supvAlarm : supvAlarms) { + AlarmVO alarmVO = new AlarmVO(); //单据类型 if (mapBill.containsKey(supvAlarm.getBillType())) { @@ -545,15 +549,21 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { dictData = mapSpeciality.get(supvAlarm.getSpecialityType()); supvAlarm.setSpecialityType(String.format("%02d", dictData.getAlgoDescribe())); } + + BeanUtil.copyProperties(supvAlarm,alarmVO); + alarmVO.setCreaterTime(supvAlarm.getCreaterTime().atZone(ZoneId.systemDefault()).toInstant().toEpochMilli()); + + alarmVOList.add(alarmVO); } - List list = BeanUtil.copyToList(supvAlarms, AlarmVO.class); + + SendParam param = new SendParam(); - param.setStats(list); + param.setStats(alarmVOList); param.setProvinceId(code); String s = JSONObject.toJSONStringWithDateFormat(param, JSON.DEFFAULT_DATE_FORMAT); - log.info(Thread.currentThread().getName() + "获取返回体 工作计划变更历史数据接口:" + s + "结束----!"); + //log.info(Thread.currentThread().getName() + "获取返回体 工作计划变更历史数据接口:" + s + "结束----!"); Map send = send(param, getUrl(8), "pqAlarmCreate"); - log.info(Thread.currentThread().getName() + "获取返回体 工作计划变更历史数据接口:" + send + "结束----!"); + //log.info(Thread.currentThread().getName() + "获取返回体 工作计划变更历史数据接口:" + send + "结束----!"); if (send.containsKey("succeed")) { String succeed = send.get("succeed"); if (succeed.indexOf("\\\"") != -1) {