1
0

4 Коммиты 42e1a545bc ... 4092408316

Автор SHA1 Сообщение Дата
  wang.sq@aliyun.com 4092408316 Merge remote-tracking branch 'origin/master' 2 недель назад
  wang.sq@aliyun.com 49aa528874 fix:刀具换到逻辑 2 недель назад
  wang.sq@aliyun.com c1febeb01a fix:优化对刀参数,以及自动零件生成 2 недель назад
  wang.sq@aliyun.com 31b9d76474 fix:增加配置文件 2 недель назад

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -1940,7 +1940,7 @@ public class TaskWorkNode {
 
         //设备不存在
         if (!checkRobot(robotList, zone.getName(), count)) {
-            dataMap.put("resultMsg","设备不存在或者设备未满足条件");
+            dataMap.put("resultMsg","设备不存在或者设备未满足条件,或者需要交换");
             return null;
         }
 //        //资源临界判断

+ 5 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskServiceImpl.java

@@ -1493,7 +1493,7 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
         BBom bom = bBomMapper.selectById(planProduct.getBomId());
         TWorkpiece tWorkpiece = workpieceMapper.selectOne(Wraps.<TWorkpiece>lbQ().eq(TWorkpiece::getCompleteBatchNo, task.getCompleteBatchNo()));
         params.put("id",task.getPlanId());
-        Map<String, String> orderMeterialInfo = planMapper.getFinishPlanPartInfo(params);
+        //Map<String, String> orderMeterialInfo = planMapper.getFinishPlanPartInfo(params);
         String productType = "";
         if("framework".equals(zZone.getNo())){
             productType = "K";
@@ -1663,6 +1663,10 @@ public class TaskServiceImpl extends SuperServiceImpl<TTaskMapper, TTask> implem
         List<Long> stockIds = stockInfoMapper.selectList(new LbqWrapper<StockInfo>().in(StockInfo::getStorgeId,startProductionresourcePositionIds).eq(StockInfo::getGoodsType, "1").eq(StockInfo::getLockStatus, "1")).stream().map(StockInfo::getGoodsId).collect(Collectors.toList());
         //获取可用子盘
         List<Tray> trayList = trayService.list(new LbqWrapper<Tray>().eq(Tray::getCategoryType, tray.getCategoryType()).eq(Tray::getProductionType, tray.getProductionType()).eq(Tray::getFiveAxis, tray.getFiveAxis()).in(Tray::getId, stockIds));
+
+        if(trayList.isEmpty() || trayList.size()==0){
+            throw new RuntimeException("库存没有可用的子盘");
+        }
         return trayList;
     }
 }

+ 10 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionReadyCenter/service/impl/MachineCuttingToolServiceImpl.java

@@ -82,6 +82,9 @@ public class MachineCuttingToolServiceImpl extends SuperCacheServiceImpl<Machine
     @Autowired
     private MachineCuttingToolService machineCuttingToolService;
 
