Selaa lähdekoodia

优化对刀仪界面,三坐标检测界面

BSWYZ 5 päivää sitten
vanhempi
commit
3683bc784c

+ 1 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/externalApi/service/impl/WmsAgvInfoServiceImpl.java

@@ -289,7 +289,7 @@ public class WmsAgvInfoServiceImpl extends SuperCacheServiceImpl<WmsAgvInfoMappe
             result = R.fail("回调失败: " + e.getMessage());
             throw new RuntimeException("回调失败: " , e);
         }finally {
-            logAgvCallback(imcsRequestDto, JSON.toJSONString(result), false, null, 0l);
+            logAgvCallback(imcsRequestDto, JSON.toJSONString(result), true, null, 0l);
         }
         return R.success();
     }

+ 26 - 15
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionReadyCenter/TransferTaskOrderMapper.xml

@@ -3,29 +3,40 @@
 <mapper namespace="com.github.zuihou.business.productionReadyCenter.dao.TransferTaskOrderMapper">
 
 
-    <!-- 通用查询结果列:新增 o.id AS orderId(订单ID) -->
-    <sql id="Base_Column_List">
-        o.id AS orderId,  <!-- 新增:订单ID(imcs_o_order表的主键) -->
-        o.order_name AS orderName,
-        o.order_no AS orderNo,
-        o.product_num AS productNum,
-        t.status AS status
+    <sql id="New_Base_Column_List">
+        wtt.id AS transferTaskId,    <!-- 转移任务ID → 实体类 transferTaskId -->
+        itw.bom_name AS bomName,     <!-- BOM名称 → 实体类 bomName -->
+        ioo.order_name AS orderName, <!-- 订单名称 → 原有字段 orderName -->
+        ioo.order_no AS orderNo,     <!-- 订单号 → 原有字段 orderNo -->
+        ioo.product_num AS productNum, <!-- 产品数量 → 原有字段 productNum -->
+        wai.task_no AS agvTaskNo,    <!-- AGV任务号 → 新增字段 agvTaskNo -->
+        wtt.status AS status         <!-- 转移任务状态 → 原有字段 status -->
     </sql>
 
-    <!-- 查询状态为2且未审核的转移任务关联的订单信息 -->
+    <!-- 分页查询:新SQL+原有查询条件 -->
     <select id="findByConditionWithPage"
             parameterType="com.github.zuihou.business.productionReadyCenter.dto.TransferTaskOrderDTO"
             resultType="com.github.zuihou.business.productionReadyCenter.dto.TransferTaskOrderDTO">
-        <!-- 完全复用带条件查询的SQL,分页插件会自动添加LIMIT -->
-        SELECT <include refid="Base_Column_List"/>
-        FROM wms_transfer_task AS t
-        JOIN imcs_o_order AS o ON t.order_id = o.id
+        SELECT <include refid="New_Base_Column_List"/>
+        FROM wms_transfer_task wtt
+        INNER JOIN wms_agv_info wai
+        ON wtt.id = wai.wms_transfer_task_id
+        INNER JOIN wms_agv_info_workpiece waiw
+        ON wai.id = waiw.wms_agv_info_id
+        INNER JOIN imcs_t_workpiece itw
+        ON itw.id = waiw.imcs_t_workpiece_id
+        INNER JOIN imcs_o_order ioo
+        ON wtt.order_id = ioo.id
         WHERE 1=1
+        <!-- 原有查询条件:订单名称模糊查询 -->
         <if test="query.orderName != null and query.orderName != ''">
