浏览代码

fix联锁查询加上装置、系统;fix时间tag_time

LLL 1 年之前
父节点
当前提交
eb0e93d610

+ 2 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/convert/InterlockDetailConvert.java

@@ -19,7 +19,8 @@ public interface InterlockDetailConvert {
 
     @Mapping(target = "id", ignore = true)
     @Mapping(target = "interlockname",source = "interlockName")
-    InterlockDetail toEntity(InterlockDetailAddDTO dto,String interlockName);
+    @Mapping(target = "tagTime",source = "tagTime")
+    InterlockDetail toEntity(InterlockDetailAddDTO dto,String interlockName,String tagTime);
 
     InterlockDetailAddDTO toDTO(InterlockDetail detail);
 

+ 4 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/dto/InterlockDetailAddDTO.java

@@ -227,4 +227,8 @@ public class InterlockDetailAddDTO {
     @Excel(name = "备注", width = 15)
     @ApiModelProperty(value = "备注")
     private java.lang.String remark;
+    /**点位当前时间*/
+    @Excel(name = "点位当前时间", width = 15)
+    @ApiModelProperty(value = "点位当前时间")
+    private java.lang.String tagTime;
 }

+ 4 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/entity/InterlockDetail.java

@@ -244,4 +244,8 @@ public class InterlockDetail implements Serializable {
     @Excel(name = "备注", width = 15)
     @ApiModelProperty(value = "备注")
     private java.lang.String remark;
+    /**点位当前时间*/
+    @Excel(name = "点位当前时间", width = 15)
+    @ApiModelProperty(value = "点位当前时间")
+    private java.lang.String tagTime;
 }

+ 3 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/mapper/xml/InterlockDetailMapper.xml

@@ -18,9 +18,11 @@
     <!-- 联锁总表-分页列表查询(各种逻辑状态)-->
     <select id="getPage" parameterType="org.jeecg.modules.summary.vo.InterlockSummaryVO" resultType="org.jeecg.modules.summary.vo.InterlockSummaryVO">
         select d.id, d.summaryid, d.interlockname, d.interlock_condition, d.interlock_condition_tag, d.instrument_status, d.control_system_status,
-               s.interlock_status, s.loop_health_level, d.bypass
+               s.interlock_status, s.loop_health_level, d.bypass, s.interlock_apparatus_id, s.interlock_system_id
         from interlock_detail d left join interlock_summary s on d.summaryid = s.id
         <where>
+            <if test="interlockSummaryVO.interlockApparatusId != null and interlockSummaryVO.interlockApparatusId != ''"> and s.interlock_apparatus_id like concat('%', #{interlockSummaryVO.interlockApparatusId}, '%')</if>
+            <if test="interlockSummaryVO.interlockSystemId != null and interlockSummaryVO.interlockSystemId != ''"> and s.interlock_system_id like concat('%', #{interlockSummaryVO.interlockSystemId}, '%')</if>
             <if test="interlockSummaryVO.interlockname != null and interlockSummaryVO.interlockname != ''"> and d.interlockname like concat('%', #{interlockSummaryVO.interlockname}, '%')</if>
             <if test="interlockSummaryVO.interlockCondition != null and interlockSummaryVO.interlockCondition != ''"> and d.interlock_condition = #{interlockSummaryVO.interlockCondition}</if>
             <if test="interlockSummaryVO.interlockConditionTag != null and interlockSummaryVO.interlockConditionTag != ''"> and d.interlock_condition_tag like concat('%',#{interlockSummaryVO.interlockConditionTag},'%')</if>

+ 4 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/vo/InterlockDetailEditQueryVO.java

@@ -213,4 +213,8 @@ public class InterlockDetailEditQueryVO {
     @Excel(name = "状态点位", width = 15)
     @ApiModelProperty(value = "状态点位")
     private java.lang.String mpStatusTag;
+    /**点位当前时间*/
+    @Excel(name = "点位当前时间", width = 15)
+    @ApiModelProperty(value = "点位当前时间")
+    private java.lang.String tagTime;
 }

+ 1 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/convert/InterlockSummaryConvert.java

@@ -39,6 +39,7 @@ public interface InterlockSummaryConvert {
     @Mapping(target = "loopHealthLevel",source = "loopHealthLevel")
     @Mapping(target = "deviceId",source = "interlockAddDTO.deviceId")
     @Mapping(target = "moduleName",source = "interlockAddDTO.moduleName")
+    @Mapping(target = "tagTime",source = "interlockAddDTO.tagTime")
     InterlockSummary toInterlockSummary(InterlockAddDTO interlockAddDTO,String interlockStatus,String loopHealthLevel);
 
     /**

+ 4 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/dto/InterlockAddDTO.java

@@ -64,6 +64,10 @@ public class InterlockAddDTO {
     @Excel(name = "联锁输出值点位", width = 15)
     @ApiModelProperty(value = "联锁输出值点位")
     private java.lang.String interlockOutValueTag;
+    /**点位当前时间*/
+    @Excel(name = "点位当前时间", width = 15)
+    @ApiModelProperty(value = "点位当前时间")
+    private java.lang.String tagTime;
 
     List<InterlockDetailAddDTO> interlockDetailAddDTOList;
 

+ 4 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/dto/InterlockEditQueryVO.java

@@ -64,6 +64,10 @@ public class InterlockEditQueryVO {
     @Excel(name = "联锁输出值点位", width = 15)
     @ApiModelProperty(value = "联锁输出值点位")
     private java.lang.String interlockOutValueTag;
+    /**点位当前时间*/
+    @Excel(name = "点位当前时间", width = 15)
+    @ApiModelProperty(value = "点位当前时间")
+    private java.lang.String tagTime;
 
     List<InterlockDetailEditQueryVO> interlockDetailEditQueryVOList;
 

+ 4 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/entity/InterlockSummary.java

@@ -100,4 +100,8 @@ public class InterlockSummary implements Serializable {
 	/**所属部门*/
     @ApiModelProperty(value = "所属部门")
     private java.lang.String sysOrgCode;
+    /**点位当前时间*/
+    @Excel(name = "点位当前时间", width = 15)
+    @ApiModelProperty(value = "点位当前时间")
+    private java.lang.String tagTime;
 }

+ 15 - 2
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/service/impl/InterlockSummaryServiceImpl.java

@@ -22,6 +22,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
@@ -112,6 +114,12 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
      *   联锁管理——编辑联锁
      */
     public void editLS(InterlockAddDTO interlockAddDTO){
+        // 获取当前日期时间
+        LocalDateTime currentDateTime = LocalDateTime.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String formattedDateTime = currentDateTime.format(formatter);
+        interlockAddDTO.setTagTime(formattedDateTime);
+
         String summaryId = interlockAddDTO.getId();
 
         List<InterlockDetailAddDTO> interlockDetailAddDTOList = interlockAddDTO.getInterlockDetailAddDTOList();
@@ -168,7 +176,7 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
                 controlSystemStatus = "1";
             } else dto.setControlSystemStatus("0");
 
-            InterlockDetail detail = InterlockDetailConvert.INSTANCE.toEntity(dto, interlockAddDTO.getInterlockName());
+            InterlockDetail detail = InterlockDetailConvert.INSTANCE.toEntity(dto, interlockAddDTO.getInterlockName(),formattedDateTime);
 
             //新增联锁详细信息表数据
             interlockDetailMapper.insert(detail);
@@ -194,6 +202,11 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
      *   联锁管理——新增联锁
      */
     public void addLS(InterlockAddDTO interlockAddDTO){
+        // 获取当前日期时间
+        LocalDateTime currentDateTime = LocalDateTime.now();
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+        String formattedDateTime = currentDateTime.format(formatter);
+        interlockAddDTO.setTagTime(formattedDateTime);
 
         List<InterlockDetailAddDTO> interlockDetailAddDTOList = interlockAddDTO.getInterlockDetailAddDTOList();
 
@@ -244,7 +257,7 @@ public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMap
                 controlSystemStatus = "1";
             } else dto.setControlSystemStatus("0");
 
-            InterlockDetail detail = InterlockDetailConvert.INSTANCE.toEntity(dto,interlockAddDTO.getInterlockName());
+            InterlockDetail detail = InterlockDetailConvert.INSTANCE.toEntity(dto,interlockAddDTO.getInterlockName(), formattedDateTime);
             //新增联锁详细信息表数据
             interlockDetailMapper.insert(detail);
 

+ 10 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/vo/InterlockSummaryVO.java

@@ -62,4 +62,14 @@ public class InterlockSummaryVO {
     @ApiModelProperty(value = "旁路状态")
     private java.lang.String bypass;
 
+
+    /**装置id*/
+    @Excel(name = "装置id", width = 15)
+    @ApiModelProperty(value = "装置id")
+    private java.lang.String interlockApparatusId;
+    /**系统id*/
+    @Excel(name = "系统id", width = 15)
+    @ApiModelProperty(value = "系统id")
+    private java.lang.String interlockSystemId;
+
 }