mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 12:52:07 +08:00
贴皮分解接口校验完整性修复
This commit is contained in:
+2
@@ -212,6 +212,8 @@ public class ErrorCodeConstants {
|
|||||||
public static final ErrorCode VENEER_PLAN_PLATE_STATUS_CHANGED = new ErrorCode(1_003_009_050, "veneer.plan.plate.status.changed");
|
public static final ErrorCode VENEER_PLAN_PLATE_STATUS_CHANGED = new ErrorCode(1_003_009_050, "veneer.plan.plate.status.changed");
|
||||||
public static final ErrorCode VENEER_DECOMPOSE_RECORD_INSERT_FAILED = new ErrorCode(1_003_009_051, "veneer.decompose.record.insert.failed");
|
public static final ErrorCode VENEER_DECOMPOSE_RECORD_INSERT_FAILED = new ErrorCode(1_003_009_051, "veneer.decompose.record.insert.failed");
|
||||||
public static final ErrorCode VENEER_DECOMPOSE_PLATE_SIZE_INVALID = new ErrorCode(1_003_009_052, "veneer.decompose.plate.size.invalid");
|
public static final ErrorCode VENEER_DECOMPOSE_PLATE_SIZE_INVALID = new ErrorCode(1_003_009_052, "veneer.decompose.plate.size.invalid");
|
||||||
|
public static final ErrorCode VENEER_DECOMPOSE_ORDER_IDS_REQUIRED = new ErrorCode(1_003_009_053, "veneer.decompose.order.ids.required");
|
||||||
|
public static final ErrorCode VENEER_DECOMPOSE_GOODS_IDS_REQUIRED = new ErrorCode(1_003_009_054, "veneer.decompose.goods.ids.required");
|
||||||
|
|
||||||
//=========== 部件管理 1-003-010-000 ============
|
//=========== 部件管理 1-003-010-000 ============
|
||||||
public static final ErrorCode ORDER_COMPONENT_NOT_EXIST = new ErrorCode(1_003_010_000, "order.component.not.exist");
|
public static final ErrorCode ORDER_COMPONENT_NOT_EXIST = new ErrorCode(1_003_010_000, "order.component.not.exist");
|
||||||
|
|||||||
+11
-6
@@ -1,10 +1,11 @@
|
|||||||
package com.cf.imes.module.executor.controller.admin.veneer.vo;
|
package com.cf.imes.module.executor.controller.admin.veneer.vo;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import jakarta.validation.constraints.DecimalMin;
|
import jakarta.validation.constraints.DecimalMin;
|
||||||
|
import jakarta.validation.constraints.NotBlank;
|
||||||
import jakarta.validation.constraints.NotEmpty;
|
import jakarta.validation.constraints.NotEmpty;
|
||||||
|
import jakarta.validation.constraints.NotNull;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -16,15 +17,19 @@ import java.util.List;
|
|||||||
@Data
|
@Data
|
||||||
public class VeneerDecomposeCreateReqVO {
|
public class VeneerDecomposeCreateReqVO {
|
||||||
|
|
||||||
@Schema(description = "订单ID列表;非空时按订单范围分解")
|
@Schema(description = "是否按订单分解", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "{veneer.decompose.mode.required}")
|
||||||
|
private Boolean byOrder;
|
||||||
|
|
||||||
|
@Schema(description = "订单ID列表;按订单分解时必填")
|
||||||
private List<Long> orderIds;
|
private List<Long> orderIds;
|
||||||
|
|
||||||
@Schema(description = "板材商品编码;orderIds为空时必填")
|
@Schema(description = "板材商品编码列表;按材质分解时必填")
|
||||||
private String goodsId;
|
private List<String> goodsIds;
|
||||||
|
|
||||||
@Schema(description = "原板件编号列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
@Schema(description = "原板件编号列表", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
@NotEmpty(message = "{veneer.decompose.plate.no.required}")
|
@NotEmpty(message = "{veneer.decompose.plate.no.required}")
|
||||||
private List<String> plateNos;
|
private List<@NotBlank(message = "{veneer.decompose.plate.no.required}") String> plateNos;
|
||||||
|
|
||||||
@Schema(description = "A面贴皮库ID")
|
@Schema(description = "A面贴皮库ID")
|
||||||
@JsonProperty("aVeneerId")
|
@JsonProperty("aVeneerId")
|
||||||
@@ -44,6 +49,6 @@ public class VeneerDecomposeCreateReqVO {
|
|||||||
* @return {@code true} 表示按订单范围分解,{@code false} 表示按板材范围分解
|
* @return {@code true} 表示按订单范围分解,{@code false} 表示按板材范围分解
|
||||||
*/
|
*/
|
||||||
public boolean isByOrder() {
|
public boolean isByOrder() {
|
||||||
return CollUtil.isNotEmpty(orderIds);
|
return Boolean.TRUE.equals(byOrder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+29
-5
@@ -51,10 +51,11 @@ import java.util.Set;
|
|||||||
import static com.cf.imes.framework.common.pojo.PageParam.PAGE_SIZE_NONE;
|
import static com.cf.imes.framework.common.pojo.PageParam.PAGE_SIZE_NONE;
|
||||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.GOODS_PLATE_UPDATE_CONCURRENCY_ERROR;
|
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.GOODS_PLATE_UPDATE_CONCURRENCY_ERROR;
|
||||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_PLATE_UPDATE_CONCURRENCY_ERROR;
|
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.ORDER_PLATE_UPDATE_CONCURRENCY_ERROR;
|
||||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_PLATE_STATUS_CHANGED;
|
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_GOODS_IDS_REQUIRED;
|
||||||
|
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_ORDER_IDS_REQUIRED;
|
||||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_PLATE_SIZE_INVALID;
|
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_PLATE_SIZE_INVALID;
|
||||||
|
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_PLATE_STATUS_CHANGED;
|
||||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_RECORD_INSERT_FAILED;
|
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_RECORD_INSERT_FAILED;
|
||||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_SCOPE_REQUIRED;
|
|
||||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_SIDE_REQUIRED;
|
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_DECOMPOSE_SIDE_REQUIRED;
|
||||||
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_NOT_EXIST;
|
import static com.cf.imes.module.executor.enums.ErrorCodeConstants.VENEER_NOT_EXIST;
|
||||||
|
|
||||||
@@ -243,9 +244,32 @@ public class VeneerDecomposeServiceImpl implements VeneerDecomposeService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void decompose(VeneerDecomposeCreateReqVO req) {
|
public void decompose(VeneerDecomposeCreateReqVO req) {
|
||||||
// orderIds 非空表示按订单分解;否则必须指定板材商品编码。
|
// 根据前端选择的入口规范化查询范围,并校验对应范围参数不能为空。
|
||||||
if (!req.isByOrder() && (req.getGoodsId() == null || req.getGoodsId().isBlank())) {
|
if (req.isByOrder()) {
|
||||||
throw new ServiceException(VENEER_DECOMPOSE_SCOPE_REQUIRED);
|
List<Long> orderIds = req.getOrderIds() == null
|
||||||
|
? List.of()
|
||||||
|
: req.getOrderIds().stream()
|
||||||
|
.filter(id -> id != null)
|
||||||
|
.distinct()
|
||||||
|
.sorted()
|
||||||
|
.toList();
|
||||||
|
if (CollUtil.isEmpty(orderIds)) {
|
||||||
|
throw new ServiceException(VENEER_DECOMPOSE_ORDER_IDS_REQUIRED);
|
||||||
|
}
|
||||||
|
req.setOrderIds(orderIds);
|
||||||
|
} else {
|
||||||
|
List<String> goodsIds = req.getGoodsIds() == null
|
||||||
|
? List.of()
|
||||||
|
: req.getGoodsIds().stream()
|
||||||
|
.filter(StrUtil::isNotBlank)
|
||||||
|
.map(String::trim)
|
||||||
|
.distinct()
|
||||||
|
.sorted()
|
||||||
|
.toList();
|
||||||
|
if (CollUtil.isEmpty(goodsIds)) {
|
||||||
|
throw new ServiceException(VENEER_DECOMPOSE_GOODS_IDS_REQUIRED);
|
||||||
|
}
|
||||||
|
req.setGoodsIds(goodsIds);
|
||||||
}
|
}
|
||||||
// A、B 面允许分别选择贴皮,但至少需要选择一面。
|
// A、B 面允许分别选择贴皮,但至少需要选择一面。
|
||||||
if (req.getAVeneerId() == null && req.getBVeneerId() == null) {
|
if (req.getAVeneerId() == null && req.getBVeneerId() == null) {
|
||||||
|
|||||||
+6
-3
@@ -286,7 +286,7 @@
|
|||||||
op.thickness,
|
op.thickness,
|
||||||
op.hole_arrange AS holeArrange
|
op.hole_arrange AS holeArrange
|
||||||
FROM order_plate op
|
FROM order_plate op
|
||||||
<if test="req.orderIds == null or req.orderIds.size() == 0">
|
<if test="req.byOrder == false">
|
||||||
JOIN order_goods og ON og.order_id = op.order_id
|
JOIN order_goods og ON og.order_id = op.order_id
|
||||||
AND og.id = op.goods_id
|
AND og.id = op.goods_id
|
||||||
</if>
|
</if>
|
||||||
@@ -297,14 +297,17 @@
|
|||||||
#{plateNo}
|
#{plateNo}
|
||||||
</foreach>
|
</foreach>
|
||||||
<choose>
|
<choose>
|
||||||
<when test="req.orderIds != null and req.orderIds.size() > 0">
|
<when test="req.byOrder == true">
|
||||||
AND op.order_id IN
|
AND op.order_id IN
|
||||||
<foreach collection="req.orderIds" item="orderId" open="(" close=")" separator=",">
|
<foreach collection="req.orderIds" item="orderId" open="(" close=")" separator=",">
|
||||||
#{orderId}
|
#{orderId}
|
||||||
</foreach>
|
</foreach>
|
||||||
</when>
|
</when>
|
||||||
<otherwise>
|
<otherwise>
|
||||||
AND og.goods_id = #{req.goodsId}
|
AND og.goods_id IN
|
||||||
|
<foreach collection="req.goodsIds" item="goodsId" open="(" close=")" separator=",">
|
||||||
|
#{goodsId}
|
||||||
|
</foreach>
|
||||||
</otherwise>
|
</otherwise>
|
||||||
</choose>
|
</choose>
|
||||||
ORDER BY op.id
|
ORDER BY op.id
|
||||||
|
|||||||
+4
-1
@@ -70,11 +70,14 @@ plate.is.source=小板:{0} 為來源板,無法刪除
|
|||||||
plate.attr.group.exists=名稱、材質、顏色、厚度、品牌組合已存在,請檢查後提交
|
plate.attr.group.exists=名稱、材質、顏色、厚度、品牌組合已存在,請檢查後提交
|
||||||
|
|
||||||
veneer.not.exist=貼皮不存在
|
veneer.not.exist=貼皮不存在
|
||||||
veneer.decompose.scope.required=訂單ID列表和板材商品編碼不能同時為空
|
veneer.decompose.scope.required=訂單ID列表和板材商品編碼列表不能同時為空
|
||||||
veneer.decompose.side.required=A面和B面貼皮至少選擇一個
|
veneer.decompose.side.required=A面和B面貼皮至少選擇一個
|
||||||
veneer.decompose.plate.status.changed=板件分解狀態已變更,請重新整理後再試
|
veneer.decompose.plate.status.changed=板件分解狀態已變更,請重新整理後再試
|
||||||
veneer.decompose.record.insert.failed=貼皮分解記錄生成失敗,請重新整理後再試
|
veneer.decompose.record.insert.failed=貼皮分解記錄生成失敗,請重新整理後再試
|
||||||
veneer.decompose.plate.size.invalid=板件{0}的長寬或外擴餘量異常,無法生成貼皮
|
veneer.decompose.plate.size.invalid=板件{0}的長寬或外擴餘量異常,無法生成貼皮
|
||||||
|
veneer.decompose.mode.required=請選擇貼皮分解模式
|
||||||
|
veneer.decompose.order.ids.required=按訂單分解時,訂單ID列表不能為空
|
||||||
|
veneer.decompose.goods.ids.required=按材質分解時,板材商品編碼列表不能為空
|
||||||
veneer.decompose.plate.no.required=板件編號不能為空
|
veneer.decompose.plate.no.required=板件編號不能為空
|
||||||
veneer.decompose.outer.margin.min=外擴餘量不能小於0
|
veneer.decompose.outer.margin.min=外擴餘量不能小於0
|
||||||
veneer.reselect.record.required=請選擇需要重選貼皮的資料
|
veneer.reselect.record.required=請選擇需要重選貼皮的資料
|
||||||
|
|||||||
+4
-1
@@ -70,11 +70,14 @@ plate.is.source=Plate {0} is a source plate and cannot be deleted
|
|||||||
plate.attr.group.exists=Combination of name, material, color, thickness, and brand already exists
|
plate.attr.group.exists=Combination of name, material, color, thickness, and brand already exists
|
||||||
|
|
||||||
veneer.not.exist=veneer not exist
|
veneer.not.exist=veneer not exist
|
||||||
veneer.decompose.scope.required=Order ID list and goods code cannot both be empty
|
veneer.decompose.scope.required=Order ID list and goods code list cannot both be empty
|
||||||
veneer.decompose.side.required=At least one veneer must be selected for side A or B
|
veneer.decompose.side.required=At least one veneer must be selected for side A or B
|
||||||
veneer.decompose.plate.status.changed=Plate decomposition status has changed. Please refresh and retry
|
veneer.decompose.plate.status.changed=Plate decomposition status has changed. Please refresh and retry
|
||||||
veneer.decompose.record.insert.failed=Failed to create veneer decomposition records. Please refresh and retry
|
veneer.decompose.record.insert.failed=Failed to create veneer decomposition records. Please refresh and retry
|
||||||
veneer.decompose.plate.size.invalid=Plate {0} has invalid dimensions or outer margin and cannot generate veneer
|
veneer.decompose.plate.size.invalid=Plate {0} has invalid dimensions or outer margin and cannot generate veneer
|
||||||
|
veneer.decompose.mode.required=Please select a veneer decomposition mode
|
||||||
|
veneer.decompose.order.ids.required=Order ID list is required when decomposing by order
|
||||||
|
veneer.decompose.goods.ids.required=Goods code list is required when decomposing by material
|
||||||
veneer.decompose.plate.no.required=Plate numbers cannot be empty
|
veneer.decompose.plate.no.required=Plate numbers cannot be empty
|
||||||
veneer.decompose.outer.margin.min=Outer margin cannot be less than 0
|
veneer.decompose.outer.margin.min=Outer margin cannot be less than 0
|
||||||
veneer.reselect.record.required=Please select records for veneer reselection
|
veneer.reselect.record.required=Please select records for veneer reselection
|
||||||
|
|||||||
+4
-1
@@ -70,11 +70,14 @@ plate.is.source=小板:{0} 为源小板,无法删除
|
|||||||
plate.attr.group.exists=当前名称、材质、颜色、厚度、品牌的组合已存在,请检查后提交
|
plate.attr.group.exists=当前名称、材质、颜色、厚度、品牌的组合已存在,请检查后提交
|
||||||
|
|
||||||
veneer.not.exist=贴皮不存在
|
veneer.not.exist=贴皮不存在
|
||||||
veneer.decompose.scope.required=订单ID列表和板材商品编码不能同时为空
|
veneer.decompose.scope.required=订单ID列表和板材商品编码列表不能同时为空
|
||||||
veneer.decompose.side.required=A面和B面贴皮至少选择一个
|
veneer.decompose.side.required=A面和B面贴皮至少选择一个
|
||||||
veneer.decompose.plate.status.changed=板件分解状态已变更,请刷新后重试
|
veneer.decompose.plate.status.changed=板件分解状态已变更,请刷新后重试
|
||||||
veneer.decompose.record.insert.failed=贴皮分解记录生成失败,请刷新后重试
|
veneer.decompose.record.insert.failed=贴皮分解记录生成失败,请刷新后重试
|
||||||
veneer.decompose.plate.size.invalid=板件{0}的长宽或外扩余量异常,无法生成贴皮
|
veneer.decompose.plate.size.invalid=板件{0}的长宽或外扩余量异常,无法生成贴皮
|
||||||
|
veneer.decompose.mode.required=请选择贴皮分解模式
|
||||||
|
veneer.decompose.order.ids.required=按订单分解时,订单ID列表不能为空
|
||||||
|
veneer.decompose.goods.ids.required=按材质分解时,板材商品编码列表不能为空
|
||||||
veneer.decompose.plate.no.required=板件编号不能为空
|
veneer.decompose.plate.no.required=板件编号不能为空
|
||||||
veneer.decompose.outer.margin.min=外扩余量不能小于0
|
veneer.decompose.outer.margin.min=外扩余量不能小于0
|
||||||
veneer.reselect.record.required=请选择需要重选贴皮的数据
|
veneer.reselect.record.required=请选择需要重选贴皮的数据
|
||||||
|
|||||||
Reference in New Issue
Block a user