瀏覽代碼

fix:对刀仪对刀逻辑优化

wang.sq@aliyun.com 3 天之前
父節點
當前提交
52df98fe13

+ 18 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/cutterdata/dao/CutterTestDataRecordMapper.java

@@ -0,0 +1,18 @@
+package com.github.zuihou.business.cutterdata.dao;
+
+import com.baomidou.mybatisplus.core.conditions.Wrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.baomidou.mybatisplus.core.toolkit.Constants;
+import com.github.zuihou.base.mapper.SuperMapper;
+import com.github.zuihou.business.cutterdata.entity.CutterTestDataEntity;
+import com.github.zuihou.business.cutterdata.entity.CutterTestDataRecordEntity;
+import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface CutterTestDataRecordMapper extends SuperMapper<CutterTestDataRecordEntity> {
+
+
+}

+ 26 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/cutterdata/service/CutterTestDataRecodeService.java

@@ -0,0 +1,26 @@
+package com.github.zuihou.business.cutterdata.service;
+
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.base.service.SuperService;
+import com.github.zuihou.business.cutterdata.entity.CutterTestDataEntity;
+import com.github.zuihou.business.cutterdata.entity.CutterTestDataRecordEntity;
+import com.github.zuihou.business.operationManagementCenter.entity.TTask;
+import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
+import com.github.zuihou.business.productionReadyCenter.entity.CuttingTool;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+
+import java.util.List;
+
+/**
+ * @Project: imcs-admin-boot
+ * @Package: com.github.zuihou.business.cutterdata
+ * @Author: Lenovo
+ * @Time: 2024 - 11 - 21 15 : 06
+ * @Description:
+ */
+
+
+public interface CutterTestDataRecodeService extends SuperService<CutterTestDataRecordEntity> {
+
+
+}

+ 66 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/cutterdata/service/impl/CutterTestDataRecordServiceImpl.java

@@ -0,0 +1,66 @@
+package com.github.zuihou.business.cutterdata.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.authority.entity.common.DictionaryItem;
+import com.github.zuihou.authority.service.common.DictionaryItemService;
+import com.github.zuihou.base.service.SuperServiceImpl;
+import com.github.zuihou.business.cutterdata.dao.CutterTestDataMapper;
+import com.github.zuihou.business.cutterdata.dao.CutterTestDataRecordMapper;
+import com.github.zuihou.business.cutterdata.entity.CutterTestDataEntity;
+import com.github.zuihou.business.cutterdata.entity.CutterTestDataRecordEntity;
+import com.github.zuihou.business.cutterdata.service.CutterTestDataRecodeService;
+import com.github.zuihou.business.cutterdata.service.CutterTestDataService;
+import com.github.zuihou.business.cutterdata.utils.CutterFile;
+import com.github.zuihou.business.operationManagementCenter.entity.TTask;
+import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
+import com.github.zuihou.business.productionReadyCenter.entity.CuttingTool;
+import com.github.zuihou.business.productionReadyCenter.service.CuttingToolService;
+import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourceBizMapper;
+import com.github.zuihou.business.productionResourceCenter.dao.ZZoneProductionresourceMapper;
+import com.github.zuihou.business.productionResourceCenter.entity.Productionresource;
+import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
+import com.github.zuihou.business.productionResourceCenter.entity.ZZoneProductionresource;
+import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
+import com.github.zuihou.business.util.MsgUtil;
+import com.github.zuihou.common.constant.ParameterKey;
+import com.github.zuihou.context.BaseContextHandler;
+import com.github.zuihou.database.mybatis.conditions.Wraps;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import com.github.zuihou.exception.BizException;
+import com.github.zuihou.injection.annonation.InjectionResult;
+import lombok.extern.slf4j.Slf4j;
+import org.dom4j.DocumentException;
+import org.dom4j.io.SAXReader;
+import org.springframework.beans.BeanUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Service;
+import org.springframework.web.client.RestTemplate;
+
+import java.io.File;
+import java.time.ZonedDateTime;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
+
+/**
+ * @Project: imcs-admin-boot
+ * @Package: com.github.zuihou.business.cutterdata.service
+ * @Author: Lenovo
+ * @Time: 2024 - 11 - 21 15 : 12
+ * @Description: impl
+ */
+
+@Slf4j
+@Service
+public class CutterTestDataRecordServiceImpl extends SuperServiceImpl<CutterTestDataRecordMapper, CutterTestDataRecordEntity> implements CutterTestDataRecodeService {
+
+}