+    @Value("${imcs-to-ccs.enabled:true}")
+    private Boolean imcsTOccsEnable;
+
     @Override
     @InjectionResult
     public IPage<MachineCuttingTool> findPage(IPage<MachineCuttingTool> page, LbqWrapper<MachineCuttingTool> wrapper) {
@@ -124,8 +127,13 @@ public class MachineCuttingToolServiceImpl extends SuperCacheServiceImpl<Machine
 //             instructionUrl = DictionaryKey.INSTRUCTION_URL + "/api/GetTools";
             log.info("================机床刀具数据同步instructionUrl================" + instructionUrl);
             log.info("================机床刀具数据同步jsonParam================" + jsonObject.toJSONString());
-            ResponseEntity<String> postForEntity = restTemplate.postForEntity(instructionUrl, request, String.class);
-            synMachineCuttingTolls = postForEntity.getBody();
+
+            if(imcsTOccsEnable){
+                ResponseEntity<String> postForEntity = restTemplate.postForEntity(instructionUrl, request, String.class);
+                synMachineCuttingTolls = postForEntity.getBody();
+            }else {
+                synMachineCuttingTolls = "[{\"position\":\"1.1\",\"number\":\"1\",\"name\":\"XD-D32R2\",\"warnLife\":\"87\",\"targetLife\":\"2282.88\",\"workPiece\":null,\"workPieceWarn\":null,\"workPieceTarget\":null,\"wear\":null,\"wearWarn\":null,\"wearTarget\":null,\"sisterNo\":null,\"toolEdgeNo\":null,\"toolPosition\":null,\"toolRadius\":null,\"tl\":\"0\",\"doc\":\"HD\"},{\"position\":\"1.2\",\"number\":\"2\",\"name\":\"XD20L68R40-ER32L100\",\"warnLife\":\"0\",\"targetLife\":\"8021.45\",\"workPiece\":null,\"workPieceWarn\":null,\"workPieceTarget\":null,\"wear\":null,\"wearWarn\":null,\"wearTarget\":null,\"sisterNo\":null,\"toolEdgeNo\":null,\"toolPosition\":null,\"toolRadius\":null,\"tl\":\"0\",\"doc\":\"\"}]\n";
+            }
 
             log.info("设备" + productionresource.getName() + "同步刀具返回{},请求参数{}",synMachineCuttingTolls,jsonObject.toString());
             JSONArray upResult = JSONArray.parseArray(synMachineCuttingTolls);

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/strategy/impl/CacheRobotStrategy.java

@@ -226,7 +226,7 @@ public class CacheRobotStrategy implements RobotStrategy {
         }
         //锁定暂存缓存位库位
         if(startStorge==null){
-            throw new RuntimeException("库位不满足");
+            throw new RuntimeException("库位不满足,没用查询到可用子盘");
         }
         startStorge.setCompleteBatchNo(taskNode.getCompleteBatchNo());
         storgeService.lockStorge(startStorge, taskNode.getId());

+ 2 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/productionResourceCenter/ToolController.java

@@ -37,6 +37,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
@@ -153,6 +154,7 @@ public class ToolController extends SuperController<ToolService, Long, Tool, Too
 
                 String cutPosition = item.getCuttingToolPosition().replace("1.", "");
                 data.put("cutStartNo", cutPosition);
+                data.put("cutGoalNo", "0");
                 toolbarController.addCutToolTask(data);
                 item.setStatus("1");
                 machineCuttingToolService.updateAllById(item);

+ 128 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/entity/CuttingToolConfig.java

@@ -0,0 +1,128 @@
+package com.github.zuihou.business.productionReadyCenter.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 java.io.Serializable;
+
+import static com.baomidou.mybatisplus.annotation.SqlCondition.LIKE;
+
+/**
+ * @Project: imcs-admin-boot
+ * @Package: com.github.zuihou.business.productionReadyCenter.entity
+ * @Author: Lenovo
+ * @Time: 2025 - 04 - 01 11 : 58
+ * @Description:
+ */
+
+@Data
+@NoArgsConstructor
+@ToString(callSuper = true)
+@EqualsAndHashCode(callSuper = true)
+@Accessors(chain = true)
+@TableName("imcs_cutting_tool_config")
+@ApiModel(value = "CuttingTool", description = "刀具对刀配置信息")
+@AllArgsConstructor
+public class CuttingToolConfig extends Entity<Long> {
+
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty(value = "刀具号")
+    @TableField(value = "cutting_tool_no", condition = LIKE)
+    @Excel(name = "刀具号")
+    private Long cuttingToolNo;
+
+    @ApiModelProperty(value = "刀具长度-对应机床L或者车刀表zl代表刀具在z轴方向上的长度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_zl_min", condition = LIKE)
+    @Excel(name = "刀具长度下偏差")
+    private  double cutterZlMin = 0.0;
+
+    @ApiModelProperty(value = "刀具长度-对应机床L或者车刀表zl代表刀具在z轴方向上的长度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_zl_max", condition = LIKE)
+    @Excel(name = "刀具长度上偏差")
+    private  double cutterZlMax = 0.0;
+
+    @ApiModelProperty(value = "刀具半径/直径,根据类型来,对应机床R或者车刀表xl代表刀具在Y轴方向上的长度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_xl_min", condition = LIKE)
+    @Excel(name = "刀具半径/直径,根据类型来")
+    private  double cutterXlMin = 0.0;
+
+    @ApiModelProperty(value = "刀具半径/直径,根据类型来,对应机床R或者车刀表xl代表刀具在Y轴方向上的长度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_xl_max", condition = LIKE)
+    @Excel(name = "刀具半径/直径,根据类型来")
+    private  double cutterXlMax = 0.0;
+
+    @ApiModelProperty(value = "主轴定向角度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_ori_min", condition = LIKE)
+    @Excel(name = "主轴定向角度")
+    private  double cutterOriMin = 0.0;
+
+    @ApiModelProperty(value = "主轴定向角度")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_ori_max", condition = LIKE)
+    @Excel(name = "主轴定向角度")
+    private  double cutterOriMax = 0.0;
+
+    @ApiModelProperty(value = "刀具子类型(机床)")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_typ_sub_dnc", condition = LIKE)
+    @Excel(name = "刀具子类型(机床),是否为空1可以为,2不可")
+    private  String cutterTypSubDnc = "2";
+
+    @ApiModelProperty(value = "刀具R角,车刀")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_rs_min", condition = LIKE)
+    @Excel(name = "刀具R角")
+    private  double cutterRsMin = 0.0;
+
+    @ApiModelProperty(value = "刀具R角,车刀")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_rs_max", condition = LIKE)
+    @Excel(name = "刀具R角")
+    private  double cutterRsMax = 0.0;
+
+    @ApiModelProperty(value = "刀具定向,车刀")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_to_min", condition = LIKE)
+    @Excel(name = "刀具定向")
+    private  double cutterToMin = 0.0;
+
+    @ApiModelProperty(value = "刀具定向,车刀")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_to_max", condition = LIKE)
+    @Excel(name = "刀具定向")
+    private  double cutterToMax = 0.0;
+
+    @ApiModelProperty(value = "内冷开")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_plc_bit", condition = LIKE)
+    @Excel(name = "内冷开")
+    private  String cutterPlcBit ;
+
+    @ApiModelProperty(value = "最小刀具寿命")
+    @Length(max = 128, message = "名称长度不能超过128")
+    @TableField(value = "cutter_time2", condition = LIKE)
+    @Excel(name = "最小刀具寿命")
+    private  double cutterTime2 = 0.0;
+
+    @ApiModelProperty(value = "备注,用来展示其他没有的要求")
+    @TableField(value = "remark", condition = LIKE)
+    @Excel(name = "备注,用来展示其他没有的要求")
+    private  String remark = "0";
+
+
+}