Parcourir la source

新增开关布局 和虹软离线方案

车车 il y a 2 mois
Parent
commit
ef6aa78432
19 fichiers modifiés avec 594 ajouts et 34 suppressions
  1. 6 0
      ktg-common/pom.xml
  2. 15 3
      ktg-common/src/main/java/com/ktg/common/utils/face/ArcSoftMothodUtil.java
  3. 3 5
      ktg-common/src/main/java/com/ktg/common/utils/face/FaceEngineTest.java
  4. 0 2
      ktg-iscs/src/main/java/com/ktg/iscs/controller/IsLotoStationController.java
  5. 127 0
      ktg-iscs/src/main/java/com/ktg/iscs/controller/IsLotoSwitchMapController.java
  6. 25 16
      ktg-iscs/src/main/java/com/ktg/iscs/controller/TestIscsController.java
  7. 3 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/IsIsolationPoint.java
  8. 67 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/IsLotoSwitchMap.java
  9. 3 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/point/PagePointDTO.java
  10. 27 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/point/SwitchBindingPointDTO.java
  11. 72 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/loto/IsLotoSwitchMapVO.java
  12. 13 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/points/PointDetailVO.java
  13. 6 0
      ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/points/PointPageVO.java
  14. 22 0
      ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsLotoSwitchMapMapper.java
  15. 29 0
      ktg-iscs/src/main/java/com/ktg/iscs/service/IIsLotoSwitchMapService.java
  16. 118 0
      ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsLotoSwitchMapServiceImpl.java
  17. 12 2
      ktg-iscs/src/main/resources/mapper/IsIsolationPointMapper.xml
  18. 35 0
      ktg-iscs/src/main/resources/mapper/IsLotoSwitchMapMapper.xml
  19. 11 6
      ktg-iscs/src/main/resources/mapper/IsMapPointMapper.xml

+ 6 - 0
ktg-common/pom.xml

@@ -217,6 +217,12 @@
             <version>3.0.0.0</version>
         </dependency>
 
+        <!--<dependency>
+            <groupId>com.arcsoft.face</groupId>
+            <artifactId>arcsoft-sdk-face</artifactId>
+            <version>4.2.1.0</version>
+        </dependency>-->
+
         <dependency>
             <groupId>com.aliyun.oss</groupId>
             <artifactId>aliyun-sdk-oss</artifactId>

+ 15 - 3
ktg-common/src/main/java/com/ktg/common/utils/face/ArcSoftMothodUtil.java

@@ -55,11 +55,15 @@ public class ArcSoftMothodUtil {
             // 在win
             appId = "FTN3G4pk8n2RKwjD955sRapRjbYQFefwhHd4sBZMYEz6";
             sdkKey = "BjJomNU2bQc2SYhT7NNqwvFd9zfc72Q7nneh75r3NT3x";
-            libarcsoftFaceDllPath = "D:\\work\\app\\appinstall\\ArcSoft_ArcFace_Java_Windows_x64_V3.0\\libs\\WIN64";
+            // libarcsoftFaceDllPath = "D:\\work\\app\\appinstall\\ArcSoft_ArcFace_Java_Windows_x64_V3.0\\libs\\WIN64";
+            libarcsoftFaceDllPath = "D:\\work\\app\\appinstall\\ArcSoft_ArcFacePro_windows_x64_java_V4.2\\libs\\WIN64";
         }
         faceEngine = new FaceEngine(libarcsoftFaceDllPath);
         //激活引擎
+        // 联网激活
         int errorCode = faceEngine.activeOnline(appId, sdkKey);
