소스 검색

后台功能处理

oyq28 5 달 전
부모
커밋
7a638f0a4e

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

@@ -20,9 +20,7 @@ import com.github.zuihou.business.externalApi.entity.AgvHikOrderInfo;
 import com.github.zuihou.business.externalApi.service.AgvHikOrderInfoService;
 import com.github.zuihou.business.externalApi.service.ExternalApiService;
 import com.github.zuihou.business.operationManagementCenter.dao.*;
-import com.github.zuihou.business.operationManagementCenter.entity.TTask;
-import com.github.zuihou.business.operationManagementCenter.entity.TWorkpiece;
-import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
+import com.github.zuihou.business.operationManagementCenter.entity.*;
 import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
 import com.github.zuihou.business.operationManagementCenter.service.WorkpieceService;
 import com.github.zuihou.business.productionReadyCenter.dao.AAutoNodeLogMapper;
@@ -384,6 +382,24 @@ public class TaskWorkNode {
                         //不用调接口,直接返回成功
                         conMap.put("result", true);
                         msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE_STATUS + "_" + taskNode.getId(), "0");
+                        // 自定义订单内部加工设备节点执行确认判断处理 判断成功直接更新状态
+                        if(taskNode.getNodeName().equals("执行确认")){
+                            taskNode.setExeStatus("3").setExeResult("1").setEndTime(new Date());
+                            taskNodeService.updateById(taskNode);
+                            tTask.setStatus("3").setEndTime(new Date());
+                            taskMapper.updateAllById(tTask);
+                            TWorkpiece currWorkpiece = workpieceService.getWorkPiece(taskNode.getId());
+                            currWorkpiece.setIsEnd("1");
+                            workpieceService.updateById(currWorkpiece);
+                            Plan plan = planMapper.selectById(tTask.getPlanId());
+                            plan.setProduceStatus("4").setPlanStatus("3");
+                            planMapper.updateById(plan);
+                            Order order = orderMapper.selectById(tTask.getOrderId());
+                            order.setCompleteNum(1).setProduceStatus("3");//完成
+                            orderMapper.updateAllById(order);
+                            //机床刀具位上下料处理
+
+                        }
                     } else {
                         Map queryMap = Maps.newHashMap();
                         queryMap.put("bizType", bizType);
@@ -600,8 +616,8 @@ public class TaskWorkNode {
 
                                                 //todo $需要换地址$
                                                 HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
-                                                returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
-                                                //returnData = "{\"result\": \"true\"}";
+                                                //returnData = restTemplate.postForObject(instructionUrl, formEntity, String.class);
+                                                returnData = "{\"result\": \"true\"}";
 
                                             }
 

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

@@ -229,12 +229,11 @@ public class OrderTaskServiceImpl extends SuperServiceImpl<OrderTaskMapper, Orde
     public TTask getSimpleTask(int currentSort, Order order, BBom bom, Long startResourceId, Long resourceBusinessId){
         TTask simpleTask = taskService.getOne(new LambdaQueryWrapper<TTask>().eq(TTask::getResourceBusinessId, resourceBusinessId).eq(TTask::getProcedureSort, currentSort).orderByDesc(TTask::getCreateTime).last("limit 1"));
         //OrderProduct orderProduct = orderProductService.getOne(new LambdaQueryWrapper<OrderProduct>().eq(OrderProduct::getBomNum, 1).orderByDesc(OrderProduct::getCreateTime).last("limit 1"));
-        Plan plan = planService.getOne(new LambdaQueryWrapper<Plan>().eq(Plan::getProduceStatus, "4").orderByDesc(Plan::getCreateTime).last("limit 1"));
         TTask initTask = TTask.builder().build();
         //OrderProduct initProduct = OrderProduct.builder().build();
         Plan initPlan = Plan.builder().build();
         if(simpleTask == null){
-            String procedureName = "上料";
+            String procedureName = "刀具取放";
             //初始化默认简易任务
             Long bomId = bom.getId();
             Long resourceId = startResourceId;
@@ -248,8 +247,10 @@ public class OrderTaskServiceImpl extends SuperServiceImpl<OrderTaskMapper, Orde
             BeanUtil.copyProperties(simpleTask, initTask, "id");
             initTask.setOrderId(order.getId()).setOrderNo(order.getOrderNo()).setPlanId(order.getPlanId()).setCompleteBatchNo(UUID.randomUUID().toString().replace("-", "")).setTaskNo(codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_TASK));
         }
-
-        BeanUtil.copyProperties(plan, initPlan, "id");
+        Plan plan = planService.getOne(new LambdaQueryWrapper<Plan>().eq(Plan::getProduceStatus, "4").orderByDesc(Plan::getCreateTime).last("limit 1"));
+        if(plan!=null) {
+            BeanUtil.copyProperties(plan, initPlan, "id");
+        }
         initPlan.setOrderId(order.getId()).setOrderNo(order.getOrderNo()).setPlanNo(codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_PLAN));
         //orderProductService.save(initProduct);
         planService.save(initPlan);

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

@@ -1589,7 +1589,8 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         String taskType = callBackJsonParam.get("taskType").toString();
         if(DictionaryKey.CARRY_TYPE.get("TOOL_HAND").equals(taskType)){
             //刀具任务
-            return toolTaskNodeService.toolTaskNodeCallback(bean);
+            //return toolTaskNodeService.toolTaskNodeCallback(bean);
+
         }
 
         //更换手抓

+ 8 - 3
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/strategy/impl/ToolRobotStrategy.java

