Browse Source

联锁新增修改(未完)

LLL 9 months ago
parent
commit
7253b30a8f
21 changed files with 705 additions and 63 deletions
  1. 2 2
      jeecg-module-interlock/src/main/java/org/jeecg/modules/base/entity/InterlockBase.java
  2. 4 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/base/service/IInterlockBaseService.java
  3. 22 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/base/service/impl/InterlockBaseServiceImpl.java
  4. 19 1
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/controller/InterlockDetailController.java
  5. 29 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/convert/InterlockDetailConvert.java
  6. 90 18
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/dto/InterlockDetailAddDTO.java
  7. 25 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/dto/InterlockDetailQueryDTO.java
  8. 19 17
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/entity/InterlockDetail.java
  9. 5 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/mapper/InterlockDetailMapper.java
  10. 18 4
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/mapper/xml/InterlockDetailMapper.xml
  11. 5 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/service/IInterlockDetailService.java
  12. 7 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/service/impl/InterlockDetailServiceImpl.java
  13. 78 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/vo/InterlockDetailQueryVO.java
  14. 42 6
      jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/controller/InterlockSummaryController.java
  15. 40 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/convert/InterlockSummaryConvert.java
  16. 2 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/dto/InterlockAddDTO.java
  17. 13 12
      jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/entity/InterlockSummary.java
  18. 18 1
      jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/service/IInterlockSummaryService.java
  19. 250 1
      jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/service/impl/InterlockSummaryServiceImpl.java
  20. 7 1
      jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/vo/InterlockSummaryVO.java
  21. 10 0
      jeecg-module-interlock/src/main/java/org/jeecg/modules/tag/entity/InterlockTag.java

+ 2 - 2
jeecg-module-interlock/src/main/java/org/jeecg/modules/base/entity/InterlockBase.java

