1、新增装配设置接口、多语言整理;2、订单部件cadinfo接口部件范围查询错误修复;

This commit is contained in:
gaoqr
2026-02-27 16:05:14 +08:00
parent d825ce8f6d
commit 1fad32a235
31 changed files with 1017 additions and 21 deletions
@@ -0,0 +1,29 @@
package com.cf.imes.module.executor.api.ordercomponent;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.executor.api.ordercomponent.dto.OrderComponentListReqDTO;
import com.cf.imes.module.executor.api.ordercomponent.dto.OrderComponentListRespDTO;
import com.cf.imes.module.executor.enums.ApiConstants;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
/**
*
*
* @author Gqr
* @since 2026/2/25 16:06
*/
@FeignClient(name = ApiConstants.NAME)
@Tag(name = "RPC 服务 - 部件管理")
public interface OrderComponentApi {
String PREFIX = ApiConstants.PREFIX + "/order/component";
@PostMapping(PREFIX + "/list")
@Operation(summary = "获取生产单下的部件列表")
CommonResult<List<OrderComponentListRespDTO>> getOrderComponentList(@RequestBody OrderComponentListReqDTO dto);
}
@@ -0,0 +1,22 @@
package com.cf.imes.module.executor.api.ordercomponent.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
*
*
* @author Gqr
* @since 2026/2/25 16:18
*/
@Schema(description = "RPC 服务 - 部件管理 - 生产单部件列表查询 - Request DTO")
@Data
public class OrderComponentListReqDTO implements Serializable {
private static final long serialVersionUID = -5691595836226548840L;
@Schema(description = "生产单编号列表", requiredMode = Schema.RequiredMode.REQUIRED, example = "[1,2,3,4]")
private List<Long> orderIds;
}
@@ -0,0 +1,30 @@
package com.cf.imes.module.executor.api.ordercomponent.dto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
*
*
* @author Gqr
* @since 2026/2/25 16:18
*/
@Schema(description = "RPC 服务 - 部件管理 - 生产单部件列表查询 - Response DTO")
@Data
public class OrderComponentListRespDTO implements Serializable {
private static final long serialVersionUID = -5691595836226548840L;
@Schema(description = "父ID")
private Long pid;
@Schema(description = "部件Id")
private Long id;
@Schema(description = "部件名")
private String name;
private List<OrderComponentListRespDTO> children;
}
@@ -0,0 +1,31 @@
package com.cf.imes.module.executor.api.ordercomponent;
import cn.hutool.core.bean.BeanUtil;
import com.cf.imes.framework.common.pojo.CommonResult;
import com.cf.imes.module.executor.api.ordercomponent.dto.OrderComponentListReqDTO;
import com.cf.imes.module.executor.api.ordercomponent.dto.OrderComponentListRespDTO;
import com.cf.imes.module.executor.controller.admin.ordercomponent.vo.OrderComponentRespVO;
import com.cf.imes.module.executor.service.ordercomponent.OrderComponentService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
*
*
* @author Gqr
* @since 2026/2/25 16:26
*/
@RestController // 提供 RESTful API 接口,给 Feign 调用
public class OrderComponentApiImpl implements OrderComponentApi {
@Resource
private OrderComponentService orderComponentService;
@Override
public CommonResult<List<OrderComponentListRespDTO>> getOrderComponentList(OrderComponentListReqDTO dto) {
List<OrderComponentRespVO> orderComponentListOnOrders = orderComponentService.getOrderComponentListOnOrders(dto.getOrderIds());
return CommonResult.success(BeanUtil.copyToList(orderComponentListOnOrders, OrderComponentListRespDTO.class));
}
}
@@ -22,4 +22,7 @@ public class OrderComponentRespVO {
@Schema(description = "CAD图纸文件哈希值")
private String fileHash;
@Schema(description = "加工状态")
private Integer processStatus;
}
@@ -66,4 +66,22 @@ public class OrderViewPlatePageRespVO {
@Schema(description = "CAD设计板编号")
private String customNumber;
@Schema(description = "面积")
private BigDecimal area;
@Schema(description = "纹理")
private Integer texture;
@Schema(description = "是否造型")
private Boolean isSculpt;
@Schema(description = "是否异形")
private Boolean isSpecialShaped;
@Schema(description = "是否排孔")
private Boolean isRowHole;
@Schema(description = "备注")
private String remark;
}
@@ -96,4 +96,34 @@ public class OrderBodyViewPlatesPageDO {
* cad图纸文件id
*/
private Long cadViewFileId;
/**
* 面积
*/
private BigDecimal area;
/**
* 纹理
*/
private Integer texture;
/**
* 是否造型
*/
private Boolean isSculpt;
/**
* 是否异形
*/
private Boolean isSpecialShaped;
/**
* 是否排孔
*/
private Boolean isRowHole;
/**
* 备注
*/
private String remark;
}
@@ -67,4 +67,12 @@ public interface OrderComponentService {
* @param id
*/
void restoreOrderComponent(Long orderId, Long id);
/**
* 查询订单列表下所有部件
*
* @param orderIds
* @return
*/
List<OrderComponentRespVO> getOrderComponentListOnOrders(List<Long> orderIds);
}
@@ -256,9 +256,12 @@ public class OrderComponentServiceImpl implements OrderComponentService {
.in(OrderComponentDO::getTopId, topIds)
.eq(OrderComponentDO::getOrderId, orderId)
.eqIfPresent(OrderComponentDO::getDeleted, pageReqVO.isDeleted())
.select(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId));
.select(OrderComponentDO::getId, OrderComponentDO::getCadViewFileId, OrderComponentDO::getPid));
Set<Long> queryComponentIds = new HashSet<>();
if (CollUtil.isNotEmpty(orderComponentDOS)) {
componentIds = orderComponentDOS.stream().map(OrderComponentDO::getId).collect(Collectors.toSet());
for (OrderComponentDO co : componentDOS) {
queryComponentIds.addAll(getChildrenIds(co, orderComponentDOS));
}
} else {
return Collections.emptyList();
}
@@ -573,13 +576,13 @@ public class OrderComponentServiceImpl implements OrderComponentService {
return needDeleteIds;
}
// @Override
// public List<OrderComponentRespVO> getOrderComponentListOnOrders(List<Long> orderIds) {
// List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapper<OrderComponentDO>()
// .in(OrderComponentDO::getOrderId, orderIds)
// .eq(OrderComponentDO::getDeleted, false)
// .eq(OrderComponentDO::getOrganId, SecurityFrameworkUtils.getUserOrganId())
// .select(OrderComponentDO::getId, OrderComponentDO::getName, OrderComponentDO::getPid));
// return BeanUtil.copyToList(orderComponentDOS, OrderComponentRespVO.class);
// }
@Override
public List<OrderComponentRespVO> getOrderComponentListOnOrders(List<Long> orderIds) {
List<OrderComponentDO> orderComponentDOS = orderComponentMapper.selectList(new LambdaQueryWrapper<OrderComponentDO>()
.in(OrderComponentDO::getOrderId, orderIds)
.eq(OrderComponentDO::getDeleted, false)
.eq(OrderComponentDO::getOrganId, SecurityFrameworkUtils.getUserOrganId())
.select(OrderComponentDO::getId, OrderComponentDO::getName, OrderComponentDO::getPid));
return BeanUtil.copyToList(orderComponentDOS, OrderComponentRespVO.class);
}
}
@@ -536,9 +536,14 @@
<select id="selectBodyViewPlatesPage" resultType="com.cf.imes.module.executor.dal.dataobject.orderItem.OrderBodyViewPlatesPageDO">
SELECT p.plate_no, p.name, p.width, p.height, p.thickness, g.material, g.color, p.cad_plate_no as customNumber, p.id, i.body_id, p.cad_view_id
<if test="cadView">
<choose>
<when test="cadView">
, p.seal_left, p.seal_down, p.seal_right, p.seal_up
</if>
</when>
<otherwise>
, p.area, p.texture, p.is_special_shaped, p.is_sculpt, p.is_row_hole, p.remark
</otherwise>
</choose>
<if test="componentIds != null and componentIds.size() > 0">
, i.comp_id
</if>