-            AND o.order_name LIKE CONCAT('%', #{query.orderName}, '%')
+            AND ioo.order_name LIKE CONCAT('%', #{query.orderName}, '%')
         </if>
-            AND t.status = '2'
-        AND t.is_check = '0'
+        <!-- 原有固定条件:状态为2且未审核 -->
+        AND wtt.status = '2'
+        AND wtt.is_check = '0'
+        <!-- 原有分组条件 -->
+        GROUP BY wtt.id
     </select>
 
 </mapper>

+ 29 - 28
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/cutterdata/CutterTestDataController.java

@@ -1,7 +1,9 @@
 package com.github.zuihou.business.controller.cutterdata;
 
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.controller.SuperController;
 import com.github.zuihou.base.request.PageParams;
@@ -25,10 +27,7 @@ import org.apache.commons.vfs2.auth.StaticUserAuthenticator;
 import org.apache.commons.vfs2.impl.DefaultFileSystemConfigBuilder;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 
 import java.io.BufferedReader;
 import java.io.InputStream;
@@ -40,6 +39,7 @@ import java.text.DecimalFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 
 /**
@@ -181,8 +181,8 @@ public class CutterTestDataController extends SuperController<CutterTestDataServ
         cutterTestDataService.saveOrUpdate(entity,
                 Wrappers.<CutterTestDataEntity>lambdaQuery()
                         .eq(CutterTestDataEntity::getCutterName, cutterName)
-                        .eq(CutterTestDataEntity::getFileTime, fileTime)
-                        .eq(CutterTestDataEntity::getCutterTyp, "机外对刀仪")
+//                        .eq(CutterTestDataEntity::getFileTime, fileTime)
+//                        .eq(CutterTestDataEntity::getCutterTyp, "机外对刀仪")
         );
     }
     /**
@@ -203,28 +203,6 @@ public class CutterTestDataController extends SuperController<CutterTestDataServ
         }
     }
 
-//    @ApiOperation(value = "获取机外对刀仪数据", notes = "获取机外对刀仪数据")
-//    @PostMapping("/getCutterPage")
-//    public R<IPage<CutterTestDataEntity>> getCutterPage(@RequestBody @Validated PageParams<CutterTestDataEntity> params) {
-//
-//        IPage<CutterTestDataEntity> page = params.buildPage();
-//
-//        QueryWrap<CutterTestDataEntity> wrap = handlerWrapper(null, params);
-//
-//        LbqWrapper<CutterTestDataEntity> wrapper = wrap.lambda();
-//
-//        wrapper.like(CutterTestDataEntity::getCutterT, params.getModel().getCutterT())
-//                .like(CutterTestDataEntity::getCutterTyp, params.getModel().getCutterTyp())
-//                .like(CutterTestDataEntity::getStatus, params.getModel().getStatus())
-//                .like(CutterTestDataEntity::getCutterP, params.getModel().getCutterP())
-//                .like(CutterTestDataEntity::getCutterPIp, params.getModel().getCutterPIp())
-//                .orderByDesc(CutterTestDataEntity::getUpdateTime);
-//        //查询弹框异常
-//        IPage<CutterTestDataEntity> cutterTestDataDtoIPage = cutterTestDataService.pageList(page, wrapper);
-//
-//        return R.success(cutterTestDataDtoIPage);
-//    }
-
     @ApiOperation(value = "定时查询rfid,根据rfid查询组刀对照的表", notes = "定时查询rfid,根据rfid查询组刀对照的表")
     @PostMapping("/getCutterByRfid")
     public R<CuttingTool> getCutterByRfid(@RequestBody AuthUser authUser) {
@@ -232,5 +210,28 @@ public class CutterTestDataController extends SuperController<CutterTestDataServ
         return cutterTestDataService.getCutterByRfid();
     }
 
+    @ApiOperation(value = "根据ID删除对刀仪数据", notes = "根据ID删除对刀仪数据")
+    @GetMapping("deleteById")
+    public R<Boolean> deleteById(@RequestParam String id) {
+        return R.success(cutterTestDataService.removeById(id));
+    }
+
+    @ApiOperation(value = "根据刀具名查询对刀仪数据", notes = "根据刀具名查询对刀仪数据")
+    @PostMapping("/selectByName")
+    public R<IPage<CutterTestDataEntity>> selectByName(
+            @RequestParam(defaultValue = "1") Integer current,
+            @RequestParam(defaultValue = "10") Integer size,
+            @RequestBody Map<String, Object> map) {
+        // 1. 从入参Map中获取刀具名(允许为空,为空时查全部)
+        String cutterName = map.get("cutterName") != null ? map.get("cutterName").toString() : null;
+        IPage<CutterTestDataEntity> page = new Page<>(current, size);
+        LambdaQueryWrapper<CutterTestDataEntity> queryWrapper = Wrappers.lambdaQuery();
+        if (cutterName != null && !cutterName.trim().isEmpty()) {
+            queryWrapper.like(CutterTestDataEntity::getCutterName, cutterName.trim());
+        }
+        queryWrapper.orderByDesc(CutterTestDataEntity::getUpdateTime);
+        IPage<CutterTestDataEntity> dataList = cutterTestDataService.page(page,queryWrapper);
+        return R.success(dataList);
+    }
 
 }

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

@@ -61,4 +61,13 @@ public class TransferTaskOrderDTO implements Serializable {
     @Length(max = 16, message = "转移任务状态长度不能超过16")
     private String status;
 
+    @ApiModelProperty(value = "转移任务ID(wms_transfer_task.id)")
+    private Long transferTaskId; // 对应 wtt.id
+
+    @ApiModelProperty(value = "BOM名称(imcs_t_workpiece.bom_name)")
+    private String bomName; // 对应 itw.bom_name
+
+    @ApiModelProperty(value = "AGV任务号(wms_agv_info.task_no)")
+    private String agvTaskNo; // 对应 wai.task_no
+
 }