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 5bd44f01f..a00b434a7 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 @@ -61,6 +61,7 @@ public class GwSendUtil { builder.contentBody(cb); String token = LoginToken(); + System.out.println("获取token------->"+token); builder.putHeaderParamsMap("x-token", token); builder.putHeaderParamsMap("serviceName", sendEnum.getServiceName()); //进行调用,返回结果 diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java index 7896ecda8..389a6bf5a 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlan.java @@ -6,6 +6,7 @@ import com.njcn.db.bo.BaseEntity; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.List; import lombok.Data; @@ -221,4 +222,13 @@ public class SupvPlan extends BaseEntity { */ private String effectUserName; + /** + * 计划来源 + */ + private String dataSource = "01"; + + + @TableField(exist = false) + private List planRel; + } diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java new file mode 100644 index 000000000..a34aeaccc --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/po/SupvPlanRel.java @@ -0,0 +1,57 @@ +package com.njcn.process.pojo.po; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.fasterxml.jackson.databind.annotation.JsonSerialize; +import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer; +import com.njcn.db.bo.BaseEntity; +import java.io.Serializable; +import java.sql.Timestamp; +import java.time.LocalDateTime; + +import com.njcn.process.utils.TimestampAsLongSerializer; +import lombok.Data; +import lombok.Getter; +import lombok.Setter; + +/** + *

+ * + *

+ * + * @author cdf + * @since 2024-10-30 + */ +@Data +@TableName("supv_plan_rel") +public class SupvPlanRel { + + private static final long serialVersionUID = 1L; + + private String objId; + + private String planId; + + /** + * 关联对象类型 + */ + private String relObjType; + + private String relObjId; + + private String relObjName; + + @JsonSerialize(using = TimestampAsLongSerializer.class) + private Timestamp createTime; + + @JsonSerialize(using = TimestampAsLongSerializer.class) + private Timestamp updateTime; + + private String isDelete; + + @JsonSerialize(using = TimestampAsLongSerializer.class) + private LocalDateTime deleteTime; + + +} diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/gw/PlanVO.java b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/gw/PlanVO.java index 0a1ffe110..db15d8a38 100644 --- a/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/gw/PlanVO.java +++ b/pqs-process/process-api/src/main/java/com/njcn/process/pojo/vo/gw/PlanVO.java @@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonFormat; import com.njcn.db.bo.BaseEntity; +import com.njcn.process.pojo.po.SupvPlanRel; import lombok.Getter; import java.time.LocalDate; import java.time.LocalDateTime; +import java.util.List; /** * @author wr @@ -191,6 +193,13 @@ public class PlanVO extends BaseEntity { private LocalDateTime problemOcTime; + + + + + + + /** * 0.未上送 1.上送 2.取消上送 */ @@ -217,6 +226,25 @@ public class PlanVO extends BaseEntity { */ private String effectUserName; + + /** + * 计划来源 + */ + private String dataSource = "01"; + + + @TableField(exist = false) + private List planRel; + + + public void setDataSource(String dataSource) { + this.dataSource = dataSource; + } + + public void setPlanRel(List planRel) { + this.planRel = planRel; + } + public void setPlanId(String planId) { if (StrUtil.isNotBlank(planId)) { this.planId = planId; diff --git a/pqs-process/process-api/src/main/java/com/njcn/process/utils/TimestampAsLongSerializer.java b/pqs-process/process-api/src/main/java/com/njcn/process/utils/TimestampAsLongSerializer.java new file mode 100644 index 000000000..2bb3a30da --- /dev/null +++ b/pqs-process/process-api/src/main/java/com/njcn/process/utils/TimestampAsLongSerializer.java @@ -0,0 +1,21 @@ +package com.njcn.process.utils; + +import com.fasterxml.jackson.core.JsonGenerator; +import com.fasterxml.jackson.databind.JsonSerializer; +import com.fasterxml.jackson.databind.SerializerProvider; +import org.springframework.stereotype.Component; + +import java.io.IOException; +import java.sql.Timestamp; + +@Component +public class TimestampAsLongSerializer extends JsonSerializer { + @Override + public void serialize(Timestamp value, JsonGenerator gen, SerializerProvider serializers) throws IOException { + if (value != null) { + gen.writeNumber(value.getTime()); + } else { + gen.writeNull(); + } + } +} \ No newline at end of file diff --git a/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvPlanRelMapper.java b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvPlanRelMapper.java new file mode 100644 index 000000000..cd47427ee --- /dev/null +++ b/pqs-process/process-boot/src/main/java/com/njcn/process/mapper/SupvPlanRelMapper.java @@ -0,0 +1,17 @@ +package com.njcn.process.mapper; + + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.njcn.process.pojo.po.SupvPlanRel; + +/** + *

+ * Mapper 接口 + *

+ * + * @author cdf + * @since 2024-10-30 + */ +public interface SupvPlanRelMapper extends BaseMapper { + +} 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 9d9db1d8b..90ffd923f 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 @@ -16,6 +16,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.njcn.common.pojo.exception.BusinessException; import com.njcn.oss.utils.FileStorageUtil; import com.njcn.process.mapper.SupvPlanMapper; +import com.njcn.process.mapper.SupvPlanRelMapper; import com.njcn.process.mapper.SupvProblemMapper; import com.njcn.process.mapper.SupvReportMMapper; import com.njcn.process.pojo.param.SendParam; @@ -81,6 +82,7 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { private final ISupvAlarmBackService supvAlarmBackService; private final SupvProblemServiceImpl supvProblemService; + private final SupvPlanRelMapper supvPlanRelMapper; @Value("${gw.url}") @@ -180,6 +182,14 @@ public class SupvPushGwServiceImpl implements SupvPushGwService { supvPlan.setSupvType(String.format("%02d", mapType.get(supvPlan.getSupvType()).getAlgoDescribe())); } + + if(supvPlan.getSupvType().equals("05")){ + //电容器组需要上送对象 + List supvPlanRelList = supvPlanRelMapper.selectList(new LambdaQueryWrapper().eq(SupvPlanRel::getPlanId,supvPlan.getPlanId())); + supvPlan.setPlanRel(supvPlanRelList); + + } + //监督类型编码 if (mapSupvState.containsKey(supvPlan.getSupvStage())) { supvPlan.setSupvStage(String.format("%02d", mapSupvState.get(supvPlan.getSupvStage()).getAlgoDescribe()));