+ 61 - 45
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/cutterdata/service/impl/CutterTestDataServiceImpl.java

@@ -4,16 +4,15 @@ import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.github.zuihou.authority.entity.common.Parameter;
+import com.github.zuihou.authority.entity.common.DictionaryItem;
+import com.github.zuihou.authority.service.common.DictionaryItemService;
 import com.github.zuihou.base.service.SuperServiceImpl;
-import com.github.zuihou.business.classSchedule.entity.AuthUser;
 import com.github.zuihou.business.cutterdata.dao.CutterTestDataMapper;
-import com.github.zuihou.business.cutterdata.dto.CutterTestDataDto;
-import com.github.zuihou.business.cutterdata.dto.CutterTypeContrastEnum;
 import com.github.zuihou.business.cutterdata.entity.CutterTestDataEntity;
+import com.github.zuihou.business.cutterdata.entity.CutterTestDataRecordEntity;
+import com.github.zuihou.business.cutterdata.service.CutterTestDataRecodeService;
 import com.github.zuihou.business.cutterdata.service.CutterTestDataService;
 import com.github.zuihou.business.cutterdata.utils.CutterFile;
-import com.github.zuihou.business.edgeLibrary.entity.StockInfo;
 import com.github.zuihou.business.operationManagementCenter.entity.TTask;
 import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import com.github.zuihou.business.productionReadyCenter.entity.CuttingTool;
@@ -25,7 +24,6 @@ import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
 import com.github.zuihou.business.productionResourceCenter.entity.ZZoneProductionresource;
 import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
 import com.github.zuihou.business.util.MsgUtil;
-import com.github.zuihou.common.constant.DictionaryKey;
 import com.github.zuihou.common.constant.ParameterKey;
 import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
