1、禅道#1445问题修复,入参必填校验完善;2、封边系统配置兼容double类型;

This commit is contained in:
gaoqr
2025-04-02 16:17:31 +08:00
parent 62f5cfe303
commit 31d2efd1d4
6 changed files with 15 additions and 7 deletions
@@ -14,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.Valid;
import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.IMPORT; import static com.cf.imes.framework.operatelog.core.enums.OperateTypeEnum.IMPORT;
@@ -33,7 +34,7 @@ public class OrderImportController {
@PostMapping("/webcad/import") @PostMapping("/webcad/import")
@Operation(summary = "webcad拆单导入生产单") @Operation(summary = "webcad拆单导入生产单")
@OperateLog(type = IMPORT) @OperateLog(type = IMPORT)
public CommonResult<Boolean> webCadOrderImport(@RequestBody WebCadDataReqVO webCadDataReqVO) { public CommonResult<Boolean> webCadOrderImport(@RequestBody @Valid WebCadDataReqVO webCadDataReqVO) {
webCadOrderImportService.webCadOrderImport(webCadDataReqVO); webCadOrderImportService.webCadOrderImport(webCadDataReqVO);
return CommonResult.success(true); return CommonResult.success(true);
} }
@@ -3,6 +3,8 @@ package com.cf.imes.module.plan.controller.admin.orderImport.webcad.vo;
import lombok.Data; import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
/** /**
@@ -18,6 +20,7 @@ public class WebCadDataDoubleRoomTreeReqVO {
private Integer count; private Integer count;
@Valid
private List<ChildrenDTO> children; private List<ChildrenDTO> children;
@NoArgsConstructor @NoArgsConstructor
@@ -26,6 +29,7 @@ public class WebCadDataDoubleRoomTreeReqVO {
private String name; private String name;
@NotNull(message = "房间倍数不能为空")
private Integer count; private Integer count;
} }
} }
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
@@ -18,5 +19,6 @@ public class WebCadDataOrderReqVO {
*/ */
@JsonProperty(value = "OrderNo") @JsonProperty(value = "OrderNo")
@NotNull(message = "生产单号不能为空") @NotNull(message = "生产单号不能为空")
@NotEmpty(message = "生产单号不能为空")
private String OrderNo; private String OrderNo;
} }
@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import javax.validation.Valid;
import java.util.List; import java.util.List;
/** /**
@@ -15,6 +16,7 @@ import java.util.List;
public class WebCadDataReqVO { public class WebCadDataReqVO {
@JsonProperty(value = "Orders") @JsonProperty(value = "Orders")
@Valid
private WebCadDataOrderReqVO orders; private WebCadDataOrderReqVO orders;
@JsonProperty(value = "Materials") @JsonProperty(value = "Materials")
@@ -29,7 +31,6 @@ public class WebCadDataReqVO {
@JsonProperty(value = "ProcessGroup") @JsonProperty(value = "ProcessGroup")
private List<WebCadDataProcessGroupReqVO> ProcessGroup; private List<WebCadDataProcessGroupReqVO> ProcessGroup;
@Valid
private List<WebCadDataDoubleRoomTreeReqVO> douleRoomTree; private List<WebCadDataDoubleRoomTreeReqVO> douleRoomTree;
private String orderType;
} }
@@ -288,7 +288,7 @@ public class WebCadOrderImportFactory {
String widthValue = jsonObject.getString("widthValue"); String widthValue = jsonObject.getString("widthValue");
if (StringUtils.isNotEmpty(widthMin) && StringUtils.isNotEmpty(widthMax) && StringUtils.isNotEmpty(widthValue)) { if (StringUtils.isNotEmpty(widthMin) && StringUtils.isNotEmpty(widthMax) && StringUtils.isNotEmpty(widthValue)) {
sealEdgeConfigList.add(new SystemConfigSealEdgeRespDTO(Integer.parseInt(widthMin), Integer.parseInt(widthMax), Integer.parseInt(widthValue))); sealEdgeConfigList.add(new SystemConfigSealEdgeRespDTO(NumberUtil.parseDouble(widthMin), NumberUtil.parseDouble(widthMax), NumberUtil.parseDouble(widthValue)));
} }
} }
} }
@@ -20,15 +20,15 @@ public class SystemConfigSealEdgeRespDTO implements Serializable {
/** /**
* 宽最小值 * 宽最小值
*/ */
private int widthMin; private double widthMin;
/** /**
* 宽最大值 * 宽最大值
*/ */
private int widthMax; private double widthMax;
/** /**
* 宽取值a * 宽取值a
*/ */
private int widthValue; private double widthValue;
} }