Browse Source

fix: 刀具自动化节点优化

wang.sq@aliyun.com 5 months ago
parent
commit
4eb5d52db3

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

@@ -232,17 +232,9 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
         rfidObj.put("taskNodeId", taskNode.getTaskId()+"1");
         rfidObj.put("data", JSONObject.toJSON(cutterTestDataEntity));
         if(destLocationNo==null || destLocationNo.isEmpty() || Double.parseDouble(destLocationNo)<=0){
+            BeanUtils.copyProperties(new CutterTestDataEntity(), cutterTestDataEntity);
             cutterTestDataEntity.setWriteOrDel("2");
-            cutterTestDataEntity.setCutterName(null);
-            cutterTestDataEntity.setCutterTyp("0");
-            cutterTestDataEntity.setCutterTypDnc("0");
-            cutterTestDataEntity.setCutterTypSubDnc("0");
-            cutterTestDataEntity.setCutterZl("0");
-            cutterTestDataEntity.setCutterXl("0");
-            cutterTestDataEntity.setCutterOri("0");
-            cutterTestDataEntity.setCutterTime2("0");
-            cutterTestDataEntity.setCutterOverTime("0");
-            cutterTestDataEntity.setCutterPlcBit("0");
+
             rfidObj.put("data", JSONObject.toJSON(cutterTestDataEntity));
         }
 
@@ -252,9 +244,16 @@ public class CutterTestDataServiceImpl extends SuperServiceImpl<CutterTestDataMa
 
         String s = null;
         try {
-            //todo wang.sq三坐标调用地址释放$需要换地址$
+            //todo wang.sq 对刀仪数据推送地址释放$需要换地址$
             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")){
+                    CutterTestDataEntity returnData = JSONObject.parseObject(jsonObject.getString("returnData"), CutterTestDataEntity.class);
+                    BeanUtils.copyProperties(returnData,cutterTestDataEntity);
+                }
+
             }else {
                 s = "{\"taskID\":\"12313\",\"taskNodeID\":\"12313123\",\"result\":\"true\",\"resultMsg\":\"消费成功\",\"concurrency\":\"false\",\"data\":null}\n";
             }

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

@@ -22,11 +22,27 @@
         <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>
 
     <!-- 通用查询结果列 -->

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

@@ -40,18 +40,18 @@ public class CutterTestDataEntity extends Entity<Long> {
     @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_t", condition = LIKE)
-    @Excel(name = "刀号")
-    private  String cutterT;
-
     @ApiModelProperty(value = "刀具类型(对刀仪)")
     @Length(max = 128, message = "名称长度不能超过128")
     @TableField(value = "cutter_typ", condition = LIKE)
@@ -70,53 +70,155 @@ public class CutterTestDataEntity extends Entity<Long> {
     @Excel(name = "刀具子类型(机床)")
     private  String cutterTypSubDnc;
 
-    @ApiModelProperty(value = "刀具长度")
+    @ApiModelProperty(value = "刀具长度-对应机床L或者车刀表zl代表刀具在z轴方向上的长度")
     @Length(max = 128, message = "名称长度不能超过128")
     @TableField(value = "cutter_zl", condition = LIKE)
     @Excel(name = "刀具长度")
-    private  String cutterZl;
+    private  String cutterZl = "0";
 
-    @ApiModelProperty(value = "刀具半径/直径,根据类型来")
+    @ApiModelProperty(value = "刀具半径/直径,根据类型来,对应机床R或者车刀表xl代表刀具在Y轴方向上的长度")
     @Length(max = 128, message = "名称长度不能超过128")
     @TableField(value = "cutter_xl", condition = LIKE)
     @Excel(name = "刀具半径/直径,根据类型来")
-    private  String cutterXl;
+    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角")
+    @ApiModelProperty(value = "刀具R角,车刀")
     @Length(max = 128, message = "名称长度不能超过128")
     @TableField(value = "cutter_rs", condition = LIKE)
     @Excel(name = "刀具R角")
-    private  String cutterRs;
+    private  String cutterRs = "0";
 
-    @ApiModelProperty(value = "刀尖角")
+    @ApiModelProperty(value = "刀具定向,车刀")
     @Length(max = 128, message = "名称长度不能超过128")
     @TableField(value = "cutter_to", condition = LIKE)
-    @Excel(name = "刀尖角")
-    private  String cutterTo;
+    @Excel(name = "刀具定向")
+    private  String cutterTo = "0";
 
     @ApiModelProperty(value = "主轴定向角度")
     @Length(max = 128, message = "名称长度不能超过128")
     @TableField(value = "cutter_ori", condition = LIKE)
     @Excel(name = "主轴定向角度")
-    private  String cutterOri;
+    private  String cutterOri = "0";
 
-    @ApiModelProperty(value = "刀具使用寿命")
+    @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;
+    @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;
+    private  String cutterOverTime = "0";
 
     @ApiModelProperty(value = "内冷开")
     @Length(max = 128, message = "名称长度不能超过128")
     @TableField(value = "cutter_plc_bit", condition = LIKE)
     @Excel(name = "内冷开")
-    private  String cutterPlcBit;
+    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)