+        // 离线激活
+        // int errorCode = faceEngine.activeOffline("D:\\work\\app\\appinstall\\ArcSoft_ArcFacePro_windows_x64_java_V4.2\\86M111YWX11JB4BZ.dat");
 
         if (errorCode != ErrorInfo.MOK.getValue() && errorCode != ErrorInfo.MERR_ASF_ALREADY_ACTIVATED.getValue()) {
             System.out.println("引擎激活失败");
@@ -77,11 +81,13 @@ public class ArcSoftMothodUtil {
         engineConfiguration.setDetectMode(DetectMode.ASF_DETECT_MODE_IMAGE);
         engineConfiguration.setDetectFaceOrientPriority(DetectOrient.ASF_OP_ALL_OUT);
         engineConfiguration.setDetectFaceMaxNum(10);
-        engineConfiguration.setDetectFaceScaleVal(16);
+        // 联网激活
+        // engineConfiguration.setDetectFaceScaleVal(16);
         //功能配置
         FunctionConfiguration functionConfiguration = new FunctionConfiguration();
         functionConfiguration.setSupportAge(true);
-        functionConfiguration.setSupportFace3dAngle(true);
+        // 联网激活
+        // functionConfiguration.setSupportFace3dAngle(true);
         functionConfiguration.setSupportFaceDetect(true);
         functionConfiguration.setSupportFaceRecognition(true);
         functionConfiguration.setSupportGender(true);
@@ -160,7 +166,10 @@ public class ArcSoftMothodUtil {
 
         //特征提取
         FaceFeature faceFeature = new FaceFeature();
+        // 联网激活
         errorCode = faceEngine.extractFaceFeature(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList.get(0), faceFeature);
+        // 离线激活
+        // errorCode = faceEngine.extractFaceFeature(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList.get(0), ExtractType.RECOGNIZE, 0, faceFeature);
         Assert.isFalse(errorCode != ErrorInfo.MOK.getValue(), "获取人脸特征值失败!");
         byte[] featureData = faceFeature.getFeatureData();
         // 4------------------------返回解析的数据---------------------
@@ -208,7 +217,10 @@ public class ArcSoftMothodUtil {
 
             //特征提取
             FaceFeature faceFeature = new FaceFeature();
+            // 联网激活
             errorCode = faceEngine.extractFaceFeature(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList.get(0), faceFeature);
+            // 离线激活
+            // errorCode = faceEngine.extractFaceFeature(imageInfo.getImageData(), imageInfo.getWidth(), imageInfo.getHeight(), imageInfo.getImageFormat(), faceInfoList.get(0), ExtractType.RECOGNIZE, 0, faceFeature);
             Assert.isFalse(errorCode != ErrorInfo.MOK.getValue(), "获取人脸特征值失败!");
             byte[] featureData = faceFeature.getFeatureData();
 

+ 3 - 5
ktg-common/src/main/java/com/ktg/common/utils/face/FaceEngineTest.java

@@ -1,4 +1,4 @@
-package com.ktg.common.utils.face;
+/*package com.ktg.common.utils.face;
 
 import com.arcsoft.face.*;
 import com.arcsoft.face.enums.DetectMode;
@@ -23,9 +23,7 @@ public class FaceEngineTest {
         //从官网获取
         String appId = "5j9Uw8b5t9svFzVyVjBrCXtizjojgnjXJrNAg64UUYU4";
         String sdkKey = "7yGfT9CQVmTrXfBmmPYeJTK3YTREQSTbM4XNVjPWzRbj";
-
-
-        FaceEngine faceEngine = new FaceEngine("C:\\work\\app\\install\\ArcSoft_ArcFace_Java_Windows_x64_V3.0\\libs\\WIN64");
+        FaceEngine faceEngine = new FaceEngine("D:\\work\\app\\appinstall\\ArcSoft_ArcFacePro_windows_x64_java_V4.2\\libs\\WIN64");
         //激活引擎
         int errorCode = faceEngine.activeOnline(appId, sdkKey);
 
@@ -168,5 +166,5 @@ public class FaceEngineTest {
         //errorCode = faceEngine.unInit();
 
     }
-}
+}*/
 

+ 0 - 2
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsLotoStationController.java

@@ -155,6 +155,4 @@ public class IsLotoStationController extends BaseController
         return CommonResult.success(isLotoStationService.updatePointsBindingLoto(dto));
     }
 
-
-
 }

+ 127 - 0
ktg-iscs/src/main/java/com/ktg/iscs/controller/IsLotoSwitchMapController.java

@@ -0,0 +1,127 @@
+package com.ktg.iscs.controller;
+
+import cn.hutool.core.convert.Convert;
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ktg.common.annotation.Log;
+import com.ktg.common.core.controller.BaseController;
+import com.ktg.common.enums.BusinessType;
+import com.ktg.common.pojo.CommonResult;
+import com.ktg.common.utils.poi.ExcelUtil;
+import com.ktg.iscs.domain.IsLotoSwitchMap;
+import com.ktg.iscs.domain.dto.point.SwitchBindingPointDTO;
+import com.ktg.iscs.domain.vo.loto.IsLotoSwitchMapVO;
+import com.ktg.iscs.service.IIsLotoSwitchMapService;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Parameters;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 开关布局Controller
+ *
+ * @author cgj
+ * @date 2025-08-21
+ */
+@Api(tags = "开关布局")
+@RestController
+@RequestMapping("/iscs/switchmap")
+public class IsLotoSwitchMapController extends BaseController
+{
+    @Autowired
+    private IIsLotoSwitchMapService isLotoSwitchMapService;
+
+    @ApiOperation("查询开关布局-分页")
+    @Parameters({
+            @Parameter(name = "page", description = "Page"),
+            @Parameter(name = "isLotoSwitchMap", description = "实体参数")
+    })
+    @PreAuthorize("@ss.hasPermi('iscs:switchmap:list')")
+    @GetMapping("/getIsLotoSwitchMapPage")
+    public CommonResult<Page<IsLotoSwitchMapVO>> getIsLotoSwitchMapPage(Page<IsLotoSwitchMap> page, IsLotoSwitchMap isLotoSwitchMap)
+    {
+        Page<IsLotoSwitchMapVO> result = isLotoSwitchMapService.getIsLotoSwitchMapPage(page, isLotoSwitchMap);
+        return CommonResult.success(result);
+    }
+
+    @ApiOperation("导出开关布局列表")
+    @Parameter(name = "isLotoSwitchMap", description = "实体参数")
+    @PreAuthorize("@ss.hasPermi('iscs:switchmap:export')")
+    @Log(title = "开关布局", businessType = BusinessType.EXPORT)
+    @PostMapping("/exportIsLotoSwitchMap")
+    public void exportIsLotoSwitchMap(HttpServletResponse response, IsLotoSwitchMap isLotoSwitchMap)
+    {
+        Page<IsLotoSwitchMap> page = new Page<>();
+        page.setSize(-1);
+        page.setCurrent(1);
+        List<IsLotoSwitchMap> list = isLotoSwitchMapService.page(page, Wrappers.<IsLotoSwitchMap>lambdaQuery()
+                .orderByDesc(IsLotoSwitchMap::getSwitchMapId)).getRecords();
+        ExcelUtil<IsLotoSwitchMap> util = new ExcelUtil<IsLotoSwitchMap>(IsLotoSwitchMap.class);
+        util.exportExcel(response, list, "开关布局数据");
+    }
+
+    @ApiOperation("获取开关布局详细信息")
+    @Parameter(name = "switchMapId", description = "switchMapId")
+    @PreAuthorize("@ss.hasPermi('iscs:switchmap:query')")
+    @GetMapping(value = "/selectIsLotoSwitchMapById")
+    public CommonResult<IsLotoSwitchMap> selectIsLotoSwitchMapById(Long switchMapId)
+    {
+        return CommonResult.success(isLotoSwitchMapService.selectIsLotoSwitchMapById(switchMapId));
+    }
+
+    @ApiOperation("获取开关布局详细信息")
+    @Parameter(name = "serialNumber", description = "serialNumber")
+    @PreAuthorize("@ss.hasPermi('iscs:switchmap:query')")
+    @GetMapping(value = "/selectSwitchMapBySerialNumber")
+    public CommonResult<IsLotoSwitchMap> selectSwitchMapBySerialNumber(String serialNumber)
+    {
+        return CommonResult.success(isLotoSwitchMapService.selectSwitchMapBySerialNumber(serialNumber));
+    }
+
+    @ApiOperation("新增开关布局")
+    @PreAuthorize("@ss.hasPermi('iscs:switchmap:add')")
+    @Log(title = "开关布局", businessType = BusinessType.INSERT)
+    @PostMapping("/insertIsLotoSwitchMap")
+    public CommonResult<Boolean> insertIsLotoSwitchMap(@RequestBody @Parameter(name = "isLotoSwitchMap", description = "新增数据类,放到body") IsLotoSwitchMap isLotoSwitchMap)
+    {
+        return CommonResult.success(isLotoSwitchMapService.insertIsLotoSwitchMap(isLotoSwitchMap));
+    }
+
+    @ApiOperation("修改开关布局")
+    @PreAuthorize("@ss.hasPermi('iscs:switchmap:edit')")
+    @Log(title = "开关布局", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateIsLotoSwitchMap")
+    public CommonResult<Boolean> updateIsLotoSwitchMap(@RequestBody @Parameter(name = "isLotoSwitchMap", description = "修改数据类,放到body") IsLotoSwitchMap isLotoSwitchMap)
+    {
+        return CommonResult.success(isLotoSwitchMapService.updateIsLotoSwitchMap(isLotoSwitchMap));
+    }
+
+    @ApiOperation("删除开关布局")
+    @PreAuthorize("@ss.hasPermi('iscs:switchmap:remove')")
+    @Log(title = "开关布局", businessType = BusinessType.DELETE)
+	@PostMapping("/deleteIsLotoSwitchMapBySwitchMapIds")
+    public CommonResult<Boolean> deleteIsLotoSwitchMapBySwitchMapIds(String switchMapIds)
+    {
+        Assert.notBlank(switchMapIds, "请选择需要删除的数据!");
+        Long[] longIds = Convert.toLongArray(switchMapIds);
+        return CommonResult.success(isLotoSwitchMapService.removeBatchByIds(Arrays.asList(longIds)));
+    }
+
+    @ApiOperation("隔离点绑定/解绑开关布局")
+    @PreAuthorize("@ss.hasPermi('iscs:switchmap:edit')")
+    @Log(title = "开关布局", businessType = BusinessType.UPDATE)
+    @PostMapping("/updatePointsBindingSwitchMap")
+    public CommonResult<Boolean> updatePointsBindingSwitchMap(@RequestBody @Parameter(name = "dto", description = "修改数据类,放到body") SwitchBindingPointDTO dto)
+    {
+        return CommonResult.success(isLotoSwitchMapService.updatePointsBindingSwitchMap(dto));
+    }
+
+}

+ 25 - 16
ktg-iscs/src/main/java/com/ktg/iscs/controller/TestIscsController.java

@@ -8,10 +8,10 @@ import com.ktg.common.annotation.Log;
 import com.ktg.common.core.controller.BaseController;
 import com.ktg.common.enums.BusinessType;
 import com.ktg.common.pojo.CommonResult;
-import com.ktg.common.utils.poi.ExcelUtil;
 import com.ktg.common.utils.FingerprintComparisonByImg;
-import com.ktg.iscs.domain.TestIscs;
+import com.ktg.common.utils.poi.ExcelUtil;
 import com.ktg.common.vo.VerificationVO;
+import com.ktg.iscs.domain.TestIscs;
 import com.ktg.iscs.service.IIsTicketOperLogService;
 import com.ktg.iscs.service.ITestIscsService;
 import io.swagger.annotations.Api;
@@ -36,8 +36,7 @@ import java.util.List;
 @Api(tags = "测试用")
 @RestController
 @RequestMapping("/iscs/iscs")
-public class TestIscsController extends BaseController
-{
+public class TestIscsController extends BaseController {
     @Autowired
     private ITestIscsService testIscsService;
     @Autowired
@@ -53,8 +52,7 @@ public class TestIscsController extends BaseController
     })
     @PreAuthorize("@ss.hasPermi('iscs:iscs:list')")
     @GetMapping("/getTestIscsPage")
-    public CommonResult<Page<TestIscs>> getTestIscsPage(Page<TestIscs> page, TestIscs testIscs)
-    {
+    public CommonResult<Page<TestIscs>> getTestIscsPage(Page<TestIscs> page, TestIscs testIscs) {
         Page<TestIscs> result = testIscsService.page(page, Wrappers.<TestIscs>lambdaQuery()
                 .orderByDesc(TestIscs::getId));
         return CommonResult.success(result);
@@ -68,8 +66,7 @@ public class TestIscsController extends BaseController
     @PreAuthorize("@ss.hasPermi('iscs:iscs:export')")
     @Log(title = "测试用", businessType = BusinessType.EXPORT)
     @PostMapping("/exportTestIscs")
-    public void exportTestIscs(HttpServletResponse response, TestIscs testIscs)
-    {
+    public void exportTestIscs(HttpServletResponse response, TestIscs testIscs) {
         Page<TestIscs> page = new Page<>();
         page.setSize(-1);
         page.setCurrent(1);
@@ -86,8 +83,7 @@ public class TestIscsController extends BaseController
     @Parameter(name = "id", description = "id")
     @PreAuthorize("@ss.hasPermi('iscs:iscs:query')")
     @GetMapping(value = "/selectTestIscsById")
-    public CommonResult<TestIscs> selectTestIscsById(Long id)
-    {
+    public CommonResult<TestIscs> selectTestIscsById(Long id) {
         return CommonResult.success(testIscsService.getById(id));
     }
 
@@ -98,8 +94,7 @@ public class TestIscsController extends BaseController
     @PreAuthorize("@ss.hasPermi('iscs:iscs:add')")
     @Log(title = "测试用", businessType = BusinessType.INSERT)
     @PostMapping("/insertTestIscs")
-    public CommonResult<Boolean> insertTestIscs(@RequestBody @Parameter(name = "testIscs", description = "新增数据类,放到body") TestIscs testIscs)
-    {
+    public CommonResult<Boolean> insertTestIscs(@RequestBody @Parameter(name = "testIscs", description = "新增数据类,放到body") TestIscs testIscs) {
         return CommonResult.success(testIscsService.save(testIscs));
     }
 
@@ -110,8 +105,7 @@ public class TestIscsController extends BaseController
     @PreAuthorize("@ss.hasPermi('iscs:iscs:edit')")
     @Log(title = "测试用", businessType = BusinessType.UPDATE)
     @PostMapping("/updateTestIscs")
-    public CommonResult<Boolean> updateTestIscs(@RequestBody @Parameter(name = "testIscs", description = "修改数据类,放到body") TestIscs testIscs)
-    {
+    public CommonResult<Boolean> updateTestIscs(@RequestBody @Parameter(name = "testIscs", description = "修改数据类,放到body") TestIscs testIscs) {
         return CommonResult.success(testIscsService.updateById(testIscs));
     }
 
@@ -122,8 +116,7 @@ public class TestIscsController extends BaseController
     @PreAuthorize("@ss.hasPermi('iscs:iscs:remove')")
     @Log(title = "测试用", businessType = BusinessType.DELETE)
     @PostMapping("/deleteTestIscsByIds")
-    public CommonResult<Boolean> deleteTestIscsByIds(String ids)
-    {
+    public CommonResult<Boolean> deleteTestIscsByIds(String ids) {
         Assert.notBlank(ids, "请选择需要删除的数据!");
         Long[] longIds = Convert.toLongArray(ids);
         return CommonResult.success(testIscsService.removeBatchByIds(Arrays.asList(longIds)));
@@ -153,4 +146,20 @@ public class TestIscsController extends BaseController
         return CommonResult.success(true);
     }
 
+
+   /* @ApiOperation("测试生成离线虹软所需硬件信息包-----------")
+    @GetMapping(value = "/testPrintSystem")
+    public CommonResult<String> testWebsocketLog() {
+
+        //人脸识别引擎库存放路径
+        FaceEngine faceEngine = new FaceEngine("D:\\work\\app\\appinstall\\ArcSoft_ArcFacePro_windows_x64_java_V4.2\\libs\\WIN64");
+        ActiveDeviceInfo activeDeviceInfo = new ActiveDeviceInfo();
+        //采集设备信息(可离线)
+        int errorCode = faceEngine.getActiveDeviceInfo(activeDeviceInfo);
+        System.out.println("采集设备信息errorCode:" + errorCode);
+        String deviceInfo = activeDeviceInfo.getDeviceInfo();
+        System.out.println("设备信息:" + deviceInfo);
+        return CommonResult.success("设备信息:" + deviceInfo);
+    }*/
+
 }

+ 3 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsIsolationPoint.java

@@ -98,6 +98,9 @@ public class IsIsolationPoint extends BaseBean
     @Excel(name = "隔离点序列号")
     private String pointSerialNumber;
 
+    @ApiModelProperty(value = "开关布局ID")
+    private Long switchMapId;
+
     @ApiModelProperty(value = "隔离点nfc")
     @Excel(name = "隔离点nfc")
     @TableField(exist = false)

+ 67 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/IsLotoSwitchMap.java

@@ -0,0 +1,67 @@
+package com.ktg.iscs.domain;
+
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModelProperty;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.ktg.common.annotation.Excel;
+import com.ktg.common.core.domain.model.BaseBean;
+
+/**
+ * 开关布局对象 is_loto_switch_map
+ *
+ * @author cgj
+ * @date 2025-08-21
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class IsLotoSwitchMap extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "开关布局ID")
+    @TableId(type = IdType.AUTO)
+    private Long switchMapId;
+
+    @ApiModelProperty(value = "开关布局编号")
+    @Excel(name = "开关布局编号")
+    private String switchMapCode;
+
+    @ApiModelProperty(value = "开关布局名称")
+    @Excel(name = "开关布局名称")
+    private String switchMapName;
+
+    @ApiModelProperty(value = "所属岗位ID")
+    @Excel(name = "所属岗位ID")
+    private Long workstationId;
+
+    @ApiModelProperty(value = "点位信息")
+    @Excel(name = "点位信息")
+    private String map;
+
+    @ApiModelProperty(value = "状态")
+    @Excel(name = "状态")
+    private String status;
+
+    @ApiModelProperty(value = "地图id")
+    @Excel(name = "地图id")
+    private Long mapId;
+
+    @ApiModelProperty(value = "排序")
+    @Excel(name = "排序")
+    private Long orderNum;
+
+    @ApiModelProperty(value = "序列号")
+    @Excel(name = "序列号")
+    private String serialNumber;
+
+    @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
+    private String delFlag;
+
+    @ApiModelProperty(value = "地图name")
+    @TableField(exist = false)
+    private String mapName;
+
+}

+ 3 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/point/PagePointDTO.java

@@ -46,4 +46,7 @@ public class PagePointDTO
     @ApiModelProperty(value = "锁定站id")
     private Long lotoId;
 
+    @ApiModelProperty(value = "开关布局id")
+    private Long switchMapId;
+
 }

+ 27 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/dto/point/SwitchBindingPointDTO.java

@@ -0,0 +1,27 @@
+package com.ktg.iscs.domain.dto.point;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * 隔离点对象 is_isolation_point
+ *
+ * @author cgj
+ * @date 2024-10-18
+ */
+@Data
+public class SwitchBindingPointDTO
+{
+    @ApiModelProperty(value = "开关布局ID")
+    private Long switchMapId;
+
+    @ApiModelProperty(value = "绑定的隔离点数据")
+    private List<Long> bindingPointIds;
+
+    @ApiModelProperty(value = "解绑的隔离点数据")
+    private List<Long> unbindPointIds;
+
+
+}

+ 72 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/loto/IsLotoSwitchMapVO.java

@@ -0,0 +1,72 @@
+package com.ktg.iscs.domain.vo.loto;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.ktg.common.annotation.Excel;
+import com.ktg.common.core.domain.model.BaseBean;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 电柜对象 is_loto_station
+ *
+ * @author cgj
+ * @date 2024-12-19
+ */
+@EqualsAndHashCode(callSuper = true)
+@Data
+public class IsLotoSwitchMapVO extends BaseBean
+{
+    private static final long serialVersionUID = 1L;
+
+    @ApiModelProperty(value = "开关布局ID")
+    @TableId(type = IdType.AUTO)
+    private Long switchMapId;
+
+    @ApiModelProperty(value = "开关布局编号")
+    @Excel(name = "开关布局编号")
+    private String switchMapCode;
+
+    @ApiModelProperty(value = "开关布局名称")
+    @Excel(name = "开关布局名称")
+    private String switchMapName;
+
+    @ApiModelProperty(value = "所属岗位ID")
+    @Excel(name = "所属岗位ID")
+    private Long workstationId;
+
+    @ApiModelProperty(value = "所属岗位Name")
+    @Excel(name = "所属岗位Name")
+    private String workstationName;
+
+    @ApiModelProperty(value = "点位信息")
+    @Excel(name = "点位信息")
+    private String map;
+
+    @ApiModelProperty(value = "状态")
+    @Excel(name = "状态")
+    private String status;
+
+    @ApiModelProperty(value = "地图id")
+    @Excel(name = "地图id")
+    private Long mapId;
+
+    @ApiModelProperty(value = "排序")
+    @Excel(name = "排序")
+    private Long orderNum;
+
+    @ApiModelProperty(value = "序列号")
+    @Excel(name = "序列号")
+    private String serialNumber;
+
+    @ApiModelProperty(value = "删除标志(0代表存在 2代表删除)")
+    private String delFlag;
+
+    @ApiModelProperty(value = "地图name")
+    @TableField(exist = false)
+    private String mapName;
+
+
+}

+ 13 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/points/PointDetailVO.java

@@ -32,6 +32,9 @@ public class PointDetailVO extends BaseBean
     @ApiModelProperty(value = "隔离点类型Name")
     private String pointTypeName;
 
+    @ApiModelProperty(value = "rfidId")
+    private Long rfidId;
+
     @ApiModelProperty(value = "隔离点nfc")
     private String pointNfc;
 
@@ -103,4 +106,14 @@ public class PointDetailVO extends BaseBean
 
     @ApiModelProperty(value = "前置隔离点ID")
     private Long prePointId;
+
+    @ApiModelProperty(value = "开关布局ID")
+    private Long switchMapId;
+
+    @ApiModelProperty(value = "开关布局Name")
+    private String switchMapName;
+
+    @ApiModelProperty(value = "隔离点序列号")
+    private String pointSerialNumber;
+
 }

+ 6 - 0
ktg-iscs/src/main/java/com/ktg/iscs/domain/vo/points/PointPageVO.java

@@ -104,4 +104,10 @@ public class PointPageVO extends BaseBean
     @Excel(name = "隔离点序列号")
     private String pointSerialNumber;
 
+    @ApiModelProperty(value = "开关布局ID")
+    private Long switchMapId;
+
+    @ApiModelProperty(value = "开关布局Name")
+    private String switchMapName;
+
 }

+ 22 - 0
ktg-iscs/src/main/java/com/ktg/iscs/mapper/IsLotoSwitchMapMapper.java

@@ -0,0 +1,22 @@
+package com.ktg.iscs.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.ktg.common.mapper.BaseMapperX;
+import com.ktg.iscs.domain.IsLotoSwitchMap;
+import com.ktg.iscs.domain.vo.loto.IsLotoSwitchMapVO;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 开关布局Mapper接口
+ *
+ * @author cgj
+ * @date 2025-08-21
+ */
+@Mapper
+public interface IsLotoSwitchMapMapper extends BaseMapperX<IsLotoSwitchMap> {
+
+    Page<IsLotoSwitchMapVO> getIsLotoSwitchMapPage(Page<IsLotoSwitchMap> page, @Param(value = "isLotoSwitchMap") IsLotoSwitchMap isLotoSwitchMap);
+
+
+}

+ 29 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/IIsLotoSwitchMapService.java

@@ -0,0 +1,29 @@
+package com.ktg.iscs.service;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ktg.iscs.domain.IsLotoSwitchMap;
+import com.ktg.iscs.domain.dto.point.SwitchBindingPointDTO;
+import com.ktg.iscs.domain.vo.loto.IsLotoSwitchMapVO;
+
+/**
+ * 开关布局Service接口
+ *
+ * @author cgj
+ * @date 2025-08-21
+ */
+public interface IIsLotoSwitchMapService extends IService<IsLotoSwitchMap> {
+
+    Page<IsLotoSwitchMapVO> getIsLotoSwitchMapPage(Page<IsLotoSwitchMap> page, IsLotoSwitchMap isLotoSwitchMap);
+
+    Boolean insertIsLotoSwitchMap(IsLotoSwitchMap isLotoSwitchMap);
+
+    Boolean updateIsLotoSwitchMap(IsLotoSwitchMap isLotoSwitchMap);
+
+    IsLotoSwitchMap selectIsLotoSwitchMapById(Long switchMapId);
+
+    IsLotoSwitchMap selectSwitchMapBySerialNumber(String serialNumber);
+
+    Boolean updatePointsBindingSwitchMap(SwitchBindingPointDTO dto);
+
+}

+ 118 - 0
ktg-iscs/src/main/java/com/ktg/iscs/service/impl/IsLotoSwitchMapServiceImpl.java

@@ -0,0 +1,118 @@
+package com.ktg.iscs.service.impl;
+
+import cn.hutool.core.lang.Assert;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.ktg.common.utils.StringUtils;
+import com.ktg.iscs.domain.IsIsolationPoint;
+import com.ktg.iscs.domain.IsLotoSwitchMap;
+import com.ktg.iscs.domain.IsMap;
+import com.ktg.iscs.domain.dto.point.SwitchBindingPointDTO;
+import com.ktg.iscs.domain.vo.loto.IsLotoSwitchMapVO;
+import com.ktg.iscs.mapper.IsLotoSwitchMapMapper;
+import com.ktg.iscs.service.IIsIsolationPointService;
+import com.ktg.iscs.service.IIsLotoSwitchMapService;
+import com.ktg.iscs.service.IIsMapService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 开关布局Service业务层处理
+ *
+ * @author cgj
+ * @date 2025-08-21
+ */
+@Service
+public class IsLotoSwitchMapServiceImpl extends ServiceImpl<IsLotoSwitchMapMapper, IsLotoSwitchMap> implements IIsLotoSwitchMapService {
+
+    @Autowired
+    private IsLotoSwitchMapMapper isLotoSwitchMapMapper;
+    @Autowired
+    private IIsMapService isMapService;
+    @Autowired
+    private IIsIsolationPointService iIsIsolationPointService;
+
+    @Override
+    public Page<IsLotoSwitchMapVO> getIsLotoSwitchMapPage(Page<IsLotoSwitchMap> page, IsLotoSwitchMap isLotoSwitchMap) {
+        return isLotoSwitchMapMapper.getIsLotoSwitchMapPage(page, isLotoSwitchMap);
+    }
+
+    @Override
+    public Boolean insertIsLotoSwitchMap(IsLotoSwitchMap isLotoSwitchMap) {
+        Assert.notBlank(isLotoSwitchMap.getSwitchMapName(), "名称不可为空!");
+        // 判断名称重复
+        List<IsLotoSwitchMap> list = list(Wrappers.<IsLotoSwitchMap>lambdaQuery()
+                .eq(IsLotoSwitchMap::getSwitchMapName, isLotoSwitchMap.getSwitchMapName()));
+        Assert.isTrue(list.isEmpty(), "该名称已被使用,请重新填写!");
+        // 判断序列号重复
+        List<IsLotoSwitchMap> list1 = list(Wrappers.<IsLotoSwitchMap>lambdaQuery()
+                .eq(IsLotoSwitchMap::getSerialNumber, isLotoSwitchMap.getSerialNumber()));
+        Assert.isTrue(list1.isEmpty(), "该序列号已被使用,请重新填写!");
+        return save(isLotoSwitchMap);
+    }
+
+    @Override
+    public Boolean updateIsLotoSwitchMap(IsLotoSwitchMap isLotoSwitchMap) {
+        Assert.notNull(isLotoSwitchMap.getSwitchMapId(), "主键id不能为空!");
+        // 判断名称重复
+        List<IsLotoSwitchMap> list = list(Wrappers.<IsLotoSwitchMap>lambdaQuery()
+                .eq(IsLotoSwitchMap::getSwitchMapName, isLotoSwitchMap.getSwitchMapName())
+                .ne(IsLotoSwitchMap::getSwitchMapId, isLotoSwitchMap.getSwitchMapId()));
+        Assert.isTrue(list.isEmpty(), "该名称已被使用,请重新填写!");
+        // 判断序列号重复
+        List<IsLotoSwitchMap> list1 = list(Wrappers.<IsLotoSwitchMap>lambdaQuery()
+                .eq(IsLotoSwitchMap::getSerialNumber, isLotoSwitchMap.getSerialNumber())
+                .ne(IsLotoSwitchMap::getSwitchMapId, isLotoSwitchMap.getSwitchMapId()));
+        Assert.isTrue(list1.isEmpty(), "该序列号已被使用,请重新填写!");
+        update(Wrappers.<IsLotoSwitchMap>lambdaUpdate()
+                .eq(IsLotoSwitchMap::getSwitchMapId, isLotoSwitchMap.getSwitchMapId())
+                .set(IsLotoSwitchMap::getSwitchMapName, isLotoSwitchMap.getSwitchMapName())
+                .set(IsLotoSwitchMap::getSerialNumber, isLotoSwitchMap.getSerialNumber())
+                .set(IsLotoSwitchMap::getOrderNum, isLotoSwitchMap.getOrderNum())
+                .set(IsLotoSwitchMap::getMapId, isLotoSwitchMap.getMapId() != null ? isLotoSwitchMap.getMapId() : null)
+                .set(IsLotoSwitchMap::getWorkstationId, isLotoSwitchMap.getWorkstationId() != null ? isLotoSwitchMap.getWorkstationId() : null)
+                .set(IsLotoSwitchMap::getMap, StringUtils.isNotBlank(isLotoSwitchMap.getMap()) ? isLotoSwitchMap.getMap() : null));
+        return true;
+    }
+
+    @Override
+    public IsLotoSwitchMap selectIsLotoSwitchMapById(Long switchMapId) {
+        IsLotoSwitchMap byId = getById(switchMapId);
+        if (byId != null && byId.getMapId() != null) {
+            IsMap map = isMapService.getById(byId.getMapId());
+            if (map != null) {
+                byId.setMapName(map.getName());
+            }
+        }
+        return byId;
+    }
+
+    @Override
+    public IsLotoSwitchMap selectSwitchMapBySerialNumber(String serialNumber) {
+        Assert.notBlank(serialNumber, "请提供柜序列号!");
+        return getOne(Wrappers.<IsLotoSwitchMap>lambdaQuery()
+                .eq(IsLotoSwitchMap::getSerialNumber, serialNumber));
+    }
+
+    @Override
+    public Boolean updatePointsBindingSwitchMap(SwitchBindingPointDTO dto) {
+        Assert.notNull(dto.getSwitchMapId(), "开关布局ID不能为空!");
+        if (!dto.getBindingPointIds().isEmpty()) {
+            // 开始绑定
+            iIsIsolationPointService.update(Wrappers.<IsIsolationPoint>lambdaUpdate()
+                    .in(IsIsolationPoint::getPointId, dto.getBindingPointIds())
+                    .set(IsIsolationPoint::getLotoId, dto.getSwitchMapId()));
+        }
+        if (!dto.getUnbindPointIds().isEmpty()) {
+            // 开始解绑
+            iIsIsolationPointService.update(Wrappers.<IsIsolationPoint>lambdaUpdate()
+                    .in(IsIsolationPoint::getPointId, dto.getUnbindPointIds())
+                    .set(IsIsolationPoint::getLotoId, null));
+        }
+        return true;
+    }
+
+}

+ 12 - 2
ktg-iscs/src/main/resources/mapper/IsIsolationPointMapper.xml

@@ -74,6 +74,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locksetTypeId != null">lockset_type_id,</if>
             <if test="workstationId != null">workstation_id,</if>
             <if test="lotoId != null">loto_id,</if>
+            <if test="switchMapId != null">switch_map_id,</if>
             <if test="remark != null and remark != ''">remark,</if>
             <if test="pointSerialNumber != null and pointSerialNumber != ''">point_serial_number,</if>
          </trim>
@@ -97,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locksetTypeId != null">#{locksetTypeId},</if>
             <if test="workstationId != null">#{workstationId},</if>
             <if test="lotoId != null">#{lotoId},</if>
+            <if test="switchMapId != null">#{switchMapId},</if>
             <if test="remark != null and remark != ''">#{remark},</if>
             <if test="pointSerialNumber != null and pointSerialNumber != ''">#{pointSerialNumber},</if>
          </trim>
@@ -124,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="locksetTypeId != null">lockset_type_id = #{locksetTypeId},</if>
             <if test="workstationId != null">workstation_id = #{workstationId},</if>
             <if test="lotoId != null">loto_id = #{lotoId},</if>
+            <if test="switchMapId != null">switch_map_id = #{switchMapId},</if>
             <if test="remark != null and remark != ''">remark = #{remark},</if>
             <if test="pointSerialNumber != null and pointSerialNumber != ''">point_serial_number = #{pointSerialNumber},</if>
         </trim>
@@ -166,11 +169,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             l.lock_type_code,
             l.lock_type_icon,
             l.lock_type_img,
-            r.rfid as point_nfc
+            r.rfid as point_nfc,
+            lsm.switch_map_name
         FROM
             is_isolation_point p
                 LEFT JOIN is_workstation wa ON wa.workstation_id = p.workstation_id
                 LEFT JOIN is_loto_station ls ON ls.loto_id = p.loto_id
+                LEFT JOIN is_loto_switch_map lsm ON lsm.switch_map_id = p.switch_map_id
                 LEFT JOIN is_lock_type l ON l.lock_type_id = p.lock_type_id
                 LEFT JOIN is_rfid_token r on r.rfid_id = p.rfid_id
         WHERE
@@ -187,12 +192,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             s.loto_name,
             w.workstation_name,
             GROUP_CONCAT(DISTINCT ma.machinery_name) AS machinery_name,
-            r.rfid as point_nfc
+            r.rfid as point_nfc,
+            lsm.switch_map_name
         FROM is_isolation_point p
         LEFT JOIN is_lock_type l ON l.lock_type_id = p.lock_type_id
         LEFT JOIN is_lockset_type t ON t.lockset_type_id = p.lockset_type_id
         LEFT JOIN is_workstation w ON w.workstation_id = p.workstation_id
         LEFT JOIN is_loto_station s ON s.loto_id = p.loto_id
+        LEFT JOIN is_loto_switch_map lsm ON lsm.switch_map_id = p.switch_map_id
         LEFT JOIN is_machinery_points m ON m.point_id = p.point_id
         LEFT JOIN is_machinery ma ON ma.machinery_id = m.machinery_id
         LEFT JOIN is_rfid_token r on r.rfid_id = p.rfid_id
@@ -233,6 +240,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="dto.lotoId != null and dto.lotoId == 0">
                 and p.loto_id is null
             </if>
+            <if test="dto.switchMapId != null and dto.switchMapId == 0">
+                and p.switch_map_id is null
+            </if>
         </where>
             group by p.point_id
             order by p.point_id desc

+ 35 - 0
ktg-iscs/src/main/resources/mapper/IsLotoSwitchMapMapper.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ktg.iscs.mapper.IsLotoSwitchMapMapper">
+
+    <select id="getIsLotoSwitchMapPage" resultType="com.ktg.iscs.domain.vo.loto.IsLotoSwitchMapVO">
+        SELECT
+        l.*,
+        w.workstation_name,
+        m.name as map_name
+        FROM
+        is_loto_switch_map l
+        LEFT JOIN is_workstation w ON w.workstation_id = l.workstation_id
+        LEFT JOIN sys_user u ON u.user_id = l.create_by
+        LEFT JOIN is_map m ON m.id = l.map_id
+        where
+        l.del_flag = '0'
+        <if test="isLotoSwitchMap.switchMapName != null and isLotoSwitchMap.switchMapName.trim != ''">
+            and l.switch_map_name like concat('%',#{isLotoSwitchMap.switchMapName},'%')
+        </if>
+        <if test="isLotoSwitchMap.switchMapCode != null and isLotoSwitchMap.switchMapCode.trim != ''">
+            and l.switch_map_code like concat('%',#{isLotoSwitchMap.switchMapCode},'%')
+        </if>
+        <if test="isLotoSwitchMap.workstationId != null">
+            and l.workstation_id = #{isLotoSwitchMap.workstationId}
+        </if>
+        <if test="isLotoSwitchMap.switchMapId != null">
+            and l.switch_map_id = #{isLotoSwitchMap.switchMapId}
+        </if>
+        ORDER BY
+        l.order_num asc,
+        l.switch_map_id DESC
+    </select>
+</mapper>

+ 11 - 6
ktg-iscs/src/main/resources/mapper/IsMapPointMapper.xml

@@ -33,29 +33,34 @@
         SELECT
         p.*,
         m.name as map_name,
+
         CASE
-        WHEN p.map_type = "1" THEN
+        WHEN p.map_type = "1"THEN
         w.workstation_name
-        WHEN p.map_type = "2" THEN
+        WHEN p.map_type = "2" or p.map_type = "3" THEN
         ip.point_name
         END AS entity_name,
 
         CASE
-        WHEN p.map_type = "2" THEN
+        WHEN p.map_type = "2" or p.map_type = "3" THEN
         ip.point_icon
         END AS point_icon,
+
         CASE
-        WHEN p.map_type = "2" THEN
+        WHEN p.map_type = "2" or p.map_type = "3" THEN
         ip.point_picture
         END AS point_picture,
+
         CASE
-        WHEN p.map_type = "2" THEN
+        WHEN p.map_type = "2" or p.map_type = "3" THEN
         r.rfid
         END AS point_nfc,
+
         CASE
-        WHEN p.map_type = "2" THEN
+        WHEN p.map_type = "2" or p.map_type = "3" THEN
         ip.point_serial_number
         END AS point_serial_number
+
         FROM
         is_map_point p
         LEFT JOIN is_map m ON m.id = p.map_id