@@ -32,10 +32,10 @@ public class InterlockBase implements Serializable {
 	@TableId(type = IdType.ASSIGN_ID)
     @ApiModelProperty(value = "主键")
     private java.lang.String id;
-	/**类型*/
+	/**类型 0装置1系统2联锁*/
 	@Excel(name = "类型", width = 15, dicCode = "interlock_type")
 	@Dict(dicCode = "interlock_type")
-    @ApiModelProperty(value = "类型")
+    @ApiModelProperty(value = "类型 0装置1系统2联锁")
     private java.lang.String interlockType;
 	/**名称*/
 	@Excel(name = "名称", width = 15)

+ 4 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/base/service/IInterlockBaseService.java

@@ -15,6 +15,10 @@ import java.util.List;
  */
 public interface IInterlockBaseService extends IService<InterlockBase> {
 
+	/**查表中有无该系统下的联锁,无则新增*/
+	public void judgeAndAdd(String pid, String interlockType, String interlockName, String hasChild);
+
+
 	/**查一二级树形结构*/
 	public List<InterlockBase> getLevel(InterlockBase interlockBase);
 

+ 22 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/base/service/impl/InterlockBaseServiceImpl.java

@@ -30,6 +30,28 @@ public class InterlockBaseServiceImpl extends ServiceImpl<InterlockBaseMapper, I
     @SuppressWarnings("all")
     private InterlockBaseMapper interlockBaseMapper;
 
+    /**查表中有无该系统下的联锁,无则新增*/
+    public void judgeAndAdd(String pid, String interlockType, String interlockName, String hasChild){
+        LambdaQueryWrapper<InterlockBase> queryWrapper = new LambdaQueryWrapper<>();
+        if (pid != null && !pid.isEmpty()) {
+            queryWrapper.eq(InterlockBase::getPid, pid);
+        }
+        if (interlockName != null && !interlockName.isEmpty()) {
+            queryWrapper.eq(InterlockBase::getInterlockName, interlockName);
+        }
+        queryWrapper.eq(InterlockBase::getInterlockType,"2");
+        queryWrapper.eq(InterlockBase::getHasChild,"0");
+        List<InterlockBase> list = interlockBaseMapper.selectList(queryWrapper);
+        if(list!=null && !list.isEmpty()){
+            InterlockBase interlockBase = new InterlockBase();
+            interlockBase.setPid(pid);
+            interlockBase.setInterlockType(interlockType);//0装置1系统2联锁
+            interlockBase.setInterlockName(interlockName);
+            interlockBase.setHasChild(hasChild);//	1是0否
+            interlockBaseMapper.insert(interlockBase);
+        }
+    }
+
     /**查一二级树形结构*/
     public List<InterlockBase> getLevel(InterlockBase interlockBase){
         return interlockBaseMapper.getLevel(interlockBase);

+ 19 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/controller/InterlockDetailController.java

@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.detail.dto.InterlockDetailQueryDTO;
 import org.jeecg.modules.detail.entity.InterlockDetail;
 import org.jeecg.modules.detail.service.IInterlockDetailService;
 
@@ -20,6 +21,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import lombok.extern.slf4j.Slf4j;
 
+import org.jeecg.modules.detail.vo.InterlockDetailQueryVO;
 import org.jeecg.modules.summary.vo.InterlockSummaryVO;
 import org.jeecgframework.poi.excel.ExcelImportUtil;
 import org.jeecgframework.poi.excel.def.NormalExcelConstants;
@@ -54,7 +56,7 @@ public class InterlockDetailController extends JeecgController<InterlockDetail,
 	/**联锁总表-分页列表查询(各种逻辑状态)*/
 	 @ApiOperation(value="联锁总表-分页列表查询(各种逻辑状态)", notes="联锁总表-分页列表查询(各种逻辑状态)")
 	 @GetMapping(value = "/list1")
-	 public Result<IPage<InterlockSummaryVO>> queryPageList(InterlockSummaryVO vo,
+	 public Result<IPage<InterlockSummaryVO>> list1(InterlockSummaryVO vo,
 															@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
 															@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
 															HttpServletRequest req) {
@@ -63,6 +65,22 @@ public class InterlockDetailController extends JeecgController<InterlockDetail,
 		 return Result.OK(pageList);
 	 }
 
+
+	 /**
+	  * 联锁详细信息表分页列表查询
+	  */
+	 //@AutoLog(value = "联锁详细信息表-分页列表查询")
+	 @ApiOperation(value="联锁详细信息表分页列表查询", notes="联锁详细信息表分页列表查询")
+	 @GetMapping(value = "/list2")
+	 public Result<IPage<InterlockDetailQueryVO>> list2(InterlockDetailQueryDTO dto,
+												 @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
+												 @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
+												 HttpServletRequest req) {
+		 Page<InterlockDetailQueryVO> page = new Page<InterlockDetailQueryVO>(pageNo, pageSize);
+		 IPage<InterlockDetailQueryVO> pageList = interlockDetailService.getPage2(page, dto);
+		 return Result.OK(pageList);
+	 }
+
 	/**
 	 * 分页列表查询
 	 *

+ 29 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/convert/InterlockDetailConvert.java

@@ -0,0 +1,29 @@
+package org.jeecg.modules.detail.convert;
+
+import org.jeecg.modules.detail.dto.InterlockDetailAddDTO;
+import org.jeecg.modules.detail.entity.InterlockDetail;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+import org.springframework.util.CollectionUtils;
+
+import java.util.stream.Collectors;
+
+/**
+ * 功能描述
+ *
+ * @author: nn
+ * @date: 2024年05月29日 9:59
+ */
+@Mapper(componentModel = "spring")
+public interface InterlockDetailConvert {
+
+    InterlockDetailConvert INSTANCE = Mappers.getMapper(InterlockDetailConvert.class);
+
+    @Mapping(target = "id", ignore = true)
+    InterlockDetail toEntity(InterlockDetailAddDTO dto);
+
+    InterlockDetailAddDTO toDTO(InterlockDetail detail);
+
+}

+ 90 - 18
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/dto/InterlockDetailAddDTO.java

@@ -22,35 +22,44 @@ public class InterlockDetailAddDTO {
     @Excel(name = "联锁名称", width = 15)
     @ApiModelProperty(value = "联锁名称")
     private java.lang.String interlockname;
-    /**联锁条件值*/
-    @Excel(name = "联锁条件值", width = 15)
-    @ApiModelProperty(value = "联锁条件值")
-    private java.lang.String interlockCondition;
+    /**联锁条件-设备id*/
+    @Excel(name = "联锁条件-设备id", width = 15)
+    @ApiModelProperty(value = "联锁条件-设备id")
+    private java.lang.String interlockConditionDeviceId;
+    /**联锁条件-模块名称*/
+    @Excel(name = "联锁条件-模块名称", width = 15)
+    @ApiModelProperty(value = "联锁条件-模块名称")
+    private java.lang.String interlockConditionModuleName;
     /**联锁条件点位*/
     @Excel(name = "联锁条件点位", width = 15)
     @ApiModelProperty(value = "联锁条件点位")
     private java.lang.String interlockConditionTag;
+    /**联锁条件值*/
+    @Excel(name = "联锁条件值", width = 15)
+    @ApiModelProperty(value = "联锁条件值")
+    private java.lang.String interlockCondition;
     /**描述*/
     @Excel(name = "描述", width = 15)
     @ApiModelProperty(value = "描述")
     private java.lang.String description;
-    /**设备id*/
-    @Excel(name = "设备id", width = 15)
-    @ApiModelProperty(value = "设备id")
-    private java.lang.String deviceId;
-    /**模块名称*/
-    @Excel(name = "模块名称", width = 15)
-    @ApiModelProperty(value = "模块名称")
-    private java.lang.String moduleName;
     /**仪表状态*/
     @Excel(name = "仪表状态", width = 15)
     @ApiModelProperty(value = "仪表状态")
+    @Dict(dicCode = "instrument_status")
     private java.lang.String instrumentStatus;
     /**仪表状态判断方式*/
     @Excel(name = "仪表状态判断方式", width = 15, dicCode = "instrument_status_juge")
     @Dict(dicCode = "instrument_status_juge")
     @ApiModelProperty(value = "仪表状态判断方式")
     private java.lang.String instrumentStatusJuge;
+    /**仪表状态-设备id*/
+    @Excel(name = "仪表状态-设备id", width = 15)
+    @ApiModelProperty(value = "仪表状态-设备id")
+    private java.lang.String instrumentStatusDeviceId;
+    /**仪表状态-模块名称*/
+    @Excel(name = "仪表状态-模块名称", width = 15)
+    @ApiModelProperty(value = "仪表状态-模块名称")
+    private java.lang.String instrumentStatusModuleName;
     /**仪表状态点位*/
     @Excel(name = "仪表状态点位", width = 15)
     @ApiModelProperty(value = "仪表状态点位")
@@ -59,9 +68,18 @@ public class InterlockDetailAddDTO {
     @Excel(name = "仪表状态值", width = 15)
     @ApiModelProperty(value = "仪表状态值")
     private java.lang.String instrumentStatusValue;
-    /**原始模拟量位号*/
-    @Excel(name = "原始模拟量位号", width = 15)
-    @ApiModelProperty(value = "原始模拟量位号")
+
+    /**原始模拟量-设备id*/
+    @Excel(name = "原始模拟量-设备id", width = 15)
+    @ApiModelProperty(value = "原始模拟量-设备id")
+    private java.lang.String ysmnlDeviceId;
+    /**原始模拟量-模块名称*/
+    @Excel(name = "原始模拟量-模块名称", width = 15)
+    @ApiModelProperty(value = "原始模拟量-模块名称")
+    private java.lang.String ysmnlModuleName;
+    /**原始模拟量点位*/
+    @Excel(name = "原始模拟量点位", width = 15)
+    @ApiModelProperty(value = "原始模拟量点位")
     private java.lang.String ysmnlTag;
     /**原始模拟量值*/
     @Excel(name = "原始模拟量值", width = 15)
@@ -90,11 +108,20 @@ public class InterlockDetailAddDTO {
     /**控制系统状态*/
     @Excel(name = "控制系统状态", width = 15)
     @ApiModelProperty(value = "控制系统状态")
+    @Dict(dicCode = "control_system_status")
     private java.lang.String controlSystemStatus;
     /**联锁设定值*/
     @Excel(name = "联锁设定值", width = 15)
     @ApiModelProperty(value = "联锁设定值")
     private java.lang.String interlockSetValue;
+    /**联锁设定值-设备id*/
+    @Excel(name = "联锁设定值-设备id", width = 15)
+    @ApiModelProperty(value = "联锁设定值-设备id")
+    private java.lang.String interlockSetDeviceId;
+    /**联锁设定值-模块名称*/
+    @Excel(name = "联锁设定值-模块名称", width = 15)
+    @ApiModelProperty(value = "联锁设定值-模块名称")
+    private java.lang.String interlockSetModuleName;
     /**联锁设定值点位*/
     @Excel(name = "联锁设定值点位", width = 15)
     @ApiModelProperty(value = "联锁设定值点位")
@@ -103,22 +130,51 @@ public class InterlockDetailAddDTO {
     @Excel(name = "当前值", width = 15)
     @ApiModelProperty(value = "当前值")
     private java.lang.String currentValue;
-    /**当前值位号*/
-    @Excel(name = "当前值位号", width = 15)
-    @ApiModelProperty(value = "当前值位号")
+    /**当前值-设备id*/
+    @Excel(name = "当前值-设备id", width = 15)
+    @ApiModelProperty(value = "当前值-设备id")
+    private java.lang.String currentValueDeviceId;
+    /**当前值-模块名称*/
+    @Excel(name = "当前值-模块名称", width = 15)
+    @ApiModelProperty(value = "当前值-模块名称")
+    private java.lang.String currentValueModuleName;
+    /**当前值点位*/
+    @Excel(name = "当前值点位", width = 15)
+    @ApiModelProperty(value = "当前值点位")
     private java.lang.String currentValueTag;
+
     /**是否旁路*/
     @Excel(name = "是否旁路", width = 15)
     @ApiModelProperty(value = "是否旁路")
     private java.lang.String ifBypass;
+    /**旁路状态*/
+    @ApiModelProperty(value = "旁路状态")
+    private java.lang.String bypassstatus;
+    /**旁路状态-设备id*/
+    @Excel(name = "旁路状态-设备id", width = 15)
+    @ApiModelProperty(value = "旁路状态-设备id")
+    private java.lang.String bypassDeviceId;
+    /**旁路状态-模块名称*/
+    @Excel(name = "旁路状态-模块名称", width = 15)
+    @ApiModelProperty(value = "旁路状态-模块名称")
+    private java.lang.String bypassModuleName;
     /**旁路状态点位*/
     @Excel(name = "旁路状态点位", width = 15)
     @ApiModelProperty(value = "旁路状态点位")
     private java.lang.String ifBypassTag;
+
     /**输入卡件状态*/
     @Excel(name = "输入卡件状态", width = 15)
     @ApiModelProperty(value = "输入卡件状态")
     private java.lang.String inputStatus;
+    /**输入卡件状态-设备id*/
+    @Excel(name = "输入卡件状态-设备id", width = 15)
+    @ApiModelProperty(value = "输入卡件状态-设备id")
+    private java.lang.String inputStatusDeviceId;
+    /**输入卡件状态-模块名称*/
+    @Excel(name = "输入卡件状态-模块名称", width = 15)
+    @ApiModelProperty(value = "输入卡件状态-模块名称")
+    private java.lang.String inputStatusModuleName;
     /**输入卡件状态点位*/
     @Excel(name = "输入卡件状态点位", width = 15)
     @ApiModelProperty(value = "输入卡件状态点位")
@@ -127,6 +183,14 @@ public class InterlockDetailAddDTO {
     @Excel(name = "输出卡件状态", width = 15)
     @ApiModelProperty(value = "输出卡件状态")
     private java.lang.String outputStatus;
+    /**输出卡件状态-设备id*/
+    @Excel(name = "输出卡件状态-设备id", width = 15)
+    @ApiModelProperty(value = "输出卡件状态-设备id")
+    private java.lang.String outputStatusDeviceId;
+    /**输出卡件状态-模块名称*/
+    @Excel(name = "输出卡件状态-模块名称", width = 15)
+    @ApiModelProperty(value = "输出卡件状态-模块名称")
+    private java.lang.String outputStatusModuleName;
     /**输出卡件状态点位*/
     @Excel(name = "输出卡件状态点位", width = 15)
     @ApiModelProperty(value = "输出卡件状态点位")
@@ -135,6 +199,14 @@ public class InterlockDetailAddDTO {
     @Excel(name = "MP状态", width = 15)
     @ApiModelProperty(value = "MP状态")
     private java.lang.String mpStatus;
+    /**MP状态-设备id*/
+    @Excel(name = "MP状态-设备id", width = 15)
+    @ApiModelProperty(value = "MP状态-设备id")
+    private java.lang.String mpStatusDeviceId;
+    /**MP状态-模块名称*/
+    @Excel(name = "MP状态-模块名称", width = 15)
+    @ApiModelProperty(value = "MP状态-模块名称")
+    private java.lang.String mpStatusModuleName;
     /**MP状态点位*/
     @Excel(name = "MP状态点位", width = 15)
     @ApiModelProperty(value = "MP状态点位")

+ 25 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/dto/InterlockDetailQueryDTO.java

@@ -0,0 +1,25 @@
+package org.jeecg.modules.detail.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecgframework.poi.excel.annotation.Excel;
+
+/**
+ * 功能描述
+ *
+ * @author: nn
+ * @date: 2024年05月29日 15:49
+ */
+@Data
+public class InterlockDetailQueryDTO {
+
+    /**联锁总表id*/
+    @Excel(name = "联锁总表id", width = 15)
+    @ApiModelProperty(value = "联锁总表id")
+    private java.lang.String summaryid;
+
+    /**联锁条件点位*/
+    @Excel(name = "联锁条件点位", width = 15)
+    @ApiModelProperty(value = "联锁条件点位")
+    private java.lang.String interlockConditionTag;
+}

+ 19 - 17
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/entity/InterlockDetail.java

@@ -56,17 +56,18 @@ public class InterlockDetail implements Serializable {
 	@Excel(name = "描述", width = 15)
     @ApiModelProperty(value = "描述")
     private java.lang.String description;
-	/**设备id*/
-	@Excel(name = "设备id", width = 15)
-    @ApiModelProperty(value = "设备id")
-    private java.lang.String deviceId;
-	/**模块名称*/
-	@Excel(name = "模块名称", width = 15)
-    @ApiModelProperty(value = "模块名称")
-    private java.lang.String moduleName;
+//	/**设备id*/
+//	@Excel(name = "设备id", width = 15)
+//    @ApiModelProperty(value = "设备id")
+//    private java.lang.String deviceId;
+//	/**模块名称*/
+//	@Excel(name = "模块名称", width = 15)
+//    @ApiModelProperty(value = "模块名称")
+//    private java.lang.String moduleName;
 	/**仪表状态*/
 	@Excel(name = "仪表状态", width = 15)
     @ApiModelProperty(value = "仪表状态")
+    @Dict(dicCode = "instrument_status")
     private java.lang.String instrumentStatus;
 	/**仪表状态判断方式*/
 	@Excel(name = "仪表状态判断方式", width = 15, dicCode = "instrument_status_juge")
@@ -81,9 +82,9 @@ public class InterlockDetail implements Serializable {
 	@Excel(name = "仪表状态值", width = 15)
     @ApiModelProperty(value = "仪表状态值")
     private java.lang.String instrumentStatusValue;
-	/**原始模拟量位*/
-	@Excel(name = "原始模拟量位", width = 15)
-    @ApiModelProperty(value = "原始模拟量位")
+	/**原始模拟量位*/
+	@Excel(name = "原始模拟量位", width = 15)
+    @ApiModelProperty(value = "原始模拟量位")
     private java.lang.String ysmnlTag;
 	/**原始模拟量值*/
 	@Excel(name = "原始模拟量值", width = 15)
@@ -112,6 +113,7 @@ public class InterlockDetail implements Serializable {
     /**控制系统状态*/
     @Excel(name = "控制系统状态", width = 15)
     @ApiModelProperty(value = "控制系统状态")
+    @Dict(dicCode = "control_system_status")
     private java.lang.String controlSystemStatus;
 	/**联锁设定值*/
 	@Excel(name = "联锁设定值", width = 15)
@@ -125,9 +127,9 @@ public class InterlockDetail implements Serializable {
 	@Excel(name = "当前值", width = 15)
     @ApiModelProperty(value = "当前值")
     private java.lang.String currentValue;
-	/**当前值位*/
-	@Excel(name = "当前值位", width = 15)
-    @ApiModelProperty(value = "当前值位")
+	/**当前值位*/
+	@Excel(name = "当前值位", width = 15)
+    @ApiModelProperty(value = "当前值位")
     private java.lang.String currentValueTag;
 	/**是否旁路*/
 	@Excel(name = "是否旁路", width = 15)
@@ -157,9 +159,9 @@ public class InterlockDetail implements Serializable {
 	@Excel(name = "MP状态", width = 15)
     @ApiModelProperty(value = "MP状态")
     private java.lang.String mpStatus;
-	/**状态点位*/
-	@Excel(name = "状态点位", width = 15)
-    @ApiModelProperty(value = "状态点位")
+	/**MP状态点位*/
+	@Excel(name = "MP状态点位", width = 15)
+    @ApiModelProperty(value = "MP状态点位")
     private java.lang.String mpStatusTag;
 	/**创建人*/
     @ApiModelProperty(value = "创建人")

+ 5 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/mapper/InterlockDetailMapper.java

@@ -6,8 +6,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
+import org.jeecg.modules.detail.dto.InterlockDetailQueryDTO;
 import org.jeecg.modules.detail.entity.InterlockDetail;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.jeecg.modules.detail.vo.InterlockDetailQueryVO;
 import org.jeecg.modules.summary.vo.InterlockSummaryVO;
 
 /**
@@ -19,6 +21,9 @@ import org.jeecg.modules.summary.vo.InterlockSummaryVO;
 public interface InterlockDetailMapper extends BaseMapper<InterlockDetail> {
 
     /**联锁总表-分页列表查询(各种逻辑状态)*/
+    public IPage<InterlockDetailQueryVO> getPage2(Page<InterlockDetailQueryVO> page, @Param("dto") InterlockDetailQueryDTO dto);
+
+    /**联锁总表-分页列表查询(各种逻辑状态)*/
     IPage<InterlockSummaryVO> getPage(Page<InterlockSummaryVO> page, @Param("interlockSummaryVO") InterlockSummaryVO interlockSummaryVO);
 
 }

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

@@ -3,17 +3,31 @@
 <mapper namespace="org.jeecg.modules.detail.mapper.InterlockDetailMapper">
 
     <!-- 联锁总表-分页列表查询(各种逻辑状态)-->
+    <select id="getPage2" parameterType="org.jeecg.modules.detail.dto.InterlockDetailQueryDTO" resultType="org.jeecg.modules.detail.vo.InterlockDetailQueryVO">
+        select d.id, d.summaryid, d.interlockname, d.interlock_condition, d.interlock_condition_tag, d.description,
+        d.instrument_status, d.interlock_set_value, d.current_value, d.if_bypass, d.input_status, d.output_status,
+        d.mp_status, s.ljgx, s.interlock_out_value
+        from interlock_detail d left join interlock_summary s on d.summaryid = s.id
+        <where>
+            <if test="dto.summaryid != null and dto.summaryid != ''"> and d.summaryid = #{dto.summaryid}</if>
+            <if test="dto.interlockConditionTag != null and dto.interlockConditionTag != ''"> and d.interlock_condition_tag like concat('%',#{dto.interlockConditionTag},'%')</if>
+        </where>
+order by d.summaryid
+    </select>
+
+    <!-- 联锁总表-分页列表查询(各种逻辑状态)-->
     <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.instrument_status, d.control_system_status,
+        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
         from interlock_detail d left join interlock_summary s on d.summaryid = s.id
         <where>
-            <if test="interlockSummaryVO.interlockname != null and interlockSummaryVO.interlockname != ''"> and d.interlockname = #{interlockSummaryVO.interlockname}</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>
             <if test="interlockSummaryVO.instrumentStatus != null and interlockSummaryVO.instrumentStatus != ''"> and d.instrument_status = #{interlockSummaryVO.instrumentStatus}</if>
             <if test="interlockSummaryVO.controlSystemStatus != null and interlockSummaryVO.controlSystemStatus != ''"> and d.control_system_status = #{interlockSummaryVO.controlSystemStatus}</if>
-            <if test="interlockSummaryVO.interlockStatus != null and interlockSummaryVO.interlockStatus != ''"> and d.interlock_status = #{interlockSummaryVO.interlockStatus}</if>
-            <if test="interlockSummaryVO.loopHealthLevel != null and interlockSummaryVO.loopHealthLevel != ''"> and d.loop_health_level = #{interlockSummaryVO.loopHealthLevel}</if>
+            <if test="interlockSummaryVO.interlockStatus != null and interlockSummaryVO.interlockStatus != ''"> and s.interlock_status = #{interlockSummaryVO.interlockStatus}</if>
+            <if test="interlockSummaryVO.loopHealthLevel != null and interlockSummaryVO.loopHealthLevel != ''"> and s.loop_health_level = #{interlockSummaryVO.loopHealthLevel}</if>
         </where>
     </select>
 

+ 5 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/service/IInterlockDetailService.java

@@ -2,8 +2,10 @@ package org.jeecg.modules.detail.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.detail.dto.InterlockDetailQueryDTO;
 import org.jeecg.modules.detail.entity.InterlockDetail;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.detail.vo.InterlockDetailQueryVO;
 import org.jeecg.modules.summary.vo.InterlockSummaryVO;
 
 /**
@@ -14,6 +16,9 @@ import org.jeecg.modules.summary.vo.InterlockSummaryVO;
  */
 public interface IInterlockDetailService extends IService<InterlockDetail> {
 
+    /**联锁总表-分页列表查询(各种逻辑状态)*/
+    public IPage<InterlockDetailQueryVO> getPage2(Page<InterlockDetailQueryVO> page, InterlockDetailQueryDTO dto);
+
 
     /**联锁总表-分页列表查询(各种逻辑状态)*/
     public IPage<InterlockSummaryVO> getPage(Page<InterlockSummaryVO> page, InterlockSummaryVO empInfo);

+ 7 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/service/impl/InterlockDetailServiceImpl.java

@@ -2,9 +2,11 @@ package org.jeecg.modules.detail.service.impl;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.jeecg.modules.detail.dto.InterlockDetailQueryDTO;
 import org.jeecg.modules.detail.entity.InterlockDetail;
 import org.jeecg.modules.detail.mapper.InterlockDetailMapper;
 import org.jeecg.modules.detail.service.IInterlockDetailService;
+import org.jeecg.modules.detail.vo.InterlockDetailQueryVO;
 import org.jeecg.modules.summary.vo.InterlockSummaryVO;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -24,6 +26,11 @@ public class InterlockDetailServiceImpl extends ServiceImpl<InterlockDetailMappe
     @SuppressWarnings("all")
     private InterlockDetailMapper interlockDetailMapper;
 
+    /**联锁总表-分页列表查询(各种逻辑状态)*/
+    public IPage<InterlockDetailQueryVO> getPage2(Page<InterlockDetailQueryVO> page, InterlockDetailQueryDTO dto){
+        return interlockDetailMapper.getPage2(page, dto);
+    }
+
 
     /**联锁总表-分页列表查询(各种逻辑状态)*/
     public IPage<InterlockSummaryVO> getPage(Page<InterlockSummaryVO> page, InterlockSummaryVO interlockSummaryVO) {

+ 78 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/detail/vo/InterlockDetailQueryVO.java

@@ -0,0 +1,78 @@
+package org.jeecg.modules.detail.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import org.jeecg.common.aspect.annotation.Dict;
+import org.jeecgframework.poi.excel.annotation.Excel;
+import org.springframework.format.annotation.DateTimeFormat;
+
+/**
+ * 功能描述
+ *
+ * @author: nn
+ * @date: 2024年05月29日 15:50
+ */
+@Data
+public class InterlockDetailQueryVO {
+
+    /**id*/
+    @TableId(type = IdType.ASSIGN_ID)
+    @ApiModelProperty(value = "id")
+    private java.lang.String id;
+    /**联锁总表id*/
+    @Excel(name = "联锁总表id", width = 15)
+    @ApiModelProperty(value = "联锁总表id")
+    private java.lang.String summaryid;
+    /**联锁名称*/
+    @Excel(name = "联锁名称", width = 15)
+    @ApiModelProperty(value = "联锁名称")
+    private java.lang.String interlockname;
+    /**联锁条件值*/
+    @Excel(name = "联锁条件值", width = 15)
+    @ApiModelProperty(value = "联锁条件值")
+    private java.lang.String interlockCondition;
+    /**联锁条件点位*/
+    @Excel(name = "联锁条件点位", width = 15)
+    @ApiModelProperty(value = "联锁条件点位")
+    private java.lang.String interlockConditionTag;
+    /**描述*/
+    @Excel(name = "描述", width = 15)
+    @ApiModelProperty(value = "描述")
+    private java.lang.String description;
+    /**联锁设定值*/
+    @Excel(name = "联锁设定值", width = 15)
+    @ApiModelProperty(value = "联锁设定值")
+    private java.lang.String interlockSetValue;
+    /**当前值*/
+    @Excel(name = "当前值", width = 15)
+    @ApiModelProperty(value = "当前值")
+    private java.lang.String currentValue;
+    /**是否旁路*/
+    @Excel(name = "是否旁路", width = 15)
+    @ApiModelProperty(value = "是否旁路")
+    private java.lang.String ifBypass;
+    /**输入卡件状态*/
+    @Excel(name = "输入卡件状态", width = 15)
+    @ApiModelProperty(value = "输入卡件状态")
+    private java.lang.String inputStatus;
+    /**输出卡件状态*/
+    @Excel(name = "输出卡件状态", width = 15)
+    @ApiModelProperty(value = "输出卡件状态")
+    private java.lang.String outputStatus;
+    /**MP状态*/
+    @Excel(name = "MP状态", width = 15)
+    @ApiModelProperty(value = "MP状态")
+    private java.lang.String mpStatus;
+
+    /**逻辑关系*/
+    @Excel(name = "逻辑关系", width = 15)
+    @ApiModelProperty(value = "逻辑关系")
+    private java.lang.String ljgx;
+    /**联锁输出值*/
+    @Excel(name = "联锁输出值", width = 15)
+    @ApiModelProperty(value = "联锁输出值")
+    private java.lang.String interlockOutValue;
+}

+ 42 - 6
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/controller/InterlockSummaryController.java

@@ -12,6 +12,7 @@ import javax.servlet.http.HttpServletResponse;
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.util.oConvertUtils;
+import org.jeecg.modules.summary.dto.InterlockAddDTO;
 import org.jeecg.modules.summary.entity.InterlockSummary;
 import org.jeecg.modules.summary.service.IInterlockSummaryService;
 
@@ -49,7 +50,42 @@ import org.jeecg.common.aspect.annotation.AutoLog;
 public class InterlockSummaryController extends JeecgController<InterlockSummary, IInterlockSummaryService> {
 	@Autowired
 	private IInterlockSummaryService interlockSummaryService;
-	
+
+	/**
+	 *  联锁及详细信息——用于编辑
+	 */
+	@AutoLog(value = "联锁及详细信息——用于编辑")
+	@ApiOperation(value="联锁及详细信息——用于编辑", notes="联锁及详细信息——用于编辑")
+	@GetMapping(value = "/xxxxLS")
+	public Result<InterlockAddDTO> xxxxLS(@RequestParam(name="id",required=true) String id) {
+		InterlockAddDTO interlockAddDTO = interlockSummaryService.xxxxLS(id);
+		return Result.OK(interlockAddDTO);
+	}
+
+	 /**
+	  *   联锁管理——修改联锁
+	  */
+	 @AutoLog(value = "联锁管理——修改联锁")
+	 @ApiOperation(value="联锁管理——修改联锁", notes="联锁管理——修改联锁")
+	 //@RequiresPermissions("org.jeecg.modules:interlock_summary:editLS")
+	 @RequestMapping(value = "/editLS", method = {RequestMethod.PUT,RequestMethod.POST})
+	 public Result<String> editLS(@RequestBody InterlockAddDTO interlockAddDTO) {
+		 interlockSummaryService.editLS(interlockAddDTO);
+		 return Result.OK("编辑成功!");
+	 }
+
+	 /**
+	  *   联锁管理——新增联锁
+	  */
+	 @AutoLog(value = "联锁管理——新增联锁")
+	 @ApiOperation(value="联锁管理——新增联锁", notes="联锁管理——新增联锁")
+	 //@RequiresPermissions("org.jeecg.modules:interlock_summary:addLS")
+	 @PostMapping(value = "/addLS")
+	 public Result<String> addLS(@RequestBody InterlockAddDTO interlockAddDTO) {
+		 interlockSummaryService.addLS(interlockAddDTO);
+		 return Result.OK("添加成功!");
+	 }
+
 	/**
 	 * 分页列表查询
 	 *
@@ -71,7 +107,7 @@ public class InterlockSummaryController extends JeecgController<InterlockSummary
 		IPage<InterlockSummary> pageList = interlockSummaryService.page(page, queryWrapper);
 		return Result.OK(pageList);
 	}
-	
+
 	/**
 	 *   添加
 	 *
@@ -86,7 +122,7 @@ public class InterlockSummaryController extends JeecgController<InterlockSummary
 		interlockSummaryService.save(interlockSummary);
 		return Result.OK("添加成功!");
 	}
-	
+
 	/**
 	 *  编辑
 	 *
@@ -101,7 +137,7 @@ public class InterlockSummaryController extends JeecgController<InterlockSummary
 		interlockSummaryService.updateById(interlockSummary);
 		return Result.OK("编辑成功!");
 	}
-	
+
 	/**
 	 *   通过id删除
 	 *
@@ -116,7 +152,7 @@ public class InterlockSummaryController extends JeecgController<InterlockSummary
 		interlockSummaryService.removeById(id);
 		return Result.OK("删除成功!");
 	}
-	
+
 	/**
 	 *  批量删除
 	 *
@@ -131,7 +167,7 @@ public class InterlockSummaryController extends JeecgController<InterlockSummary
 		this.interlockSummaryService.removeByIds(Arrays.asList(ids.split(",")));
 		return Result.OK("批量删除成功!");
 	}
-	
+
 	/**
 	 * 通过id查询
 	 *

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

@@ -0,0 +1,40 @@
+package org.jeecg.modules.summary.convert;
+
+import org.jeecg.modules.detail.dto.InterlockDetailAddDTO;
+import org.jeecg.modules.summary.dto.InterlockAddDTO;
+import org.jeecg.modules.summary.entity.InterlockSummary;
+import org.mapstruct.Mapper;
+import org.mapstruct.Mapping;
+import org.mapstruct.ReportingPolicy;
+import org.mapstruct.factory.Mappers;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 功能描述
+ *
+ * @author: nn
+ * @date: 2024年05月28日 13:52
+ */
+@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE,imports ={ CollectionUtils.class, Collectors.class})
+public interface InterlockSummaryConvert {
+
+    InterlockSummaryConvert INSTANCE = Mappers.getMapper(InterlockSummaryConvert.class);
+
+    @Mapping(target = "id",source = "interlockAddDTO.id")
+    @Mapping(target = "interlockName",source = "interlockAddDTO.interlockName")
+    @Mapping(target = "interlockSystemId",source = "interlockAddDTO.interlockSystemId")
+    @Mapping(target = "interlockApparatusId",source = "interlockAddDTO.interlockApparatusId")
+    @Mapping(target = "interlockOutValueTag",source = "interlockAddDTO.interlockOutValueTag")
+    @Mapping(target = "interlockOutValue",source = "interlockAddDTO.interlockOutValue")
+    @Mapping(target = "ljgx",source = "interlockAddDTO.ljgx")
+    @Mapping(target = "interlockStatus",source = "interlockStatus")
+    @Mapping(target = "loopHealthLevel",source = "loopHealthLevel")
+    InterlockSummary toInterlockSummary(InterlockAddDTO interlockAddDTO,String interlockStatus,String loopHealthLevel);
+
+
+    InterlockAddDTO toDTO(InterlockSummary summary, List<InterlockDetailAddDTO> interlockDetailAddDTOList);
+
+}

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

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
+import org.jeecg.common.aspect.annotation.Dict;
 import org.jeecg.modules.detail.dto.InterlockDetailAddDTO;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
@@ -45,6 +46,7 @@ public class InterlockAddDTO {
     /**联锁状态*/
     @Excel(name = "联锁状态", width = 15)
     @ApiModelProperty(value = "联锁状态")
+    @Dict(dicCode = "interlock_status")
     private java.lang.String interlockStatus;
     /**回路健康级别*/
     @Excel(name = "回路健康级别", width = 15)

+ 13 - 12
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/entity/InterlockSummary.java

@@ -40,25 +40,26 @@ public class InterlockSummary implements Serializable {
 	@Excel(name = "联锁名称", width = 15)
     @ApiModelProperty(value = "联锁名称")
     private java.lang.String interlockName;
-	/**系统id*/
-	@Excel(name = "系统id", width = 15)
-    @ApiModelProperty(value = "系统id")
-    private java.lang.String interlockSystemId;
 	/**装置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 deviceId;
-	/**模块名称*/
-	@Excel(name = "模块名称", width = 15)
-    @ApiModelProperty(value = "模块名称")
-    private java.lang.String moduleName;
+    /**系统id*/
+    @Excel(name = "系统id", width = 15)
+    @ApiModelProperty(value = "系统id")
+    private java.lang.String interlockSystemId;
+//	/**设备id*/
+//	@Excel(name = "设备id", width = 15)
+//    @ApiModelProperty(value = "设备id")
+//    private java.lang.String deviceId;
+//	/**模块名称*/
+//	@Excel(name = "模块名称", width = 15)
+//    @ApiModelProperty(value = "模块名称")
+//    private java.lang.String moduleName;
 	/**联锁状态*/
 	@Excel(name = "联锁状态", width = 15)
     @ApiModelProperty(value = "联锁状态")
+    @Dict(dicCode = "interlock_status")
     private java.lang.String interlockStatus;
 	/**回路健康级别*/
 	@Excel(name = "回路健康级别", width = 15)

+ 18 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/service/IInterlockSummaryService.java

@@ -1,7 +1,8 @@
 package org.jeecg.modules.summary.service;
 
-import org.jeecg.modules.summary.entity.InterlockSummary;
 import com.baomidou.mybatisplus.extension.service.IService;
+import org.jeecg.modules.summary.dto.InterlockAddDTO;
+import org.jeecg.modules.summary.entity.InterlockSummary;
 
 /**
  * @Description: 联锁总表
@@ -11,4 +12,20 @@ import com.baomidou.mybatisplus.extension.service.IService;
  */
 public interface IInterlockSummaryService extends IService<InterlockSummary> {
 
+
+    /**
+     *  联锁及详细信息——用于编辑
+     */
+    public InterlockAddDTO xxxxLS(String id);
+
+    /**
+     *   联锁管理——编辑联锁
+     */
+    public void editLS(InterlockAddDTO interlockAddDTO);
+
+    /**
+     *   联锁管理——新增联锁
+     */
+    public void addLS(InterlockAddDTO interlockAddDTO);
+
 }

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

@@ -1,11 +1,26 @@
 package org.jeecg.modules.summary.service.impl;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.jeecg.modules.base.mapper.InterlockBaseMapper;
+import org.jeecg.modules.base.service.IInterlockBaseService;
+import org.jeecg.modules.detail.convert.InterlockDetailConvert;
+import org.jeecg.modules.detail.dto.InterlockDetailAddDTO;
+import org.jeecg.modules.detail.entity.InterlockDetail;
+import org.jeecg.modules.detail.mapper.InterlockDetailMapper;
+import org.jeecg.modules.summary.convert.InterlockSummaryConvert;
+import org.jeecg.modules.summary.dto.InterlockAddDTO;
 import org.jeecg.modules.summary.entity.InterlockSummary;
 import org.jeecg.modules.summary.mapper.InterlockSummaryMapper;
 import org.jeecg.modules.summary.service.IInterlockSummaryService;
+import org.jeecg.modules.tag.entity.InterlockTag;
+import org.jeecg.modules.tag.service.IInterlockTagService;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import java.math.BigDecimal;
+import java.util.ArrayList;
+import java.util.List;
 
 /**
  * @Description: 联锁总表
@@ -16,4 +31,238 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 @Service
 public class InterlockSummaryServiceImpl extends ServiceImpl<InterlockSummaryMapper, InterlockSummary> implements IInterlockSummaryService {
 
+    @Autowired
+    @SuppressWarnings("all")
+    private InterlockSummaryMapper interlockSummaryMapper;
+    @Autowired
+    @SuppressWarnings("all")
+    private InterlockDetailMapper interlockDetailMapper;
+    @Autowired
+    @SuppressWarnings("all")
+    private InterlockBaseMapper interlockBaseMapper;
+    @Autowired
+    @SuppressWarnings("all")
+    private IInterlockBaseService interlockBaseService;
+    @Autowired
+    @SuppressWarnings("all")
+    private IInterlockTagService interlockTagService;
+
+    /**
+     *  联锁及详细信息——用于编辑
+     */
+    public InterlockAddDTO xxxxLS(String id){
+
+
+        InterlockSummary summary = interlockSummaryMapper.selectById(id);
+
+        List<InterlockDetailAddDTO> interlockDetailAddDTOList = new ArrayList<>();
+
+        LambdaQueryWrapper<InterlockDetail> queryWrapper = new LambdaQueryWrapper<>();
+        queryWrapper.eq(InterlockDetail::getSummaryid,id);
+        List<InterlockDetail> detailList = interlockDetailMapper.selectList(queryWrapper);
+        for (InterlockDetail detail : detailList){
+            LambdaQueryWrapper<InterlockTag> queryWrapper1 = new LambdaQueryWrapper<>();
+            queryWrapper1.eq(InterlockTag::getInterlockConditionId,id);
+            List<InterlockTag> tagList = interlockTagService.list(queryWrapper1);
+
+            interlockDetailAddDTOList.add(InterlockDetailConvert.INSTANCE.toDTO(detail));
+        }
+
+        InterlockAddDTO dto = InterlockSummaryConvert.INSTANCE.toDTO(summary,interlockDetailAddDTOList);
+        return dto;
+    }
+
+    /**
+     *   联锁管理——编辑联锁
+     */
+    public void editLS(InterlockAddDTO interlockAddDTO){
+        String summaryId = interlockAddDTO.getId();
+
+        List<InterlockDetailAddDTO> interlockDetailAddDTOList = interlockAddDTO.getInterlockDetailAddDTOList();
+
+        String interlockStatus = "1";//	联锁状态 0未投用1投用
+        String loopHealthLevel = "";// 回路健康级别
+
+        String controlSystemStatus = "0";// 总体 控制系统状态 0正常1非正常
+        String instrumentStatus = "0";// 总体 仪表状态 0正常1故障
+        int i = 0;
+
+        //查该系统下有无相同名称联锁,无则新增 //0装置1系统2联锁 //1是0否
+        interlockBaseService.judgeAndAdd(interlockAddDTO.getInterlockSystemId(), "2", interlockAddDTO.getInterlockName(), "0");
+
+        //删除该联锁对应的点位
+        LambdaQueryWrapper<InterlockTag> queryWrapper3 = new LambdaQueryWrapper<>();
+        queryWrapper3.eq(InterlockTag::getInterlockConditionId, summaryId);
+        interlockTagService.remove(queryWrapper3);
+        //删除该联锁下所有联锁详细信息的所有点位
+        LambdaQueryWrapper<InterlockDetail> queryWrapper1 = new LambdaQueryWrapper<>();
+        queryWrapper1.eq(InterlockDetail::getSummaryid,summaryId);
+        List<InterlockDetail> details = interlockDetailMapper.selectList(queryWrapper1);
+        for (InterlockDetail detail : details){
+            LambdaQueryWrapper<InterlockTag> queryWrapper2 = new LambdaQueryWrapper<>();
+            queryWrapper2.eq(InterlockTag::getInterlockConditionId, detail.getId());
+            interlockTagService.remove(queryWrapper2);
+        }
+        //删除该联锁下所有联锁详细信息
+        interlockDetailMapper.delete(queryWrapper1);
+
+
+        //新增——联锁输出值点位
+        interlockTagService.save(createInterlockTag(interlockAddDTO.getDeviceId(),interlockAddDTO.getModuleName(), interlockAddDTO.getInterlockOutValueTag(), interlockAddDTO.getInterlockOutValue(), "联锁输出值",summaryId));
+
+        for (InterlockDetailAddDTO dto : interlockDetailAddDTOList){
+            dto.setSummaryid(summaryId);
+            //旁路
+            if(dto.getIfBypass()!=null && "1".equals(dto.getIfBypass())){ //是否旁路,0否(手动输入)1是(再看点位)
+                if(dto.getBypassstatus()!=null && "1".equals(dto.getBypassstatus())) interlockStatus = "0";
+            }
+            //仪表状态:0正常1故障
+            if(dto.getInstrumentStatusJuge()!=null){
+                if("0".equals(dto.getInstrumentStatusJuge())){ //0直接读取位号
+                    dto.setInstrumentStatus(dto.getInstrumentStatusValue());
+                } else if("1".equals(dto.getInstrumentStatusJuge())){ //1高低限判断
+                    BigDecimal ysmnlValue = new BigDecimal(dto.getYsmnlValue());
+                    BigDecimal lowerLimit = new BigDecimal(dto.getLowerLimit());
+                    BigDecimal upperLimit = new BigDecimal(dto.getUpperLimit());
+                    if(ysmnlValue.compareTo(lowerLimit) == 1 && ysmnlValue.compareTo(upperLimit) == 1) dto.setInstrumentStatus("0");
+                    else dto.setInstrumentStatus("1");
+                } else if("2".equals(dto.getInstrumentStatusJuge())){ //2突变超限判断
+                    //?????????????????????????????????????????
+                }
+                if(dto.getInstrumentStatus().equals("1")) instrumentStatus = "1";
+            }
+            //控制系统状态
+            if("非正常".equals(dto.getMpStatus()) || "非正常".equals(dto.getMpStatus()) || "非正常".equals(dto.getMpStatus())) {
+                dto.setControlSystemStatus("1");
+                controlSystemStatus = "1";
+            } else dto.setControlSystemStatus("0");
+
+            InterlockDetail detail = InterlockDetailConvert.INSTANCE.toEntity(dto);
+
+            //新增联锁详细信息表数据
+            interlockDetailMapper.insert(detail);
+
+            //新增对应联锁详细信息的点位列表
+            interlockTagService.saveBatch(toTagList(dto,summaryId));
+        }
+
+        if("1".equals(instrumentStatus)) i++; //???投用未投用哪个算正常状态
+        if("1".equals(interlockStatus)) i++;
+        if("1".equals(controlSystemStatus)) i++;
+        if(i==0)  loopHealthLevel="A";
+        else if(i==1) loopHealthLevel="B";
+        else if(i==2) loopHealthLevel="C";
+        else if(i==3) loopHealthLevel="D";
+
+        InterlockSummary interlockSummary = InterlockSummaryConvert.INSTANCE.toInterlockSummary(interlockAddDTO,interlockStatus,loopHealthLevel);
+        //修改联锁总表数据
+        interlockSummaryMapper.updateById(interlockSummary);
+    }
+
+    /**
+     *   联锁管理——新增联锁
+     */
+    public void addLS(InterlockAddDTO interlockAddDTO){
+
+        List<InterlockDetailAddDTO> interlockDetailAddDTOList = interlockAddDTO.getInterlockDetailAddDTOList();
+
+        String interlockStatus = "1";//	联锁状态 0未投用1投用
+        String loopHealthLevel = "";// 回路健康级别
+
+        String controlSystemStatus = "0";// 总体 控制系统状态 0正常1非正常
+        String instrumentStatus = "0";// 总体 仪表状态 0正常1故障
+        int i = 0;
+
+        //查该系统下有无相同名称联锁,无则新增 //0装置1系统2联锁 //1是0否
+        interlockBaseService.judgeAndAdd(interlockAddDTO.getInterlockSystemId(), "2", interlockAddDTO.getInterlockName(), "0");
+
+        //新增——联锁总表数据
+        InterlockSummary interlockSummary = InterlockSummaryConvert.INSTANCE.toInterlockSummary(interlockAddDTO,interlockStatus,loopHealthLevel);
+        interlockSummaryMapper.insert(interlockSummary);
+
+        String summaryId = interlockSummary.getId();
+
+        //新增——联锁输出值点位
+        interlockTagService.save(createInterlockTag(interlockAddDTO.getDeviceId(),interlockAddDTO.getModuleName(), interlockAddDTO.getInterlockOutValueTag(), interlockAddDTO.getInterlockOutValue(), "联锁输出值",summaryId));
+
+        for (InterlockDetailAddDTO dto : interlockDetailAddDTOList){
+            dto.setSummaryid(summaryId);
+            //旁路
+            if(dto.getIfBypass()!=null && "1".equals(dto.getIfBypass())){ //是否旁路,0否(手动输入)1是(再看点位)
+                if(dto.getBypassstatus()!=null && "1".equals(dto.getBypassstatus())) interlockStatus = "0";
+            }
+            //仪表状态:0正常1故障
+            if(dto.getInstrumentStatusJuge()!=null){
+                if("0".equals(dto.getInstrumentStatusJuge())){ //0直接读取位号
+                    dto.setInstrumentStatus(dto.getInstrumentStatusValue());
+                } else if("1".equals(dto.getInstrumentStatusJuge())){ //1高低限判断
+                    BigDecimal ysmnlValue = new BigDecimal(dto.getYsmnlValue());
+                    BigDecimal lowerLimit = new BigDecimal(dto.getLowerLimit());
+                    BigDecimal upperLimit = new BigDecimal(dto.getUpperLimit());
+                    if(ysmnlValue.compareTo(lowerLimit) == 1 && ysmnlValue.compareTo(upperLimit) == 1) dto.setInstrumentStatus("0");
+                    else dto.setInstrumentStatus("1");
+                } else if("2".equals(dto.getInstrumentStatusJuge())){ //2突变超限判断
+                    //?????????????????????????????????????????
+                }
+                if(dto.getInstrumentStatus().equals("1")) instrumentStatus = "1";
+            }
+            //控制系统状态
+            if("非正常".equals(dto.getMpStatus()) || "非正常".equals(dto.getMpStatus()) || "非正常".equals(dto.getMpStatus())) {
+                dto.setControlSystemStatus("1");
+                controlSystemStatus = "1";
+            } else dto.setControlSystemStatus("0");
+
+            InterlockDetail detail = InterlockDetailConvert.INSTANCE.toEntity(dto);
+
+            //新增联锁详细信息表数据
+            interlockDetailMapper.insert(detail);
+
+            //新增对应联锁详细信息的点位列表
+            interlockTagService.saveBatch(toTagList(dto,summaryId));
+        }
+
+        if("1".equals(instrumentStatus)) i++; //???投用未投用哪个算正常状态
+        if("1".equals(interlockStatus)) i++;
+        if("1".equals(controlSystemStatus)) i++;
+        if(i==0)  loopHealthLevel="A";
+        else if(i==1) loopHealthLevel="B";
+        else if(i==2) loopHealthLevel="C";
+        else if(i==3) loopHealthLevel="D";
+
+        interlockSummary = InterlockSummaryConvert.INSTANCE.toInterlockSummary(interlockAddDTO,interlockStatus,loopHealthLevel);
+        //修改联锁总表数据
+        interlockSummaryMapper.updateById(interlockSummary);
+    }
+
+    private List<InterlockTag> toTagList(InterlockDetailAddDTO dto,String interlockConditionId){
+        List<InterlockTag> interlockTagList = new ArrayList<>();
+
+        //联锁条件
+        interlockTagList.add(createInterlockTag(dto.getInterlockConditionDeviceId(), dto.getInterlockConditionModuleName(), dto.getInterlockConditionTag(), dto.getInterlockCondition(), "联锁条件",interlockConditionId));
+        //仪表状态 0直接读取位号
+        if("0".equals(dto.getInstrumentStatusJuge())){
+            interlockTagList.add(createInterlockTag(dto.getInstrumentStatusDeviceId(), dto.getInstrumentStatusModuleName(), dto.getInstrumentStatusTag(), dto.getInstrumentStatus(), "仪表状态",interlockConditionId));
+        }
+        //原始模拟量
+        interlockTagList.add(createInterlockTag(dto.getYsmnlDeviceId(),dto.getYsmnlModuleName(),dto.getYsmnlTag(),dto.getYsmnlValue(),"原始模拟量",interlockConditionId));
+        //联锁设定值
+        interlockTagList.add(createInterlockTag(dto.getInterlockSetDeviceId(),dto.getInterlockSetModuleName(),dto.getInterlockSetTag(),dto.getInterlockSetValue(),"联锁设定值",interlockConditionId));
+        //当前值
+        interlockTagList.add(createInterlockTag(dto.getCurrentValueDeviceId(),dto.getCurrentValueModuleName(),dto.getCurrentValueTag(),dto.getCurrentValue(),"当前值",interlockConditionId));
+        //旁路状态、、、、、、、、、、、、、、、、、、、
+        interlockTagList.add(createInterlockTag(dto.getBypassDeviceId(),dto.getBypassModuleName(),dto.getIfBypassTag(),dto.getIfBypass(),"旁路状态",interlockConditionId));
+        //输入卡件状态
+        interlockTagList.add(createInterlockTag(dto.getInputStatusDeviceId(),dto.getInputStatusModuleName(),dto.getInputStatusTag(),dto.getInputStatus(),"输入卡件状态",interlockConditionId));
+        //输出卡件状态
+        interlockTagList.add(createInterlockTag(dto.getOutputStatusDeviceId(),dto.getOutputStatusModuleName(),dto.getOutputStatusTag(),dto.getOutputStatus(),"输出卡件状态",interlockConditionId));
+        //MP状态
+        interlockTagList.add(createInterlockTag(dto.getMpStatusDeviceId(),dto.getMpStatusModuleName(),dto.getMpStatusTag(),dto.getMpStatus(),"MP状态",interlockConditionId));
+
+        return interlockTagList;
+    }
+
+    private InterlockTag createInterlockTag(String deviceId, String moduleName, String tag, String value, String type,String interlockConditionId) {
+        return new InterlockTag(deviceId, moduleName, tag, value, type,interlockConditionId);
+    }
+
 }

+ 7 - 1
jeecg-module-interlock/src/main/java/org/jeecg/modules/summary/vo/InterlockSummaryVO.java

@@ -34,18 +34,24 @@ public class InterlockSummaryVO {
     @Excel(name = "联锁条件值", width = 15)
     @ApiModelProperty(value = "联锁条件值")
     private java.lang.String interlockCondition;
+    /**联锁条件点位*/
+    @Excel(name = "联锁条件点位", width = 15)
+    @ApiModelProperty(value = "联锁条件点位")
+    private java.lang.String interlockConditionTag;
     /**仪表状态*/
     @Excel(name = "仪表状态", width = 15)
     @ApiModelProperty(value = "仪表状态")
+    @Dict(dicCode = "instrument_status")
     private java.lang.String instrumentStatus;
     /**控制系统状态*/
     @Excel(name = "控制系统状态", width = 15)
     @ApiModelProperty(value = "控制系统状态")
+    @Dict(dicCode = "control_system_status")
     private java.lang.String controlSystemStatus;
-
     /**联锁状态*/
     @Excel(name = "联锁状态", width = 15)
     @ApiModelProperty(value = "联锁状态")
+    @Dict(dicCode = "interlock_status")
     private java.lang.String interlockStatus;
     /**回路健康级别*/
     @Excel(name = "回路健康级别", width = 15)

+ 10 - 0
jeecg-module-interlock/src/main/java/org/jeecg/modules/tag/entity/InterlockTag.java

@@ -79,4 +79,14 @@ public class InterlockTag implements Serializable {
 	/**所属部门*/
     @ApiModelProperty(value = "所属部门")
     private java.lang.String sysOrgCode;
+
+    public InterlockTag(String deviceId, String moduleName, String tagName, String tagValue, String parameterType,String interlockConditionId) {
+        this.deviceId = deviceId;
+        this.moduleName = moduleName;
+        this.tagName = tagName;
+        this.tagValue = tagValue;
+        this.parameterType = parameterType;
+        this.interlockConditionId = interlockConditionId;
+    }
+
 }