@@ -134,10 +134,11 @@ public class ToolRobotStrategy implements RobotStrategy {
             Object cutToolAction = msgUtil.redis_get(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION);
             if(ObjectUtil.isEmpty(cutToolAction)){
                 this.CNCTActionHandle(taskNode, false, pointId, orderTask);
-                msgUtil.redis_set(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION, "0",10, TimeUnit.MINUTES);
+                msgUtil.redis_set(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION, taskNode.getId().toString(),10, TimeUnit.MINUTES);
                 return null;
             }
         }
+
         //todo 与ccs联调需要释放  $需要换地址$
         bool = this.cutToolActionCondition("/api/getCutterDeviceIsTake", taskNode,pointId);
 
@@ -207,7 +208,7 @@ public class ToolRobotStrategy implements RobotStrategy {
         }
 
         locationMap.put("taskType", DictionaryKey.TASK_TYPE.get("CARRY"));
-        locationMap.put("carryType", "1");
+        locationMap.put("carryType", DictionaryKey.CARRY_TYPE.get("TOOL_HAND"));
         returnMap.put("data", locationMap);
         returnMap.put("method", "CutterRobotAction");
         returnMap.put("result", true);
@@ -252,13 +253,17 @@ public class ToolRobotStrategy implements RobotStrategy {
             Object cutToolAction = msgUtil.redis_get(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION);
             if(ObjectUtil.isEmpty(cutToolAction)){
                 this.CNCTActionHandle(taskNode, true, pointId, orderTask);
-                msgUtil.redis_set(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION, "1",10, TimeUnit.MINUTES);
+                msgUtil.redis_set(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION, taskNode.getId().toString(),10, TimeUnit.MINUTES);
                 return null;
             }
         }
 
+<<<<<<< Updated upstream
         //todo 与ccs联调需要释放  $需要换地址$
         bool = this.cutToolActionCondition("/api/getCutterDeviceIsPut", taskNode,pointId);
+=======
+        //bool = this.cutToolActionCondition("/api/getCutterDeviceIsPut", taskNode,pointId);
+>>>>>>> Stashed changes
 
         if(!bool){
             msgUtil.createWarnLog("刀具节点目标位放置条件不满足","DataException");

+ 5 - 2
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/CuttingToolMapper.xml

@@ -24,14 +24,17 @@
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
         id,create_user,create_time,update_user,update_time,cutting_tool_no,cutting_tool_name,cutting_tool_type,specifications,cutting_set_tool_picture,
-        cutting_tool_picture,cutting_tool_install_picture,tool_set_to_check_parameter,cutter_no,status,remark
+        cutting_tool_picture,cutting_tool_install_picture,tool_set_to_check_parameter,cutter_no,status,remark,deviceName, storgeName, storgeId
     </sql>
 
     <select id="findPage" resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
         FROM (
-            select t.* from imcs_cutting_tool t
+            select t.*, p.name as deviceName, i.storge_id as storgeId, s.name as storgeName from imcs_cutting_tool t
+             LEFT JOIN imcs_s_stock_info i ON t.id = i.goods_id
+             LEFT JOIN imcs_s_storge s ON s.id = i.storge_id
+             LEFT JOIN imcs_tenant_productionresource p ON t.device_id = p.id
          ) s ${ew.customSqlSegment}
     </select>
     

+ 5 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/dto/CuttingToolPageDTO.java

@@ -94,4 +94,9 @@ public class CuttingToolPageDTO implements Serializable {
     @Length(max = 255, message = "备注长度不能超过255")
     @Excel(name = "备注")
     private String remark;
+
+    private String deviceName;
+
+    private String storgeName;
+
 }

+ 3 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/dto/CuttingToolSaveDTO.java

@@ -110,6 +110,9 @@ public class CuttingToolSaveDTO implements Serializable {
     @ApiModelProperty(value = "设备ID")
     private Long deviceId;
 
+    @ApiModelProperty(value = "库位ID")
+    private Long storgeId;
+
     @ApiModelProperty(value = "刀位号")
     private int cutterNo;
 

+ 3 - 0
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionReadyCenter/dto/CuttingToolUpdateDTO.java

@@ -115,6 +115,9 @@ public class CuttingToolUpdateDTO implements Serializable {
     @ApiModelProperty(value = "设备ID")
     private Long deviceId;
 
+    @ApiModelProperty(value = "库位ID")
+    private Long storgeId;
+
     @ApiModelProperty(value = "刀位号")
     private int cutterNo;
 

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

@@ -106,6 +106,16 @@ public class CuttingTool extends Entity<Long> {
     @Excel(name = "实时变动,安装到机床的刀位号")
     private Long cutterNo;
 
+    @ApiModelProperty(value = "设备ID")
+    @TableField(value = "device_id", condition = LIKE)
+    @Excel(name = "设备ID")
+    private Long deviceId;
+
+    @ApiModelProperty(value = "库位ID")
+    @TableField(value = "storge_id", condition = LIKE)
+    @Excel(name = "库位ID")
+    private Long storgeId;
+
     @ApiModelProperty(value = "状态 1-启用 0-禁用")
     @Length(max = 1, message = "状态 1-启用 0-禁用长度不能超过1")
     @TableField(value = "status", condition = LIKE)
@@ -118,6 +128,13 @@ public class CuttingTool extends Entity<Long> {
     @Excel(name = "备注")
     private String remark;
 
+    @TableField(exist = false)
+    private String deviceName;
+
+    @TableField(exist = false)
+    private String storgeName;
+
+
     @Builder
     public CuttingTool(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, Long id1, Long cuttingToolNo, String cuttingToolName, String specifications, RemoteData<String, String> cuttingToolType, String cuttingSetToolPicture, String cuttingToolPicture, String cuttingToolInstallPicture, String toolSetToCheckParameter, String status, Long cutterNo, String remark) {
         super(id, createTime, createUser, updateTime, updateUser);