@@ -50,6 +48,7 @@ import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Objects;
+import java.util.stream.Collectors;
 
 /**
  * @Project: imcs-admin-boot
@@ -89,11 +88,16 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
 
     @Autowired
     private ProductionresourceBizMapper productionresourceBizMapper;
+    @Autowired
+    private DictionaryItemService dictionaryItemService;
+
+    @Autowired
+    private CutterTestDataRecodeService testDataRecodeService;
 
-    private String CheckCUtter="MES_CUTTER:CHECK_CUTTER_HAVE_READ";
+    private String CheckCUtter = "MES_CUTTER:CHECK_CUTTER_HAVE_READ";
 
     @Override
-    public String findCutterTestData(CuttingTool cuttingTool){
+    public String findCutterTestData(CuttingTool cuttingTool) {
         log.info("===================定时获取机外对刀仪数据start===================");
 
         List<File> needFile = new ArrayList<>();
@@ -113,12 +117,17 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
         List<CutterTestDataEntity> cutterTestDataEntities = new ArrayList<>();
         List<String> cutterTs = new ArrayList<>();
 
+        // 查询刀具类型
+        String[] types = {"CUTTING_TOOL_TYPE"};
+        List<DictionaryItem> dictionaryItems = this.dictionaryItemService.list(types).get(types[0]);
+        Map<String, List<DictionaryItem>> collect = dictionaryItems.stream().collect(Collectors.groupingBy(DictionaryItem::getCode));
+
 
         for (File file : needFile) {
             // 比对此文件是不是已经读取过
             long lastModifiedTime = file.lastModified();
             Object o = msgUtil.redis_get(CheckCUtter);
-            if(Objects.nonNull(o) && lastModifiedTime==Long.parseLong(o.toString())){
+            if (Objects.nonNull(o) && lastModifiedTime == Long.parseLong(o.toString())) {
                 throw new RuntimeException("此刀具已经采集入库");
             }
 
@@ -129,8 +138,8 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
                 org.dom4j.Element root = document.getRootElement();
                 JSONObject json = CutterFile.findXmlData(root);
 
-                if(!cuttingTool.getCuttingToolNo().toString().equals(json.getJSONObject("ToolList").getJSONObject("Tools").getString("PTN"))){
-                    throw new RuntimeException("刀柄号数据不一致");
+                if (!cuttingTool.getCuttingToolNo().toString().equals(json.getJSONObject("ToolList").getJSONObject("Tools").getString("PTN"))) {
+                    throw new RuntimeException("刀柄号数据不一致,rfid刀具号:" + cuttingTool.getCuttingToolNo() + ",对刀刀具号:" + json.getJSONObject("ToolList").getJSONObject("Tools").getString("PTN"));
                 }
 
                 try {
@@ -142,13 +151,13 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
                     build.setCutterT(json.getJSONObject("ToolList").getJSONObject("Tools").getString("PTN"));
                     build.setCutterTyp(json.getJSONObject("ToolList").getJSONObject("Tools").getString("ToolType"));
 
-                    String substring = json.getJSONObject("ToolList").getJSONObject("Tools").getString("ToolType");
-                    if (Objects.isNull(substring) || CutterTypeContrastEnum.getDncType(substring.substring(0, 1)) == null) { //说明此类型就是主类不是子类
-                        build.setCutterTypDnc(CutterTypeContrastEnum.getDncType(substring) == null ? "99" : CutterTypeContrastEnum.getDncType(substring));
-                        build.setCutterTypSubDnc("99");
+                    if (!Objects.isNull(build.getCutterTyp()) || !collect.get(build.getCutterTyp()).isEmpty()) { //说明此类型就是主类不是子类
+                        String[] split = collect.get(build.getCutterTyp()).get(0).getDescribe().split("-");
+                        build.setCutterTypDnc(split[0]);
+                        build.setCutterTypSubDnc(split.length == 2 ? split[1] : "");
                     } else {
-                        build.setCutterTypDnc(CutterTypeContrastEnum.getDncType(substring.substring(0, 1)));
-                        build.setCutterTypSubDnc(CutterTypeContrastEnum.getDncType(substring));
+                        build.setCutterTypDnc("99");
+                        build.setCutterTypSubDnc("99");
                     }
 
                     Double aDouble = json.getJSONObject("ToolList").getJSONObject("Tools").getJSONObject("Sets").getDouble("Length1");
@@ -198,16 +207,23 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
                 e.printStackTrace();
                 throw new RuntimeException("机外对刀仪获取数据失败");
             }
-
-            BeanUtils.copyProperties(cutterTestDataEntities.get(0),cuttingTool);
-
             //此文件写入到redis中,确认已经读取过此文件的数据,不需要重复读取
             msgUtil.redis_set(CheckCUtter, lastModifiedTime);
         }
 
         for (CutterTestDataEntity cutterTestDataEntity : cutterTestDataEntities) {
-            //新增或修改刀具数据
-            this.remove(Wraps.<CutterTestDataEntity>lbQ().eq(CutterTestDataEntity::getCutterT, cutterTestDataEntity.getCutterT()));
+            // 把旧的对刀数据添加到历史记录中去
+            CutterTestDataEntity one = this.getOne(Wraps.<CutterTestDataEntity>lbQ().eq(CutterTestDataEntity::getCutterT, cutterTestDataEntity.getCutterT()));
+
+            if(one!=null){
+                CutterTestDataRecordEntity cutterTestDataRecordEntity = CutterTestDataRecordEntity.builder().build();
+                BeanUtils.copyProperties(one, cutterTestDataRecordEntity);
+                cutterTestDataRecordEntity.setId(null);
+                testDataRecodeService.save(cutterTestDataRecordEntity);
+
+                //删除旧的对刀数据
+                this.removeById(one.getId());
+            }
             this.save(cutterTestDataEntity);
         }
 
@@ -217,40 +233,40 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
 
 
     @Override
-    public boolean pushPushToMachine(String destLocationNo, Long cuttingToolNo, TaskNode taskNode, TTask task){
+    public boolean pushPushToMachine(String destLocationNo, Long cuttingToolNo, TaskNode taskNode, TTask task) {
         QueryWrapper queryWrapper = new QueryWrapper();
-        queryWrapper.in("status", 2,3, 4);
+        queryWrapper.in("status", 2, 3, 4);
         queryWrapper.in("cutter_t", cuttingToolNo);
         List<CutterTestDataEntity> list = this.list(queryWrapper);
 
         if (list.isEmpty()) {
-            throw new RuntimeException("没有查询到对刀信息,需要的刀柄号:"+ cuttingToolNo);
+            throw new RuntimeException("没有查询到对刀信息,需要的刀柄号:" + cuttingToolNo);
         }
 
         CutterTestDataEntity cutterTestDataEntity = list.get(0);
 
         // 根据设备id查询设备信息 进行推送
-        Productionresource productionresource = productionresourceBizMapper.selectById(task==null?taskNode.getTargetResourceId() : task.getResourceId());
-        if(productionresource == null){
-            throw new RuntimeException("没有查询到需求设备,需要的刀柄号:"+ cuttingToolNo);
+        Productionresource productionresource = productionresourceBizMapper.selectById(task == null ? taskNode.getTargetResourceId() : task.getResourceId());
+        if (productionresource == null) {
+            throw new RuntimeException("没有查询到需求设备,需要的刀柄号:" + cuttingToolNo);
         }
         cutterTestDataEntity.setWriteOrDel("1");
         cutterTestDataEntity.setCutterP(destLocationNo);
         cutterTestDataEntity.setCutterPIp(cutterTestDataEntity.getCutterPIp());
 
-        ZZoneProductionresource zoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId,taskNode.getResourceId()));
+        ZZoneProductionresource zoneProductionresource = zZoneProductionresourceMapper.selectOne(Wraps.<ZZoneProductionresource>lbQ().eq(ZZoneProductionresource::getResourceId, taskNode.getResourceId()));
         Long zoneId = zoneProductionresource.getZoneId();
         ZZone zZone = zoneService.getById(zoneId);
-        String url = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(zZone.getNo() + "_plc").toString());
+        String url = (null == msgUtil.redis_get(ParameterKey.PARAMETERS) ? "" : ((Map<String, String>) msgUtil.redis_get(ParameterKey.PARAMETERS)).get(zZone.getNo() + "_plc").toString());
         url = url + "/api/PushPushToMachine";
 
         JSONObject rfidObj = new JSONObject();
         rfidObj.put("url", productionresource.getIp());
         rfidObj.put("port", productionresource.getPort());
         rfidObj.put("taskId", taskNode.getTaskId().toString());
-        rfidObj.put("taskNodeId", taskNode.getTaskId()+"1");
+        rfidObj.put("taskNodeId", taskNode.getTaskId() + "1");
         rfidObj.put("data", JSONObject.toJSON(cutterTestDataEntity));
-        if(destLocationNo==null || destLocationNo.isEmpty() || Double.parseDouble(destLocationNo)<=0){
+        if (destLocationNo == null || destLocationNo.isEmpty() || Double.parseDouble(destLocationNo) <= 0) {
             BeanUtils.copyProperties(new CutterTestDataEntity(), cutterTestDataEntity);
             cutterTestDataEntity.setWriteOrDel("2");
 
@@ -264,20 +280,20 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
         String s = null;
         try {
             //todo wang.sq 对刀仪数据推送地址释放$需要换地址$
-            if(imcsTOccsEnable){
+            if (imcsTOccsEnable) {
                 s = restTemplate.postForObject(url, formEntity, String.class);
                 JSONObject jsonObject = JSONObject.parseObject(s);
                 // 把机床下刀的数据同步过来,以保证二次入库,数据正确写入,只有在从机床出刀的时候才执行此代码
-                if(jsonObject.getString("returnData") !=null && !jsonObject.getString("returnData").isEmpty() && cutterTestDataEntity.getWriteOrDel().equals("2")){
+                if (jsonObject.getString("returnData") != null && !jsonObject.getString("returnData").isEmpty() && cutterTestDataEntity.getWriteOrDel().equals("2")) {
                     CutterTestDataEntity returnData = JSONObject.parseObject(jsonObject.getString("returnData"), CutterTestDataEntity.class);
-                    BeanUtils.copyProperties(returnData,cutterTestDataEntity);
+                    BeanUtils.copyProperties(returnData, cutterTestDataEntity);
                 }
 
-            }else {
+            } else {
                 s = "{\"taskID\":\"1\",\"taskNodeID\":\"1\",\"result\":\"true\",\"resultMsg\":\"消费成功\",\"concurrency\":\"false\",\"data\":null}\n";
             }
-        }catch (Exception e){
-            throw new RuntimeException("调用接口报错:"+ e.getMessage());
+        } catch (Exception e) {
+            throw new RuntimeException("调用接口报错:" + e.getMessage());
         }
         JSONObject retJson = JSONObject.parseObject(s);
         Boolean result = retJson.getBoolean("result");
@@ -291,7 +307,7 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
             //新增或修改刀具数据
             this.update(cutterTestDataEntity, queryWrapper2);
             return true;
-        }else {
+        } else {
             cutterTestDataEntity.setStatus(4);
             //新增或修改刀具数据
             this.update(cutterTestDataEntity, queryWrapper2);
@@ -326,7 +342,7 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
         CutterFile.findFileS(needFile, new ArrayList<>(), new ArrayList<>(), CutterSharedPath, "RFIDWrite.xml");
 
         if (needFile.isEmpty()) {
-            throw new BizException("没有找到文件");
+            throw new BizException("没有找到文件,缺失RFID文件");
         }
 
         File file = needFile.get(0);
@@ -340,8 +356,8 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
                 JSONArray xmlArrayData = CutterFile.findXmlArrayData(root);
                 for (Object xmlArrayDatum : xmlArrayData) {
                     JSONObject jsonObject = JSONObject.parseObject(xmlArrayDatum.toString());
-                    if("刀具号".equals(jsonObject.getString("name"))){
-                        String segment = jsonObject.getString("Segment").replace(" ","");
+                    if ("刀具号".equals(jsonObject.getString("name"))) {
+                        String segment = jsonObject.getString("Segment").replace(" ", "");
                         decimal = Integer.parseInt(segment, 10);
 
                         one = cuttingToolService.getOne(Wraps.<CuttingTool>lbQ().eq(CuttingTool::getCuttingToolNo, decimal));
@@ -357,14 +373,14 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
             throw new BizException("机外对刀仪rfid对象文件获取失败");
         }
 
-        if(one ==null){
-            throw new BizException("基础数据无此刀具号:"+ decimal);
+        if (one == null) {
+            throw new BizException("基础数据无此刀具号:" + decimal);
         }
 
         //对刀数据读取
         try {
             this.findCutterTestData(one);
-        }catch (Exception e){
+        } catch (Exception e) {
             e.printStackTrace();
             throw new BizException(e.getMessage());
         }

+ 54 - 0
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/cutterdata/CutterDataRecodeMapper.xml

@@ -0,0 +1,54 @@
+<?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.github.zuihou.business.cutterdata.dao.CutterTestDataRecordMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="BaseResultMap" type="com.github.zuihou.business.cutterdata.entity.CutterTestDataRecordEntity">
+        <id column="id" jdbcType="BIGINT" property="id"/>
+        <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/>
+        <result column="create_user" jdbcType="BIGINT" property="createUser"/>
+        <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/>
+        <result column="update_user" jdbcType="BIGINT" property="updateUser"/>
+        <result column="status" jdbcType="VARCHAR" property="status"/>
+        <result column="file_path" jdbcType="VARCHAR" property="filePath"/>
+        <result column="file_time" jdbcType="VARCHAR" property="fileTime"/>
+        <result column="cutter_name" jdbcType="VARCHAR" property="cutterName"/>
+        <result column="cutter_t" jdbcType="VARCHAR" property="cutterT"/>
+        <result column="cutter_typ" jdbcType="VARCHAR" property="cutterTyp"/>
+        <result column="cutter_typ_dnc" jdbcType="VARCHAR" property="cutterTypDnc"/>
+        <result column="cutter_typ_sub_dnc" jdbcType="VARCHAR" property="cutterTypSubDnc"/>
+        <result column="cutter_zl" jdbcType="BIGINT" property="cutterZl"/>
+        <result column="cutter_xl" jdbcType="VARCHAR" property="cutterXl"/>
+        <result column="cutter_rs" jdbcType="VARCHAR" property="cutterRs"/>
+        <result column="cutter_to" jdbcType="VARCHAR" property="cutterTo"/>
+        <result column="cutter_ori" jdbcType="VARCHAR" property="cutterOri"/>
+        <result column="cutter_time1" jdbcType="VARCHAR" property="cutterTime1"/>
+        <result column="cutter_time2" jdbcType="VARCHAR" property="cutterTime2"/>
+        <result column="cutter_over_time" jdbcType="VARCHAR" property="cutterOverTime"/>
+        <result column="cutter_plc_bit" jdbcType="VARCHAR" property="cutterPlcBit"/>
+        <result column="cutter_p" jdbcType="VARCHAR" property="cutterP"/>
+        <result column="cutter_P_Ip" jdbcType="VARCHAR" property="cutterPIp"/>
+        <result column="lcuts" jdbcType="VARCHAR" property="lcuts"/>
+        <result column="rcuts" jdbcType="VARCHAR" property="rcuts"/>
+        <result column="lu" jdbcType="VARCHAR" property="lu"/>
+        <result column="rn" jdbcType="VARCHAR" property="rn"/>
+        <result column="angle" jdbcType="VARCHAR" property="angle"/>
+        <result column="nmax" jdbcType="VARCHAR" property="nmax"/>
+        <result column="dzl" jdbcType="VARCHAR" property="dzl"/>
+        <result column="dxl" jdbcType="VARCHAR" property="dxl"/>
+        <result column="dyl" jdbcType="VARCHAR" property="dyl"/>
+        <result column="drs" jdbcType="VARCHAR" property="drs"/>
+        <result column="dcw" jdbcType="VARCHAR" property="dcw"/>
+        <result column="tangle" jdbcType="VARCHAR" property="tangle"/>
+        <result column="pangle" jdbcType="VARCHAR" property="pangle"/>
+        <result column="cutlength" jdbcType="VARCHAR" property="cutlength"/>
+        <result column="cutwidth" jdbcType="VARCHAR" property="cutwidth"/>
+    </resultMap>
+
+    <!-- 通用查询结果列 -->
+    <sql id="Base_Column_List">
+        id,create_time,create_user,update_time,update_user,status,file_path,file_time,cutter_name,cutter_t,cutter_typ,cutter_typ_dnc,
+        cutter_typ_sub_dnc,cutter_zl,cutter_xl,cutter_rs,cutter_to,cutter_ori,cutter_time2,cutter_over_time,cutter_plc_bit,cutter_p,cutter_P_Ip
+    </sql>
+
+</mapper>

+ 81 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/cutterdata/dto/CutterTestDataRecordDto.java

@@ -0,0 +1,81 @@
+package com.github.zuihou.business.cutterdata.dto;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import java.io.Serializable;
+
+/**
+ * @Project: imcs-admin-boot
+ * @Package: com.github.zuihou.business.cutterdata.dto
+ * @Author: Lenovo
+ * @Time: 2024 - 11 - 21 15 : 27
+ * @Description:
+ */
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class CutterTestDataRecordDto implements Serializable {
+
+    private Long id;
+
+    @ApiModelProperty(value = "数据来源路径")
+    private  String filePath;
+
+    @ApiModelProperty(value = "文件时间")
+    private  String fileTime;
+
+    @ApiModelProperty(value = "刀具名")
+    private  String cutterName;
+
+    @ApiModelProperty(value = "刀号")
+    private  String cutterT;
+
+    @ApiModelProperty(value = "刀具类型(对刀仪)")
+    private  String cutterTyp;
+
+    @ApiModelProperty(value = "刀具类型(机床)")
+    private  String cutterTypDnc;
+
+    @ApiModelProperty(value = "刀具子类型(机床)")
+    private  String cutterTypSubDnc;
+
+    @ApiModelProperty(value = "刀具长度")
+    private  String cutterZl;
+
+    @ApiModelProperty(value = "刀具半径/直径,根据类型来")
+    private  String cutterXl;
+
+    @ApiModelProperty(value = "刀具R角")
+    private  String cutterRs;
+
+    @ApiModelProperty(value = "刀尖角")
+    private  String cutterTo;
+
+    @ApiModelProperty(value = "主轴定向角度")
+    private  String cutterOri;
+
+    @ApiModelProperty(value = "刀具使用寿命")
+    private  String cutterTime2;
+
+    @ApiModelProperty(value = "刀具使用寿命,不允许超过该值")
+    private  String cutterOverTime;
+
+    @ApiModelProperty(value = "内冷开")
+    private  String cutterPlcBit;
+
+    @ApiModelProperty(value = "数据状态,0机外对刀仪字段解析失败,1字段合格性检测不通过,2未推送机床,3已推送机床,4推送失败,5历史数据")
+    private Integer status;
+
+    @ApiModelProperty(value = "到位点,刀具存放在那个机床的那个点位")
+    private String cutterP;
+
+    @ApiModelProperty(value = "到位点ip,存放在那个机床")
+    private String cutterPIp;
+
+}

+ 2 - 2
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/cutterdata/entity/CutterTestDataEntity.java

@@ -56,7 +56,7 @@ public class CutterTestDataEntity extends Entity<Long> {
     @Length(max = 128, message = "名称长度不能超过128")
     @TableField(value = "cutter_typ", condition = LIKE)
     @Excel(name = "刀具类型")
-    private  String cutterTyp ="0";
+    private  String cutterTyp;
 
     @ApiModelProperty(value = "刀具类型(机床)")
     @Length(max = 128, message = "名称长度不能超过128")
@@ -68,7 +68,7 @@ public class CutterTestDataEntity extends Entity<Long> {
     @Length(max = 128, message = "名称长度不能超过128")
     @TableField(value = "cutter_typ_sub_dnc", condition = LIKE)
     @Excel(name = "刀具子类型(机床)")
-    private  String cutterTypSubDnc ="0";
+    private  String cutterTypSubDnc ;
 
     @ApiModelProperty(value = "刀具长度-对应机床L或者车刀表zl代表刀具在z轴方向上的长度")
     @Length(max = 128, message = "名称长度不能超过128")

+ 253 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/cutterdata/entity/CutterTestDataRecordEntity.java

@@ -0,0 +1,253 @@
+package com.github.zuihou.business.cutterdata.entity;
+
+import cn.afterturn.easypoi.excel.annotation.Excel;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableName;
+import com.github.zuihou.base.entity.Entity;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.*;
+import lombok.experimental.Accessors;
+import org.hibernate.validator.constraints.Length;
+
+import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
+
+/**
+ * @Project: imcs-admin-boot
+ * @Package: com.github.zuihou.business.cutterdata
+ * @Author: Lenovo
+ * @Time: 2025 - 04 - 25 15 : 07
+ * @Description:
+ */
+
+@Data
+@Builder
+@NoArgsConstructor
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("imcs_cutter_test_data_record")
+@ApiModel(value = "CutterTestDataEntityRecord", description = "机外对刀仪历史记录")
+@AllArgsConstructor
+public class CutterTestDataRecordEntity extends Entity<Long> {
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty(value = "数据来源路径")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "file_path", condition = LIKE)
+    @Excel(name = "数据来源路径")
+    private  String filePath;
+
+    @ApiModelProperty(value = "文件时间")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "file_time", condition = LIKE)
+    @Excel(name = "文件时间")
+    private  String fileTime;
+
+    @ApiModelProperty(value = "刀柄号")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_t", condition = LIKE)
+    @Excel(name = "刀柄号")
+    private  String cutterT;
+
+    @ApiModelProperty(value = "刀具名")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_name", condition = LIKE)
+    @Excel(name = "刀具名")
+    private  String cutterName ="";
+
+    @ApiModelProperty(value = "刀具类型(对刀仪)")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_typ", condition = LIKE)
+    @Excel(name = "刀具类型")
+    private  String cutterTyp ="0";
+
+    @ApiModelProperty(value = "刀具类型(机床)")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_typ_dnc", condition = LIKE)
+    @Excel(name = "刀具类型(机床)")
+    private  String cutterTypDnc ="0";
+
+    @ApiModelProperty(value = "刀具子类型(机床)")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_typ_sub_dnc", condition = LIKE)
+    @Excel(name = "刀具子类型(机床)")
+    private  String cutterTypSubDnc ="0";
+
+    @ApiModelProperty(value = "刀具长度-对应机床L或者车刀表zl代表刀具在z轴方向上的长度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_zl", condition = LIKE)
+    @Excel(name = "刀具长度")
+    private  String cutterZl = "0";
+
+    @ApiModelProperty(value = "刀具半径/直径,根据类型来,对应机床R或者车刀表xl代表刀具在Y轴方向上的长度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_xl", condition = LIKE)
+    @Excel(name = "刀具半径/直径,根据类型来")
+    private  String cutterXl = "0";
+
+    @ApiModelProperty(value = "刀具在Y轴方向上的长度,根据类型来,对应机床R或者车刀表yl代表刀具在y轴方向上的长度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_yl", condition = LIKE)
+    @Excel(name = "刀具在Y轴方向上的长度,根据类型来")
+    private  String cutterYl = "0";
+
+    @ApiModelProperty(value = "刀具R角,车刀")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_rs", condition = LIKE)
+    @Excel(name = "刀具R角")
+    private  String cutterRs = "0";
+
+    @ApiModelProperty(value = "刀具定向,车刀")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_to", condition = LIKE)
+    @Excel(name = "刀具定向")
+    private  String cutterTo = "0";
+
+    @ApiModelProperty(value = "主轴定向角度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_ori", condition = LIKE)
+    @Excel(name = "主轴定向角度")
+    private  String cutterOri = "0";
+
+    @ApiModelProperty(value = "最长刀具寿命")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_time1", condition = LIKE)
+    @Excel(name = "最长刀具寿命")
+    private  String cutterTime1 = "0";
+
+    @ApiModelProperty(value = "调用刀具的最长寿命")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_time2", condition = LIKE)
+    @Excel(name = "调用刀具的最长寿命")
+    private  String cutterTime2 = "0";
+
+    @ApiModelProperty(value = "刀具使用寿命,不允许超过该值")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_over_time", condition = LIKE)
+    @Excel(name = "刀具使用寿命,不允许超过该值")
+    private  String cutterOverTime = "0";
+
+    @ApiModelProperty(value = "内冷开")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_plc_bit", condition = LIKE)
+    @Excel(name = "内冷开")
+    private  String cutterPlcBit = "0";
+
+    @ApiModelProperty(value = "在刀具轴方向上的刀齿长")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "lcuts", condition = LIKE)
+    @Excel(name = "在刀具轴方向上的刀齿长")
+    private  String lcuts = "0";
+
+    @ApiModelProperty(value = "准确定义刀具的切削刃正面宽度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "rcuts", condition = LIKE)
+    @Excel(name = "准确定义刀具的切削刃正面宽度")
+    private  String rcuts = "0";
+
+    @ApiModelProperty(value = "准确定义刀具的刀具可用长度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "lu", condition = LIKE)
+    @Excel(name = "准确定义刀具的刀具可用长度")
+    private  String lu = "0";
+
+    @ApiModelProperty(value = "准确定义刀具的刀颈半径")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "rn", condition = LIKE)
+    @Excel(name = "准确定义刀具的刀颈半径")
+    private  String rn = "0";
+
+    @ApiModelProperty(value = "最大的切入角度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "angle", condition = LIKE)
+    @Excel(name = "最大的切入角度")
+    private  String angle = "0";
+
+    @ApiModelProperty(value = "最高速度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "nmax", condition = LIKE)
+    @Excel(name = "最高速度")
+    private  String nmax = "0";
+
+    @ApiModelProperty(value = "刀具长度1的差值")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "dzl", condition = LIKE)
+    @Excel(name = "刀具长度1的差值")
+    private  String dzl = "0";
+
+    @ApiModelProperty(value = "刀具长度2的差值")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "dxl", condition = LIKE)
+    @Excel(name = "刀具长度2的差值")
+    private  String dxl = "0";
+
+    @ApiModelProperty(value = "刀具长度3的差值")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "dyl", condition = LIKE)
+    @Excel(name = "刀具长3的差值")
+    private  String dyl = "0";
+
+    @ApiModelProperty(value = "刀具半径的差值")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "drs", condition = LIKE)
+    @Excel(name = "刀具半径的差值")
+    private  String drs = "0";
+
+    @ApiModelProperty(value = "开槽刀宽度的差值")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "dcw", condition = LIKE)
+    @Excel(name = "开槽刀宽度的差值")
+    private  String dcw = "0";
+
+    @ApiModelProperty(value = "下刀角")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "tangle", condition = LIKE)
+    @Excel(name = "下刀角")
+    private  String tangle = "0";
+
+    @ApiModelProperty(value = "刀尖角")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "pangle", condition = LIKE)
+    @Excel(name = "刀尖角")
+    private  String pangle = "0";
+
+    @ApiModelProperty(value = "切槽刀的切削长度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutlength", condition = LIKE)
+    @Excel(name = "切槽刀的切削长度")
+    private  String cutlength = "0";
+
+    @ApiModelProperty(value = "槽加工刀宽度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutwidth", condition = LIKE)
+    @Excel(name = "槽加工刀宽度")
+    private  String cutwidth = "0";
+
+    @ApiModelProperty(value = "数据状态,0机外对刀仪字段解析失败,1字段合格性检测不通过,2未推送机床,3已推送机床,4推送失败,5历史数据")
+    @TableField(value = "status", condition = LIKE)
+    @Excel(name = "数据状态")
+    private Integer status;
+
+    @ApiModelProperty(value = "到位点,刀具存放在那个机床的那个点位")
+    @TableField(value = "cutter_p", condition = LIKE)
+    @Excel(name = "到位点")
+    private String cutterP;
+
+    @ApiModelProperty(value = "到位点ip,存放在那个机床")
+    @TableField(value = "cutter_P_Ip", condition = LIKE)
+    @Excel(name = "到位点ip")
+    private String cutterPIp;
+
+    @ApiModelProperty(value = "操作类型,1更新,新增;2清空")
+    @Excel(name = "操作类型,1更新,新增;2清空")
+    @TableField(exist = false)
+    private String writeOrDel;
+
+    @ApiModelProperty(value = "站点id")
+    @Excel(name = "站点id")
+    @TableField(exist = false)
+    public long resourceId;
+}