mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 12:52:07 +08:00
Merge branch 'main' of ssh://192.168.1.205:9922/cf_devdept2/cf_imes_server
This commit is contained in:
-1
@@ -9,7 +9,6 @@ import lombok.Getter;
|
||||
public enum OrderPackageStatusEnum {
|
||||
|
||||
UNPACKED(0,"未封包/未打包"),
|
||||
PACKAGING(1, "封包中/打包中"),
|
||||
PACKAGED(1, "已封包/已打包");
|
||||
|
||||
private Integer status;
|
||||
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.cf.imes.framework.common.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PlanTypeEnum {
|
||||
|
||||
MIXEDORDERPLAN(1, "混单排单"),
|
||||
|
||||
ORDERPLAN(2, "生产单排单");
|
||||
|
||||
private Integer type;
|
||||
private String scheduling;
|
||||
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.type .equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(PlanTypeEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.type .equals(this.getType()) ;
|
||||
}
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
package com.cf.imes.framework.common.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
/**
|
||||
* @author 板材排孔类型枚举类
|
||||
*/
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PlatePlaceHoleEnum {
|
||||
|
||||
|
||||
FRONT(0, "正面"),
|
||||
BACK(1, "反面"),
|
||||
RANDOMFACE(2, "随意面");
|
||||
|
||||
private final Integer placeHole;
|
||||
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.placeHole.equals(status) ;
|
||||
}
|
||||
|
||||
|
||||
public boolean equals(PlatePlaceHoleEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.placeHole .equals(this.getPlaceHole()) ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.framework.common.enums;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum PlateTextureEnum {
|
||||
|
||||
|
||||
POSITIVEPATTERN(0, "正纹"),
|
||||
ROTATABLE(1, "可翻转"),
|
||||
REVERSEPATTERN(2, "反纹");
|
||||
|
||||
private final Integer texture;
|
||||
private String description;
|
||||
|
||||
public boolean equals(Integer status) {
|
||||
return this.texture.equals(status) ;
|
||||
}
|
||||
|
||||
public boolean equals(PlateTextureEnum enableStatusEnum) {
|
||||
return enableStatusEnum != null && enableStatusEnum.texture .equals(this.getTexture()) ;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
+1
@@ -36,6 +36,7 @@ public class GlobalErrorCodeConstants {
|
||||
// ES文档删除失败
|
||||
public static final ErrorCode ES_ERROR_DELETE = new ErrorCode(504, "数据异常,请勿点击过快,请稍等再试");
|
||||
public static final ErrorCode DATA_EXCEPTION_ERROR = new ErrorCode(505, "数据异常,请联系客服处理");
|
||||
public static final ErrorCode DATA_DATA_ERROR = new ErrorCode(506, "文档数据异常,请稍后重试或联系客服处理");
|
||||
|
||||
// ========== 自定义错误段 ==========
|
||||
public static final ErrorCode REPEATED_REQUESTS = new ErrorCode(900, "重复请求,请稍后重试"); // 重复请求
|
||||
|
||||
+3
-3
@@ -15,7 +15,7 @@ import java.text.DecimalFormat;
|
||||
public class NumberValidator implements ConstraintValidator<NumberValid, Number> {
|
||||
private static final String ZERO = "0";
|
||||
|
||||
private static final String GREATER_THAN_ZERO_NOTIFICATION = "%s必须大于等于0";
|
||||
private static final String GREATER_THAN_ZERO_NOTIFICATION = "%s必须大于0";
|
||||
|
||||
private static final String FLOAT_NUMBER_LENGTH_ERROR_NOTIFICATION = "%s长度不合法,总长度不超过8位,小数点后不超过3位";
|
||||
|
||||
@@ -92,7 +92,7 @@ public class NumberValidator implements ConstraintValidator<NumberValid, Number>
|
||||
* @return
|
||||
*/
|
||||
private String handleDouble(Double value) {
|
||||
if (value <= Double.parseDouble(ZERO)) {
|
||||
if (value < Double.parseDouble(ZERO)) {
|
||||
return String.format(GREATER_THAN_ZERO_NOTIFICATION, name);
|
||||
}
|
||||
// 处理科学计数法,保留小数点后四位
|
||||
@@ -122,7 +122,7 @@ public class NumberValidator implements ConstraintValidator<NumberValid, Number>
|
||||
* @return
|
||||
*/
|
||||
private String handleBigDecimal(BigDecimal value) {
|
||||
if (value.compareTo(BigDecimal.ZERO) <= 0) {
|
||||
if (value.compareTo(BigDecimal.ZERO) < 0) {
|
||||
return String.format(GREATER_THAN_ZERO_NOTIFICATION, name);
|
||||
}
|
||||
|
||||
|
||||
-15
@@ -5,7 +5,6 @@ import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Contact;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
import io.swagger.v3.oas.models.info.License;
|
||||
import io.swagger.v3.oas.models.media.IntegerSchema;
|
||||
import io.swagger.v3.oas.models.media.StringSchema;
|
||||
import io.swagger.v3.oas.models.parameters.Parameter;
|
||||
import io.swagger.v3.oas.models.security.SecurityRequirement;
|
||||
@@ -118,24 +117,10 @@ public class ChenfengSwaggerAutoConfiguration {
|
||||
.group(group)
|
||||
.pathsToMatch("/admin-api/" + path + "/**", "/app-api/" + path + "/**")
|
||||
.addOperationCustomizer((operation, handlerMethod) -> operation
|
||||
.addParametersItem(buildTenantHeaderParameter())
|
||||
.addParametersItem(buildSecurityHeaderParameter()))
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建 Tenant 组织编号请求头参数
|
||||
*
|
||||
* @return 多组织参数
|
||||
*/
|
||||
private static Parameter buildTenantHeaderParameter() {
|
||||
return new Parameter()
|
||||
.name(HEADER_ORGAN_ID) // header 名
|
||||
.description("组织编号") // 描述
|
||||
.in(String.valueOf(SecurityScheme.In.HEADER)) // 请求 header
|
||||
.schema(new IntegerSchema()._default(1L).name(HEADER_ORGAN_ID).description("组织编号")); // 默认:使用组织编号为 1
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建 Authorization 认证请求头参数
|
||||
*
|
||||
|
||||
+14
-4
@@ -15,6 +15,7 @@ import com.cf.imes.framework.common.util.servlet.ServletUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.dao.DuplicateKeyException;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
import org.springframework.security.access.AccessDeniedException;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.validation.BindException;
|
||||
@@ -88,9 +89,11 @@ public class GlobalExceptionHandler {
|
||||
return serviceExceptionHandler((ServiceException) ex);
|
||||
}
|
||||
if (ex instanceof AccessDeniedException) {
|
||||
ex.printStackTrace();
|
||||
return accessDeniedExceptionHandler(request, (AccessDeniedException) ex);
|
||||
}
|
||||
if (ex instanceof HttpMessageNotReadableException) {
|
||||
return httpMessageNotReadableExceptionHandler(request, (HttpMessageNotReadableException) ex);
|
||||
}
|
||||
return defaultExceptionHandler(request, ex);
|
||||
}
|
||||
|
||||
@@ -113,7 +116,7 @@ public class GlobalExceptionHandler {
|
||||
@ExceptionHandler(MethodArgumentTypeMismatchException.class)
|
||||
public CommonResult methodArgumentTypeMismatchExceptionHandler(MethodArgumentTypeMismatchException ex) {
|
||||
log.warn("[missingServletRequestParameterExceptionHandler]", ex);
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数类型错误:%s", ex.getMessage()));
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数类型错误,%s:%s", ex.getName(), ex.getValue()));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -136,10 +139,11 @@ public class GlobalExceptionHandler {
|
||||
FieldError fieldError = ex.getFieldError();
|
||||
assert fieldError != null; // 断言,避免告警
|
||||
String defaultMessage = fieldError.getDefaultMessage();
|
||||
if (CharSequenceUtil.isNotEmpty(defaultMessage)) {
|
||||
// 如果是校验器来的给出校验注解的提示
|
||||
if (CharSequenceUtil.isNotEmpty(defaultMessage) && fieldError.contains(ConstraintViolation.class)) {
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数不正确:%s", defaultMessage));
|
||||
} else {
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数不正确:%s", fieldError.getRejectedValue()));
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), String.format("请求参数不正确,%s:%s", fieldError.getField(), fieldError.getRejectedValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,6 +211,12 @@ public class GlobalExceptionHandler {
|
||||
return CommonResult.error(FORBIDDEN);
|
||||
}
|
||||
|
||||
@ExceptionHandler(value = HttpMessageNotReadableException.class)
|
||||
public CommonResult httpMessageNotReadableExceptionHandler(HttpServletRequest req, HttpMessageNotReadableException ex) {
|
||||
log.warn("[httpMessageNotReadableExceptionHandler]", ex);
|
||||
return CommonResult.error(BAD_REQUEST.getCode(), "请求参数不合法");
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理业务异常 ServiceException
|
||||
*
|
||||
|
||||
+6
-2
@@ -1,11 +1,11 @@
|
||||
package com.cf.imes.module.executor.controller.admin.order.vo.order;
|
||||
|
||||
import com.cf.imes.module.executor.validation.order.OrderStatusValid;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@@ -46,21 +46,25 @@ public class OrderPageReqVO extends PageParam {
|
||||
private Integer dataType;
|
||||
|
||||
@Schema(description = "订单状态,订单状态,0空订单1新单2生产中3生产完成", example = "1")
|
||||
@OrderStatusValid
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "自定义单号")
|
||||
@Length(max = 32, message = "自定义单号长度不能超过32")
|
||||
private String customOrderNo;
|
||||
|
||||
@Schema(description = "客户")
|
||||
private String customer;
|
||||
|
||||
@Schema(description = "客户地址")
|
||||
@Length(max = 255, message = "收货地址长度不能超过255")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "客户电话")
|
||||
private String phoneNumber;
|
||||
|
||||
@Schema(description = "经销商")
|
||||
@Length(max = 255, message = "经销商长度不能超过255")
|
||||
private String dealer;
|
||||
|
||||
@Schema(description = "经销商电话")
|
||||
|
||||
+5
-2
@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -61,7 +62,8 @@ public class OptimizePlanController {
|
||||
@Parameter(name = "goodsNo", description = "开料的大板编号", required = true, example = "1")
|
||||
})
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:optimize')")
|
||||
public CommonResult<Boolean> commit(@RequestParam("planId") Long planId,@RequestParam("goodsNo") List<Long> goodsNo) {
|
||||
public CommonResult<Boolean> commit(@RequestParam("planId") @NotNull(message = "排单ID不能为空") Long planId,
|
||||
@RequestParam("goodsNo") @NotEmpty(message = "开料大板编号不能为空") List<Long> goodsNo) {
|
||||
|
||||
return CommonResult.success(optimizePlanService.commit(planId,goodsNo));
|
||||
}
|
||||
@@ -89,7 +91,8 @@ public class OptimizePlanController {
|
||||
public CommonResult<OrderSource> getOrderSource(@Schema(description = "生产单id") @RequestParam(required = false) Long orderId,
|
||||
@Schema(description = "大板IDS-大板分类的IDS") @RequestParam(required = false) List<Long> ids,
|
||||
@Schema(description = "排单id") @RequestParam(required = false) Long planId,
|
||||
@Schema(description = "机台Id") @RequestParam("machineId") Long machineId
|
||||
@Schema(description = "机台Id")
|
||||
@NotNull(message = "当前排单对应的机台为空,请检查机台信息或重新选择机台") @RequestParam("machineId") Long machineId
|
||||
) {
|
||||
return CommonResult.success(optimizePlanService.getOrderSource(orderId, planId, machineId,ids));
|
||||
|
||||
|
||||
+6
-4
@@ -25,6 +25,8 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -60,7 +62,7 @@ public class PlanController {
|
||||
@Operation(summary = "删除排单")
|
||||
@Parameter(name = "ids", description = "排单ids", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:delete')")
|
||||
public CommonResult<Boolean> deletePlan(@RequestParam("ids") List<Long> ids) {
|
||||
public CommonResult<Boolean> deletePlan(@RequestParam("ids") @NotEmpty @Size(max = 20,message = "最多可同时删除20个排单") List<Long> ids) {
|
||||
return success(planService.deletePlan(ids));
|
||||
}
|
||||
|
||||
@@ -69,7 +71,7 @@ public class PlanController {
|
||||
@Operation(summary = "获得排单")
|
||||
@Parameter(name = "id", description = "排单id", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:query')")
|
||||
public CommonResult<PlanRespVO> getPlan(@RequestParam("id") Long id) {
|
||||
public CommonResult<PlanRespVO> getPlan(@RequestParam("id") @NotNull(message = "排单数据异常,请重新操作") Long id) {
|
||||
PlanRespVO plan = planService.getPlan(id);
|
||||
return success(BeanUtils.toBean(plan, PlanRespVO.class));
|
||||
}
|
||||
@@ -182,9 +184,9 @@ public class PlanController {
|
||||
|
||||
@GetMapping("getPlateList")
|
||||
@Operation(summary = "根据排单ID获取板材列表(未分页)")
|
||||
@Parameter(name = "planIds", description = "排单id", required = true, example = "1024")
|
||||
@Parameter(name = "planIds", description = "排单id", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('placeorder:orderlist')")
|
||||
public CommonResult<List<PlateResList>> getPlateList(@Valid @RequestParam("planIds") List<Long> planIds) {
|
||||
public CommonResult<List<PlateResList>> getPlateList(@Valid @RequestParam("planIds") @Size(max = 20,message = "最多可同时导出20个排单") List<Long> planIds) {
|
||||
return success(planService.getPlateList(planIds));
|
||||
}
|
||||
|
||||
|
||||
+2
@@ -4,6 +4,7 @@ package com.cf.imes.module.executor.controller.admin.plan.saveOptimize;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -11,6 +12,7 @@ public class CuttingStatusRespVO {
|
||||
|
||||
|
||||
@Schema(description = "排单ID")
|
||||
@NotNull(message = "排单ID不能为空")
|
||||
private Long planId;
|
||||
|
||||
|
||||
|
||||
+2
@@ -5,6 +5,7 @@ import com.cf.imes.module.executor.dal.dataobject.goods.OptimizeBoardModelDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@@ -17,6 +18,7 @@ public class SavePlanPlateResultReqVO {
|
||||
|
||||
|
||||
@Schema(description = "优化后的大板列表数据", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "优化数据异常,请重新进行优化")
|
||||
private List<OptimizeBoardModelDO> optimizeBoardModelDOS;
|
||||
|
||||
|
||||
|
||||
+21
@@ -1,11 +1,13 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.validation.NumberValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -14,34 +16,53 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
|
||||
@Data
|
||||
public class GetPlateByPlanIdVO extends PageParam {
|
||||
|
||||
@Schema(description = "排单id")
|
||||
@NotNull(message = "排单id不能空")
|
||||
@Size(max = 20,message = "最多可同时查看20个排单")
|
||||
private List<Long> planIds;
|
||||
|
||||
@Schema(description = "矩形")
|
||||
private Boolean rectangle;
|
||||
|
||||
@Schema(description = "异形")
|
||||
private Boolean specialShaped;
|
||||
|
||||
@Schema(description = "造型")
|
||||
private Boolean sculpt;
|
||||
|
||||
@Schema(description = "有挖穿造型")
|
||||
private Boolean holeThrough;
|
||||
|
||||
@Schema(description = "有挖穿孔")
|
||||
private Boolean burrow;
|
||||
|
||||
@Schema(description = "有二维纹路")
|
||||
private Boolean twoDimensionalToolPath;
|
||||
|
||||
@Schema(description = "门板")
|
||||
private Boolean isDoor;
|
||||
|
||||
@Schema(description = "开始时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date beginDate;
|
||||
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private Date endDate;
|
||||
|
||||
@Schema(description = "长 小范围")
|
||||
@NumberValid(name = "长度")
|
||||
private BigDecimal longMinRang;
|
||||
|
||||
@Schema(description = "长 大范围")
|
||||
@NumberValid(name = "长度")
|
||||
private BigDecimal longMaxRang;
|
||||
|
||||
@Schema(description = "宽 小范围")
|
||||
@NumberValid(name = "宽度")
|
||||
private BigDecimal widthMinRang;
|
||||
|
||||
@Schema(description = "宽 大范围")
|
||||
@NumberValid(name = "宽度")
|
||||
private BigDecimal widthMaxRang;
|
||||
}
|
||||
|
||||
+29
-1
@@ -1,10 +1,13 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.framework.common.validation.NumberValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
@@ -19,39 +22,64 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class OrderPageReqVOCopy extends PageParam {
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
private Long orderId;
|
||||
@Pattern(regexp = "^[0-9]*$",message = "生产单号必须为数字")
|
||||
@Length(max = 19,message = "生产单号长度不能超过19位")
|
||||
private String orderId;
|
||||
|
||||
@Schema(description = "自定义id")
|
||||
@Length(max = 32,message = "自定义单号数据过长,请重新输入")
|
||||
private String defaultId;
|
||||
|
||||
@Schema(description = "客户")
|
||||
@Length(max = 255, message = "客户数据过长,请重新输入")
|
||||
private String consignee;
|
||||
|
||||
@Schema(description = "地址")
|
||||
@Length(max = 255, message = "收货地址数据过长,请重新输入")
|
||||
private String consigneeAddress;
|
||||
|
||||
@Schema(description = "状态列表")
|
||||
private List<Integer> stateList;
|
||||
|
||||
@Schema(description = "矩形")
|
||||
private Boolean rectangle;
|
||||
|
||||
@Schema(description = "异形")
|
||||
private Boolean specialShaped;
|
||||
|
||||
@Schema(description = "造型")
|
||||
private Boolean sculpt;
|
||||
|
||||
@Schema(description = "有挖穿造型")
|
||||
private Boolean holeThrough;
|
||||
|
||||
@Schema(description = "有挖穿孔")
|
||||
private Boolean burrow;
|
||||
|
||||
@Schema(description = "有二维纹路")
|
||||
private Boolean twoDimensionalToolPath;
|
||||
|
||||
@Schema(description = "门板")
|
||||
private Boolean isDoor;
|
||||
|
||||
@Schema(description = "生产单订单日期", example = "[2022-07-01 ,2022-07-01]")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate[] createTime;
|
||||
|
||||
@Schema(description = "长 小范围")
|
||||
@NumberValid(name = "长度")
|
||||
private BigDecimal longMinRang;
|
||||
|
||||
@Schema(description = "长 大范围")
|
||||
@NumberValid(name = "长度")
|
||||
private BigDecimal longMaxRang;
|
||||
|
||||
@Schema(description = "宽 小范围")
|
||||
@NumberValid(name = "宽度")
|
||||
private BigDecimal widthMinRang;
|
||||
|
||||
@Schema(description = "宽 大范围")
|
||||
@NumberValid(name = "宽度")
|
||||
private BigDecimal widthMaxRang;
|
||||
|
||||
|
||||
|
||||
-47
@@ -3,11 +3,8 @@ package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
/**
|
||||
* @author Beal
|
||||
@@ -19,48 +16,4 @@ public class PlanOrderPageReqVO extends PageParam {
|
||||
@NotNull(message = "排单id不能空")
|
||||
private Long planId;
|
||||
|
||||
/*@Schema(description = "交付日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] deliveryDate;
|
||||
|
||||
@Schema(description = "生产单类型,1主单 2子单", example = "1")
|
||||
private Boolean type;
|
||||
|
||||
@Schema(description = "生产单排序号")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "CAD数据类型,1CAD 2WebCAD 3Excel", example = "1")
|
||||
private Integer dataType;
|
||||
|
||||
@Schema(description = "订单状态,0未排单1已排单2生产中3加工完成4打包完成5入库完成6出库完成", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "自定义单号")
|
||||
private String customOrderNo;
|
||||
|
||||
@Schema(description = "客户")
|
||||
private String customer;
|
||||
|
||||
@Schema(description = "客户地址")
|
||||
private String address;
|
||||
|
||||
@Schema(description = "客户电话")
|
||||
private String phoneNumber;
|
||||
|
||||
@Schema(description = "经销商")
|
||||
private String dealer;
|
||||
|
||||
@Schema(description = "经销商电话")
|
||||
private String dealerPhoneNumber;
|
||||
|
||||
@Schema(description = "业务员")
|
||||
private String salesman;
|
||||
|
||||
@Schema(description = "拆单员")
|
||||
private String splitter;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;*/
|
||||
|
||||
}
|
||||
|
||||
+18
-3
@@ -1,12 +1,16 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.module.executor.validation.plan.PlanStatusValid;
|
||||
import com.cf.imes.module.executor.validation.plan.PlanTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
@@ -18,7 +22,9 @@ import static com.cf.imes.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH
|
||||
public class PlanPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "排单号")
|
||||
private Long id;
|
||||
@Pattern(regexp = "^[0-9]*$",message = "排单号必须为数字")
|
||||
@Length(max = 19,message = "排单号长度不能超过19位")
|
||||
private String id;
|
||||
|
||||
|
||||
@Schema(description = "是否翻页-true:上,false:下")
|
||||
@@ -29,9 +35,11 @@ public class PlanPageReqVO extends PageParam {
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "排单类型:1 混单排单,2 生产单排单", example = "2")
|
||||
@PlanTypeValid
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "排单状态:0 新单,1 板材已申请,2 开料中,3 已开料", example = "1")
|
||||
@Schema(description = "排单状态:0 未开料,1 开料中,2 已开料", example = "1")
|
||||
@PlanStatusValid
|
||||
private Integer status;
|
||||
|
||||
// @Schema(description = "是否支付:0 否,1 是")
|
||||
@@ -45,22 +53,29 @@ public class PlanPageReqVO extends PageParam {
|
||||
private LocalDateTime[] planTime;
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
@Pattern(regexp = "^[0-9]*$",message = "生产单号必须为数字")
|
||||
@Length(max = 19,message = "生产单号长度不能超过19位")
|
||||
private String orderNos;
|
||||
|
||||
|
||||
@Schema(description = "生产单客户")
|
||||
@Length(max = 255, message = "客户数据过长,请重新输入")
|
||||
private String customer;
|
||||
|
||||
|
||||
@Schema(description = "备注", example = "你说的对")
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
|
||||
@Schema(description = "生产操作人")
|
||||
private String operator;
|
||||
|
||||
|
||||
@Schema(description = "生产时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] produceTime;
|
||||
|
||||
+23
-17
@@ -1,11 +1,15 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plan.vo;
|
||||
|
||||
import com.cf.imes.framework.es.core.valid.CreateGroup;
|
||||
import com.cf.imes.framework.es.core.valid.UpdateGroup;
|
||||
import com.cf.imes.module.executor.validation.plan.PlanStatusValid;
|
||||
import com.cf.imes.module.executor.validation.plan.PlanTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
@@ -14,19 +18,25 @@ import java.util.List;
|
||||
@Data
|
||||
public class PlanSaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "12776")
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排单数据异常,请重新操作",groups = UpdateGroup.class)
|
||||
@Max(value = 0x7fffffffffffffffL,message = "排单号异常,无法更新排单数据")
|
||||
private Long id;
|
||||
|
||||
|
||||
@Schema(description = "排序优先级", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long sort;
|
||||
|
||||
@Schema(description = "排单类型:1 混单排单,2 生产单排单", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
|
||||
@Schema(description = "排单类型:1 混单排单,2 生产单排单", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排单类型:1 混单排单,2 生产单排单不能为空", groups = CreateGroup.class)
|
||||
@PlanTypeValid
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "排单状态:0 新单,1 板材已申请,2 开料中,3 已开料", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "排单状态:0 新单,1 板材已申请,2 开料中,3 已开料不能为空", groups = CreateGroup.class)
|
||||
|
||||
@Schema(description = "排单状态:0 未开料,1 开料中,2 已开料", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "排单状态:0 未开料,1 开料中,2 已开料 不能为空", groups = CreateGroup.class)
|
||||
@PlanStatusValid
|
||||
private Integer status;
|
||||
|
||||
|
||||
@@ -34,29 +44,27 @@ public class PlanSaveReqVO {
|
||||
@NotNull(message = "机台 ID不能为空")
|
||||
private Long machineId;
|
||||
|
||||
|
||||
@Schema(description = "计划时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "计划时间不能为空", groups = CreateGroup.class)
|
||||
private LocalDateTime planTime;
|
||||
|
||||
|
||||
|
||||
// @Schema(description = "余料板ID")
|
||||
// private List<Long> remainPlateIds;
|
||||
|
||||
|
||||
@Schema(description = "备注")
|
||||
@Length(max = 255, message = "备注长度不能超过255个字符")
|
||||
private String remark;
|
||||
|
||||
|
||||
@Schema(description = "生产操作人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "生产操作人不能为空", groups = CreateGroup.class)
|
||||
private String operator;
|
||||
|
||||
|
||||
@Schema(description = "生产时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产时间不能为空", groups = CreateGroup.class)
|
||||
private LocalDateTime produceTime;
|
||||
|
||||
|
||||
@Schema(description = "生产单id与商品id 列表,修改排单时,只传入新增的那一部分",requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@Valid
|
||||
private List<Item> itemList;
|
||||
|
||||
|
||||
@@ -64,24 +72,22 @@ public class PlanSaveReqVO {
|
||||
private List<Long> deleteIds;
|
||||
|
||||
|
||||
@Valid
|
||||
@Data
|
||||
public static class Item {
|
||||
|
||||
@Schema(description = "生产单的商品id")
|
||||
@NotNull
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "生产单id")
|
||||
@NotNull
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private Long orderId;
|
||||
|
||||
@Schema(description = "板材库大板id")
|
||||
@NotNull
|
||||
@NotNull(message = "生产单数据错误,请检查生产单数据或重新导入,排单创建失败",groups = {UpdateGroup.class, CreateGroup.class})
|
||||
private String goodsId;
|
||||
|
||||
@Schema(description = "余料板ID")
|
||||
@NotNull
|
||||
private Long remainPlateId;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -21,6 +21,7 @@ import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
@@ -59,7 +60,7 @@ public class PlateController {
|
||||
@Parameter(name = "planId", description = "排单ID", required = true)
|
||||
})
|
||||
@PreAuthorize("@ss.hasAnyPermissions('executor:plate:delete','placeorder:optimize')")
|
||||
public CommonResult<Boolean> deletePlate(@RequestParam("id") Long id, @RequestParam("planId") Long planId) {
|
||||
public CommonResult<Boolean> deletePlate(@RequestParam("id") @NotNull Long id, @RequestParam("planId") @NotNull Long planId) {
|
||||
plateService.deletePlate(id,planId);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
+36
-1
@@ -1,12 +1,20 @@
|
||||
package com.cf.imes.module.executor.controller.admin.plate.vo;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.validation.NumberValid;
|
||||
import com.cf.imes.module.executor.validation.plate.PlatePlaceHoleValid;
|
||||
import com.cf.imes.module.executor.validation.plate.PlateTextureValid;
|
||||
import com.cf.imes.module.executor.validation.plate.PlateTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
@@ -19,6 +27,8 @@ public class OptimizationSavePlateReqVO {
|
||||
|
||||
|
||||
@Schema(description = "柜体号")
|
||||
@NotNull(message = "当前板材没有选择柜体,请选择")
|
||||
@Max(value = 0x7fffffffffffffffL,message = "柜体数据错误,请重新进行新增")
|
||||
private Long bodyId;
|
||||
|
||||
|
||||
@@ -27,6 +37,8 @@ public class OptimizationSavePlateReqVO {
|
||||
|
||||
|
||||
@Schema(description = "房间号")
|
||||
@NotNull(message = "当前板材没有选择房间,请选择")
|
||||
@Max(value = 0x7fffffffffffffffL,message = "房间数据错误,请重新进行新增")
|
||||
private Long roomId;
|
||||
|
||||
|
||||
@@ -35,65 +47,88 @@ public class OptimizationSavePlateReqVO {
|
||||
|
||||
|
||||
@Schema(description = "排单ID")
|
||||
@NotNull(message = "板材数据错误,请重新进行新增")
|
||||
@Max(value = 0x7fffffffffffffffL,message = "板材数据错误,请重新进行新增")
|
||||
private Long planId;
|
||||
|
||||
|
||||
@Schema(description = "生产单号")
|
||||
@NotNull(message = "当前板材没有选择生产单,请选择")
|
||||
@Max(value = 0x7fffffffffffffffL,message = "生产单数据错误,请重新进行新增")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@Schema(description = "板名称")
|
||||
@NotNull(message = "板材名称不能为空")
|
||||
@Length(max = 64, message = "板材名称过长,不得超过 64 个字符")
|
||||
private String name;
|
||||
|
||||
|
||||
@Schema(description = "板类型,0 层板 1 立板 2 背板")
|
||||
@Schema(description = "板类型,0 层板 1 立板 2 背板 3 自增板")
|
||||
@PlateTypeValid
|
||||
private Integer type;
|
||||
|
||||
|
||||
@Schema(description = "商品ID-大板的实际ID")
|
||||
@NotNull(message = "板材数据错误,请重新进行新增")
|
||||
private String goodsId;
|
||||
|
||||
|
||||
@Schema(description = "纹路类型,0 正纹 1 可翻转 2 反纹")
|
||||
@PlateTextureValid
|
||||
private Integer texture;
|
||||
|
||||
|
||||
@Schema(description = "排孔类型,0 正纹 1 反面 2 随意面")
|
||||
@PlatePlaceHoleValid
|
||||
private Integer placeHole;
|
||||
|
||||
|
||||
@Schema(description = "宽度")
|
||||
@NumberValid(name = "宽度")
|
||||
private BigDecimal width;
|
||||
|
||||
|
||||
@Schema(description = "高度")
|
||||
@NumberValid(name = "高度")
|
||||
private BigDecimal height;
|
||||
|
||||
|
||||
@Schema(description = "左封边厚度")
|
||||
@NumberValid(name = "左封边")
|
||||
private BigDecimal sealLeft;
|
||||
|
||||
|
||||
@Schema(description = "右封边厚度")
|
||||
@NumberValid(name = "右封边")
|
||||
private BigDecimal sealRight;
|
||||
|
||||
|
||||
@Schema(description = "上封边厚度")
|
||||
@NumberValid(name = "上封边")
|
||||
private BigDecimal sealUp;
|
||||
|
||||
|
||||
@Schema(description = "下封边厚度")
|
||||
@NumberValid(name = "下封边")
|
||||
private BigDecimal sealDown;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "倍数")
|
||||
@Max(value = 10,message = "板材倍数最大为10")
|
||||
@Min(value = 1,message = "板材倍数有误,倍数必须大于 0")
|
||||
private Integer multiple ;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "备注1")
|
||||
@Length(max = 127, message = "备注长度不能超过 127 个字符")
|
||||
private String remake1;
|
||||
|
||||
|
||||
@Schema(description = "备注2")
|
||||
@Length(max = 127, message = "备注长度不能超过 127 个字符")
|
||||
private String remake2;
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -245,7 +245,7 @@ public interface OrderMapper extends BaseMapperX<OrderDO> {
|
||||
.eqIfPresent(OrderDO::getOrganId, organId)
|
||||
.eq(OrderDO::getDeleted, false)
|
||||
.in(OrderDO::getStatus,statusList)
|
||||
.likeIfPresent(OrderDO::getId,pageReqVO.getOrderId() != null ? pageReqVO.getOrderId().toString() : null)
|
||||
.likeIfPresent(OrderDO::getId,pageReqVO.getOrderId() != null ? pageReqVO.getOrderId() : null)
|
||||
.inIfPresent(OrderDO::getId,pageReqVO.getOrderIds())
|
||||
.likeIfPresent(OrderDO::getCustomOrderNo,pageReqVO.getDefaultId())
|
||||
.likeIfPresent(OrderDO::getCustomer,pageReqVO.getConsignee())
|
||||
|
||||
+33
-29
@@ -41,7 +41,6 @@ import com.cf.imes.module.executor.dal.mysql.remainplaten.RemainPlateMapper;
|
||||
import com.cf.imes.module.executor.enums.ErrorCodeConstants;
|
||||
import com.cf.imes.module.system.api.dataSource.DataSourceApi;
|
||||
import com.cf.imes.module.system.api.machine.MachineApi;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.core.type.TypeReference;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
@@ -181,7 +180,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
outputList.add(new BlockPlaceInfo(bi,bo));
|
||||
}
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
} catch (Exception e) {
|
||||
throw exception(ORDER_PLAN_OPTIMIZE_ERROR);
|
||||
}
|
||||
|
||||
@@ -233,7 +232,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
|
||||
esDocumentService.updateById(ORDER_REMAIN_PLATE_MODEL, optimizeBoardModelDO.getId(), HashMap.class, objectObjectHashMap);
|
||||
|
||||
}catch (IOException e) {
|
||||
}catch (Exception e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(ES_ERROR_UPDATE);
|
||||
}
|
||||
@@ -284,6 +283,10 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
Long planId = respVO.getPlanId();
|
||||
List<Long> goodsNo = respVO.getGoodsNo();
|
||||
|
||||
if(goodsNo.isEmpty()){
|
||||
return true;
|
||||
}
|
||||
|
||||
PlanDO planDO = planMapper.selectById(planId);
|
||||
|
||||
AssertUtils.notEmpty(planDO,PLAN_NOT_EXISTS);
|
||||
@@ -740,6 +743,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveOptimizationResults(SavePlanPlateResultReqVO req) {
|
||||
|
||||
AssertUtils.notEmpty(req.getOptimizeBoardModelDOS(),ORDER_PLAN_OPTIMIZE_ERROR);
|
||||
|
||||
// 先根据排单查找是否有优化数据,如果有,删除
|
||||
List<Long> planIds = req.getOptimizeBoardModelDOS().stream().map(OptimizeBoardModelDO::getPlanId).toList();
|
||||
@@ -864,9 +868,9 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
} catch (Exception e) {
|
||||
log.error("生产单板材造型信息ES文档查询数据异常: "+e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -882,9 +886,9 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
} catch (Exception e) {
|
||||
log.error("生产单板材造型信息ES文档查询数据异常: "+e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -900,13 +904,13 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
BulkResponse bulkResponse = esDocumentService.bulkCreate(ORDER_REMAIN_PLATE_MODEL, optimizeBoardModelDOS);
|
||||
boolean errors = bulkResponse.errors();
|
||||
if (errors) {
|
||||
log.error(bulkResponse.items().toString());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
log.error("优化生产ES文档保存数据异常: "+bulkResponse.items().toString());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
log.error("优化生产ES文档保存数据异常: "+e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -924,9 +928,9 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
} catch (Exception e) {
|
||||
log.error("优化生产ES文档查询异常: "+e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -943,9 +947,9 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
} catch (Exception e) {
|
||||
log.error("优化生产ES文档查询异常: "+e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -964,9 +968,9 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
} catch (Exception e) {
|
||||
log.error("优化生产ES文档查询异常: "+e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -984,9 +988,9 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
} catch (Exception e) {
|
||||
log.error("优化生产ES文档查询异常: "+e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1004,9 +1008,9 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
} catch (Exception e) {
|
||||
log.error("生产单配件ES文档查询异常:"+e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1026,7 +1030,7 @@ public class OptimizePlanServiceImpl implements OptimizePlanService {
|
||||
try {
|
||||
DeleteByQueryResponse response = elasticsearchClient.deleteByQuery(builder.build());
|
||||
log.info("Deleted {} documents with planId {}", response.deleted(), planIds);
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("Error deleting documents with planId {}: {}", planIds, e.getMessage());
|
||||
throw new ServiceException(ES_ERROR_DELETE);
|
||||
}
|
||||
|
||||
-2
@@ -8,8 +8,6 @@ import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderBodyRe
|
||||
import com.cf.imes.module.executor.controller.admin.order.vo.product.OrderRoomBodyRespVO;
|
||||
import com.cf.imes.module.executor.controller.admin.orderParts.vo.OrderPartsRespVO;
|
||||
import com.cf.imes.module.executor.dal.dataobject.order.OrderDO;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.excel.OrderPlateImportExcelVO;
|
||||
import com.cf.imes.module.executor.util.fileConversion.admin.files.xml.VO.OrderXmlVO;
|
||||
import org.springframework.boot.system.ApplicationHome;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
+1
-1
@@ -569,7 +569,7 @@ public class OrderServiceImpl implements OrderService {
|
||||
updateOrder(BeanUtils.toBean(orderDO, OrderSaveReqVO.class));
|
||||
}
|
||||
if (Objects.equals(orderDO.getPackaged(), OrderPackageStatusEnum.PACKAGED.getStatus())) {
|
||||
orderDO.setPackaged(OrderPackageStatusEnum.PACKAGING.getStatus());
|
||||
orderDO.setPackaged(OrderPackageStatusEnum.PACKAGED.getStatus());
|
||||
updateOrder(BeanUtils.toBean(orderDO, OrderSaveReqVO.class));
|
||||
}
|
||||
}
|
||||
|
||||
+7
-9
@@ -57,14 +57,12 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.IOException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.ES_ERROR_DELETE;
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.INTERNAL_SERVER_ERROR;
|
||||
import static com.cf.imes.framework.common.exception.enums.GlobalErrorCodeConstants.*;
|
||||
import static com.cf.imes.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.cf.imes.framework.common.util.string.SearchUtil.insertSeparator;
|
||||
import static com.cf.imes.framework.security.core.util.SecurityFrameworkUtils.getUserOrganId;
|
||||
@@ -642,7 +640,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
// todo 修改排单数据筛选,目前只解决了非混单的情况,混单情况待解决
|
||||
.inIfPresent(FIELD_OG_ID,goodsIds)
|
||||
.inIfPresent("o.id",pageReqVO.getOrderIds())
|
||||
.likeIfPresent("o.id", pageReqVO.getOrderId() != null ? pageReqVO.getOrderId().toString() : null)
|
||||
.likeIfPresent("o.id", pageReqVO.getOrderId() != null ? pageReqVO.getOrderId() : null)
|
||||
.inIfPresent(FIELD_OG_ID,pageReqVO.getIds())
|
||||
.likeIfPresent("o.customer", pageReqVO.getConsignee())
|
||||
.likeIfPresent("o.custom_order_no", pageReqVO.getDefaultId())
|
||||
@@ -858,7 +856,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
.inIfPresent(FIELD_OG_ID, pageReqVO.getIds())
|
||||
// todo 修改排单数据筛选,目前只解决了非混单的情况,混单情况待解决
|
||||
.eqIfPresent("og.goods_id",pageReqVO.getGoodsId())
|
||||
.likeIfPresent("o.id", pageReqVO.getOrderId() != null ? pageReqVO.getOrderId().toString() : null)
|
||||
.likeIfPresent("o.id", pageReqVO.getOrderId() != null ? pageReqVO.getOrderId() : null)
|
||||
.likeIfPresent("o.customer", pageReqVO.getConsignee())
|
||||
.likeIfPresent("o.custom_order_no", pageReqVO.getDefaultId())
|
||||
.likeIfPresent("o.address", pageReqVO.getConsigneeAddress())
|
||||
@@ -1115,7 +1113,7 @@ public class PlanServiceImpl implements PlanService {
|
||||
try {
|
||||
DeleteByQueryResponse response = elasticsearchClient.deleteByQuery(builder.build());
|
||||
log.info("Deleted {} documents with planId {}", response.deleted(), planIds);
|
||||
} catch (IOException e) {
|
||||
} catch (Exception e) {
|
||||
log.error("Error deleting documents with planId {}: {}", planIds, e.getMessage());
|
||||
throw new ServiceException(ES_ERROR_DELETE);
|
||||
}
|
||||
@@ -1136,9 +1134,9 @@ public class PlanServiceImpl implements PlanService {
|
||||
return hits.stream().map(Hit::source).collect(Collectors.toList());
|
||||
}
|
||||
return new ArrayList<>();
|
||||
} catch (IOException e) {
|
||||
log.error(e.getMessage());
|
||||
throw new ServiceException(INTERNAL_SERVER_ERROR);
|
||||
} catch (Exception e) {
|
||||
log.error("优化生产ES文档数据查询异常:"+e.getMessage());
|
||||
throw new ServiceException(DATA_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+13
-8
@@ -121,11 +121,13 @@ public class PlateServiceImpl implements PlateService {
|
||||
public void deletePlate(Long id,Long planId) {
|
||||
|
||||
PlanDO planDO = planMapper.selectById(planId);
|
||||
|
||||
AssertUtils.notEmpty(planDO,ORDER_PLAN_DATE_ERROR);
|
||||
|
||||
PlateDO plateDO = plateMapper.selectById(id);
|
||||
|
||||
// 校验存在
|
||||
AssertUtils.notEmpty(plateDO,REMAIN_PLATE_NOT_EXISTS);
|
||||
AssertUtils.notEmpty(planDO,ORDER_PLAN_DATE_ERROR);
|
||||
|
||||
|
||||
if(!plateDO.getType().equals(OrderPlateTypeEnum.SELFINCREASINGBOARD.getType())){
|
||||
throw exception(PLATE_IS_SOURCE);
|
||||
@@ -335,16 +337,17 @@ public class PlateServiceImpl implements PlateService {
|
||||
public List<String> createNewPlate(OptimizationSavePlateReqVO reqVO) {
|
||||
|
||||
|
||||
AssertUtils.notEmpty(reqVO.getRoomId(),ORDER_ROOM_ERROR);
|
||||
AssertUtils.notEmpty(reqVO.getBodyId(),ORDER_BODY_ERROR);
|
||||
AssertUtils.notEmpty(reqVO.getOrderId(),ORDER_ERROR);
|
||||
// AssertUtils.notEmpty(reqVO.getRoomId(),ORDER_ROOM_ERROR);
|
||||
// AssertUtils.notEmpty(reqVO.getBodyId(),ORDER_BODY_ERROR);
|
||||
// AssertUtils.notEmpty(reqVO.getOrderId(),ORDER_ERROR);
|
||||
|
||||
if(reqVO.getMultiple() < 1 ){
|
||||
throw exception(PLATE_MULTIPLE_ERROR);
|
||||
}
|
||||
// if(reqVO.getMultiple() < 1 ){
|
||||
// throw exception(PLATE_MULTIPLE_ERROR);
|
||||
// }
|
||||
|
||||
GoodsDO goodsDO = goodsMapper.selectGoodsId(reqVO.getOrderId(), reqVO.getGoodsId(), getUserOrganId());
|
||||
|
||||
AssertUtils.notEmpty(goodsDO,ORDER_PLAN_ERROR);
|
||||
|
||||
List<PlateDO> plateDOS = new ArrayList<>();
|
||||
|
||||
@@ -375,6 +378,8 @@ public class PlateServiceImpl implements PlateService {
|
||||
// 生产单柜体表新增数据
|
||||
OrderBodyDO orderBodyDO = orderBodyMapper.selectById(reqVO.getBodyId());
|
||||
|
||||
AssertUtils.notEmpty(orderBodyDO,PLAN_BODY_DATA_ERROR);
|
||||
|
||||
orderBodyDO.setPlateNum(reqVO.getMultiple()+orderBodyDO.getPlateNum());
|
||||
|
||||
orderBodyMapper.updateById(orderBodyDO);
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.cf.imes.module.executor.validation.order;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 订单状态校验注解
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/10/18 16:37
|
||||
*/
|
||||
@Target({
|
||||
ElementType.FIELD,
|
||||
ElementType.PARAMETER
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {OrderStatusValidator.class}
|
||||
)
|
||||
public @interface OrderStatusValid {
|
||||
String message() default "订单状态不合法,请检查";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.executor.validation.order;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.module.executor.enums.OrderStatusEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 订单状态校验器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/10/18 16:38
|
||||
*/
|
||||
public class OrderStatusValidator implements ConstraintValidator<OrderStatusValid, Integer> {
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
for (OrderStatusEnum statusEnum : OrderStatusEnum.values()) {
|
||||
if (Objects.equals(statusEnum.getStatus(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.module.executor.validation.plan;
|
||||
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author 排单状态校验注解
|
||||
*/
|
||||
@Target({
|
||||
ElementType.PARAMETER,
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {PlanStatusValidator.class}
|
||||
)
|
||||
public @interface PlanStatusValid {
|
||||
|
||||
String message() default "排单状态不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
}
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
package com.cf.imes.module.executor.validation.plan;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.enums.PlanStatusEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
|
||||
/**
|
||||
* @author 排单状态校验器
|
||||
*/
|
||||
public class PlanStatusValidator implements ConstraintValidator<PlanStatusValid, Integer> {
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
|
||||
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PlanStatusEnum statusEnum : PlanStatusEnum.values()) {
|
||||
if (ObjectUtil.equal(statusEnum.getStatus(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.executor.validation.plan;
|
||||
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author 排单类型校验注解
|
||||
*/
|
||||
@Target({
|
||||
ElementType.PARAMETER,
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {PlanTypeValidator.class}
|
||||
)
|
||||
public @interface PlanTypeValid {
|
||||
|
||||
String message() default "排单类型不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.cf.imes.module.executor.validation.plan;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.enums.PlanTypeEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* @author 排单类型校验器
|
||||
*/
|
||||
public class PlanTypeValidator implements ConstraintValidator<PlanTypeValid, Integer> {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PlanTypeEnum typeEnum : PlanTypeEnum.values()) {
|
||||
if (ObjectUtil.equal(typeEnum.getType(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.module.executor.validation.plate;
|
||||
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author 板材排孔类型校验注解
|
||||
*/
|
||||
@Target({
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {PlatePlaceHoleValidator.class}
|
||||
)
|
||||
public @interface PlatePlaceHoleValid {
|
||||
|
||||
String message() default "板材排孔类型不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.executor.validation.plate;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.enums.PlatePlaceHoleEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
|
||||
/**
|
||||
* @author 板材排孔类型校验器
|
||||
*/
|
||||
public class PlatePlaceHoleValidator implements ConstraintValidator<PlatePlaceHoleValid, Integer> {
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
|
||||
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PlatePlaceHoleEnum typeEnum : PlatePlaceHoleEnum.values()) {
|
||||
if (ObjectUtil.equal(typeEnum.getPlaceHole(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.executor.validation.plate;
|
||||
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author 板材纹路校验注解
|
||||
*/
|
||||
|
||||
|
||||
@Target({
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {PlateTextureValidator.class}
|
||||
)
|
||||
public @interface PlateTextureValid {
|
||||
|
||||
String message() default "板材纹路不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.cf.imes.module.executor.validation.plate;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.enums.PlateTextureEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* @author 板材纹路校验器
|
||||
*/
|
||||
public class PlateTextureValidator implements ConstraintValidator<PlateTextureValid, Integer> {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
|
||||
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (PlateTextureEnum typeEnum : PlateTextureEnum.values()) {
|
||||
if (ObjectUtil.equal(typeEnum.getTexture(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.cf.imes.module.executor.validation.plate;
|
||||
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author 板材类型校验注解
|
||||
*/
|
||||
@Target({
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {PlateTypeValidator.class}
|
||||
)
|
||||
public @interface PlateTypeValid {
|
||||
|
||||
String message() default "板材类型不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.executor.validation.plate;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.enums.OrderPlateTypeEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* @author 板材类型校验器
|
||||
*/
|
||||
public class PlateTypeValidator implements ConstraintValidator<PlateTypeValid, Integer> {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
|
||||
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (OrderPlateTypeEnum typeEnum : OrderPlateTypeEnum.values()) {
|
||||
if (ObjectUtil.equal(typeEnum.getType(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -64,8 +64,9 @@ public class PackController {
|
||||
|
||||
@GetMapping("/getOrderPlateList")
|
||||
@Operation(summary = "查询多个生产单对应的板材信息")
|
||||
@Parameter(name = "orderIds", description = "生产单ID", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('manage:pack:create')")
|
||||
public CommonResult<List<PlateDetailsRespVO>> getOrdersPlateList(@Valid @RequestParam List<Long> orderIds) {
|
||||
public CommonResult<List<PlateDetailsRespVO>> getOrdersPlateList(@Valid @RequestParam("orderIds") List<Long> orderIds) {
|
||||
|
||||
return success(packService.getOrdersPlateList(orderIds));
|
||||
|
||||
|
||||
+4
-12
@@ -1,15 +1,12 @@
|
||||
package com.cf.imes.module.manage.controller.admin.pack.prePack;
|
||||
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 预打包保存优化信息")
|
||||
@Data
|
||||
@@ -18,20 +15,15 @@ public class PrePackReqVO {
|
||||
|
||||
|
||||
@Schema(description = "生产单ID")
|
||||
@NotNull(message = "优化数据异常,请重新优化")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
// @Schema(description = "优化信息")
|
||||
// @JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
|
||||
// private Map<String, List<PrePackOptimizeInfo>> optimizeInfo;
|
||||
|
||||
|
||||
@Schema(description = "优化信息")
|
||||
@NotBlank(message = "优化数据异常,请重新优化")
|
||||
private String optimizeInfo;
|
||||
|
||||
// @Schema(description = "是否自动打包")
|
||||
// private Boolean isAutoPack;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+6
@@ -5,6 +5,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 删除其他配件 Request VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@@ -12,17 +14,21 @@ public class DeleteOtherPartsReqVO {
|
||||
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产单号为空,请重新删除配件")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@Schema(description = "包裹Id", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "包裹号为空,请重新删除配件")
|
||||
private Long packageId;
|
||||
|
||||
@Schema(description = "配件ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "配件信息为空,请重新删除配件")
|
||||
private Long partsId;
|
||||
|
||||
|
||||
@Schema(description = "是否是其他类型的配件", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "配件类型为空,请重新删除配件")
|
||||
private Boolean isOtherParts;
|
||||
|
||||
|
||||
|
||||
+5
-1
@@ -1,10 +1,12 @@
|
||||
package com.cf.imes.module.manage.controller.admin.pack.vo;
|
||||
|
||||
|
||||
import com.cf.imes.module.manage.validation.pack.PackTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 包裹新增 Request VO")
|
||||
@@ -18,6 +20,7 @@ public class OrderPackReqVO {
|
||||
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产单号为空")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@@ -26,9 +29,10 @@ public class OrderPackReqVO {
|
||||
|
||||
|
||||
@Schema(description = "包裹类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@PackTypeValid
|
||||
private Integer packageType;
|
||||
|
||||
//
|
||||
|
||||
// @Schema(description = "包裹状态", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// private Long packStatus;
|
||||
|
||||
|
||||
+4
-2
@@ -1,12 +1,11 @@
|
||||
package com.cf.imes.module.manage.controller.admin.pack.vo;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 生产单模块表 Request VO")
|
||||
@@ -17,15 +16,18 @@ public class OrderPartsReqVO /*extends PageParam*/ {
|
||||
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产单号为空")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@Schema(description = "更新配件时传-包裹ID")
|
||||
private Long packId;
|
||||
|
||||
|
||||
@Schema(description = "新增的配件ID")
|
||||
private List<Long> addPartsIdList;
|
||||
|
||||
|
||||
@Schema(description = "更新配件时传-删除的配件ID")
|
||||
private List<Long> deletePartsIdList;
|
||||
|
||||
|
||||
+11
-17
@@ -1,12 +1,14 @@
|
||||
package com.cf.imes.module.manage.controller.admin.pack.vo;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.validation.NumberValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Schema(description = "管理后台 - 新增外部配件 Request VO")
|
||||
@Data
|
||||
@@ -14,23 +16,22 @@ import javax.validation.constraints.NotNull;
|
||||
public class OtherPackReqVO {
|
||||
|
||||
|
||||
//
|
||||
// @Schema(description = "配件ID,主键", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// private Long id;
|
||||
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9822")
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产单号为空,请重新新增外部配件")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@Schema(description = "配件名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "9822")
|
||||
@Schema(description = "配件名称", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotBlank(message = "配件名称不能为空")
|
||||
@Size(max = 30, message = "配件名称长度不能超过 64 个字符")
|
||||
private String name;
|
||||
|
||||
|
||||
@Schema(description = "配件数量", requiredMode = Schema.RequiredMode.REQUIRED, example = "9822")
|
||||
@Schema(description = "配件数量", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NumberValid(name = "配件数量")
|
||||
private Double num;
|
||||
|
||||
@Schema(description = "包裹编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9822")
|
||||
@Schema(description = "包裹编号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private String packNo;
|
||||
|
||||
|
||||
@@ -39,12 +40,5 @@ public class OtherPackReqVO {
|
||||
|
||||
|
||||
|
||||
/* @Schema(description = "包裹编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9822")
|
||||
@NotNull(message = "包裹编号不能为空")
|
||||
private String packNo;*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+8
@@ -2,19 +2,27 @@ package com.cf.imes.module.manage.controller.admin.pack.vo;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.module.manage.validation.pack.PackTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 查看包裹详情")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class PackDetailsReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "包裹数据错误,请重新查看")
|
||||
private Long packageId;
|
||||
|
||||
|
||||
@Schema(description = "包裹类型", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@PackTypeValid
|
||||
private Integer type;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+16
-2
@@ -2,10 +2,14 @@ package com.cf.imes.module.manage.controller.admin.pack.vo;
|
||||
|
||||
|
||||
import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import com.cf.imes.module.manage.validation.pack.OrderPackagedStatusValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
@Schema(description = "管理后台 - 打包分页 Request VO")
|
||||
@Data
|
||||
@@ -14,29 +18,39 @@ import lombok.ToString;
|
||||
public class PackPageReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "打包状态(0:未打包,1:已打包)", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@Schema(description = "打包状态(0:未打包,1:已打包)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@OrderPackagedStatusValid
|
||||
private Integer status;
|
||||
|
||||
|
||||
@Schema(description = "订单号")
|
||||
private Long orderId;
|
||||
@Pattern(regexp = "^[0-9]*$",message = "生产单号必须为数字")
|
||||
@Length(max = 19,message = "生产单号长度不能超过19")
|
||||
private String orderId;
|
||||
|
||||
|
||||
@Schema(description = "自定义单号")
|
||||
@Length(max = 32,message = "自定义单号数据过长,请重新输入")
|
||||
private String customOrderNo;
|
||||
|
||||
|
||||
@Schema(description = "经销商")
|
||||
@Length(max = 255, message = "经销商数据过长,请重新输入")
|
||||
private String dealer;
|
||||
|
||||
|
||||
@Schema(description = "客户")
|
||||
@Length(max = 255, message = "客户数据过长,请重新输入")
|
||||
private String customer;
|
||||
|
||||
|
||||
@Schema(description = "地址")
|
||||
@Length(max = 255, message = "收货地址数据过长,请重新输入")
|
||||
private String address;
|
||||
|
||||
|
||||
@Schema(description = "是否翻页-true:上,false:下")
|
||||
private Boolean isUp;
|
||||
|
||||
|
||||
}
|
||||
|
||||
+5
@@ -5,16 +5,20 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 删除订单包裹 Request VO")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
public class PackReqVO {
|
||||
|
||||
@Schema(description = "生产单ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "生产单号为空,请重新删除配件")
|
||||
private Long orderId;
|
||||
|
||||
|
||||
@Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "包裹信息为空,请重新删除配件")
|
||||
private Long packageId;
|
||||
|
||||
|
||||
@@ -23,6 +27,7 @@ public class PackReqVO {
|
||||
|
||||
|
||||
@Schema(description = "是否是其他类型的包裹", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "包裹类型为空,请重新删除配件")
|
||||
private Boolean isOther;
|
||||
|
||||
|
||||
|
||||
+11
-2
@@ -5,6 +5,9 @@ import com.cf.imes.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.hibernate.validator.constraints.Length;
|
||||
|
||||
import javax.validation.constraints.Pattern;
|
||||
|
||||
|
||||
@Schema(description = "管理后台 - 查看生产单下对应的包裹信息")
|
||||
@@ -14,11 +17,15 @@ public class PackageDetailsReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "生产单号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
private Long orderId;
|
||||
@Pattern(regexp = "^[0-9]*$",message = "生产单号必须为数字")
|
||||
@Length(max = 19,message = "生产单号长度不能超过 19 位")
|
||||
private String orderId;
|
||||
|
||||
|
||||
@Schema(description = "板编号")
|
||||
private Long plateNo;
|
||||
@Pattern(regexp = "^[0-9]*$",message = "板编号必须为数字")
|
||||
@Length(max = 13,message = "板编号长度不能超过 13 位")
|
||||
private String plateNo;
|
||||
|
||||
|
||||
@Schema(description = "包裹状态")
|
||||
@@ -26,6 +33,8 @@ public class PackageDetailsReqVO extends PageParam {
|
||||
|
||||
|
||||
@Schema(description = "包裹编号")
|
||||
@Pattern(regexp = "^[0-9]*$",message = "包裹编号必须为数字")
|
||||
@Length(max = 13,message = "包裹编号长度不能超过 13 位")
|
||||
private String packageNo;
|
||||
|
||||
|
||||
|
||||
+3
@@ -5,6 +5,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Schema(description = "管理后台 - 拆包")
|
||||
@Data
|
||||
@ToString(callSuper = true)
|
||||
@@ -12,6 +14,7 @@ public class PackingReqVO {
|
||||
|
||||
|
||||
@Schema(description = "包裹ID", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "包裹异常,请查看是否封包")
|
||||
private Long packageId;
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -42,12 +42,12 @@ public interface OrderPlateMapper extends BaseMapperX<OrderPlateDO> {
|
||||
}
|
||||
|
||||
|
||||
default List<OrderPlateDO> selectplateByPlateNo(Long plateNo, Long orderId, Long organId) {
|
||||
default List<OrderPlateDO> selectplateByPlateNo(String plateNo, Long orderId, Long organId) {
|
||||
return selectList(new LambdaQueryWrapperX<OrderPlateDO>()
|
||||
.eq(OrderPlateDO::getOrganId, organId)
|
||||
.eq(OrderPlateDO::getDeleted,false)
|
||||
.eq(OrderPlateDO::getOrderId, orderId)
|
||||
.likeIfPresent(OrderPlateDO::getPlateNo, plateNo.toString())
|
||||
.likeIfPresent(OrderPlateDO::getPlateNo, plateNo)
|
||||
.select(OrderPlateDO::getId));
|
||||
}
|
||||
|
||||
|
||||
+5
-3
@@ -276,7 +276,7 @@ public class PackServiceImpl implements PackService {
|
||||
public List<OrderPackageVO> getOrderPack(PackageDetailsReqVO reqVO) {
|
||||
|
||||
|
||||
List<OrderPackageVO> orderPackageVOS = orderPackageMapper.selectPackListByOrderId(reqVO.getOrderId(), getUserOrganId());
|
||||
List<OrderPackageVO> orderPackageVOS = orderPackageMapper.selectPackListByOrderId(Long.valueOf(reqVO.getOrderId()), getUserOrganId());
|
||||
|
||||
if(orderPackageVOS.isEmpty()){
|
||||
return new ArrayList<>();
|
||||
@@ -307,16 +307,18 @@ public class PackServiceImpl implements PackService {
|
||||
|
||||
List<Long> packId = null;
|
||||
|
||||
Long orderId = Long.valueOf(reqVO.getOrderId());
|
||||
|
||||
if (reqVO.getPlateNo() != null) {
|
||||
|
||||
List<Long> plateId = orderPlateMapper.selectplateByPlateNo(reqVO.getPlateNo(), reqVO.getOrderId(), getUserOrganId())
|
||||
List<Long> plateId = orderPlateMapper.selectplateByPlateNo(reqVO.getPlateNo(), orderId, getUserOrganId())
|
||||
.stream().map(OrderPlateDO::getId).toList();
|
||||
|
||||
if (plateId.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
packId = orderItemMapper.selectPackByPlateId(plateId,reqVO.getOrderId() ,getUserOrganId()).stream().map(OrderItemDO::getPackageId).distinct().toList();
|
||||
packId = orderItemMapper.selectPackByPlateId(plateId,orderId ,getUserOrganId()).stream().map(OrderItemDO::getPackageId).distinct().toList();
|
||||
|
||||
}
|
||||
|
||||
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.manage.validation.pack;
|
||||
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
|
||||
/**
|
||||
* @author 打包状态校验注解
|
||||
*/
|
||||
@Target({
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {OrderPackagedValidator.class}
|
||||
)
|
||||
public @interface OrderPackagedStatusValid {
|
||||
|
||||
String message() default "打包状态不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.cf.imes.module.manage.validation.pack;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.enums.OrderPackageStatusEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* @author 打包状态校验器
|
||||
*/
|
||||
public class OrderPackagedValidator implements ConstraintValidator<OrderPackagedStatusValid, Integer> {
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
|
||||
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (OrderPackageStatusEnum statusEnum : OrderPackageStatusEnum.values()) {
|
||||
if (ObjectUtil.equal(statusEnum.getStatus(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.cf.imes.module.manage.validation.pack;
|
||||
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.*;
|
||||
|
||||
/**
|
||||
* @author 包裹类型校验注解
|
||||
*/
|
||||
@Target({
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {PackTypeValidator.class}
|
||||
)
|
||||
public @interface PackTypeValid {
|
||||
|
||||
String message() default "包裹类型不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
|
||||
|
||||
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
package com.cf.imes.module.manage.validation.pack;
|
||||
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.framework.common.enums.OrderPackageTypeEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* @author 包裹类型校验器
|
||||
*/
|
||||
public class PackTypeValidator implements ConstraintValidator<PackTypeValid, Integer> {
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext constraintValidatorContext) {
|
||||
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
for (OrderPackageTypeEnum typeEnum : OrderPackageTypeEnum.values()) {
|
||||
if (ObjectUtil.equal(typeEnum.getType(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+2
-1
@@ -297,7 +297,7 @@ public class ErrorCodeConstants {
|
||||
public static final ErrorCode INSERT_PLATE_DATE_ERROR = new ErrorCode(1_002_041_003, "新增排单的板材数据有误,请重新新增");
|
||||
public static final ErrorCode ORDER_PLAN_DATE_ERROR = new ErrorCode(1_002_041_004, "排单信息不存在,请重新进入或切换排单");
|
||||
public static final ErrorCode ORDER_PLAN_OPTIMIZE_ERROR = new ErrorCode(1_002_041_005, "排单的优化数据异常,请将该排单重新优化");
|
||||
public static final ErrorCode ORDER_PLATE_MODEL_DATE_ERROR = new ErrorCode(1_002_041_006, "生产单对应的板材造型数据为空,请检查板材信息或者联系客服");
|
||||
public static final ErrorCode ORDER_PLATE_MODEL_DATE_ERROR = new ErrorCode(1_002_041_006, "生产单对应的板材造型数据为空,请重新导入生产单");
|
||||
public static final ErrorCode ORDER_PLAN_PLATE_ERROR = new ErrorCode(1_002_041_007, "当前排单对应的板材数据有异常,请查看板材信息或联系客服");
|
||||
public static final ErrorCode ORDER_PLAN_ERROR = new ErrorCode(1_002_041_008, "当前排单对应的生产单数据有异常,请查看生产单信息或联系客服");
|
||||
public static final ErrorCode ORDER_PLAN_PLATE_MODEL_DATE_ERROR = new ErrorCode(1_002_041_009, "当前排单对应的板材造型数据为空,请检查板材信息或者联系客服");
|
||||
@@ -314,6 +314,7 @@ public class ErrorCodeConstants {
|
||||
public static final ErrorCode PLATE_MULTIPLE_ERROR = new ErrorCode(1_002_041_017, "板材倍数有误,倍数必须大于 0");
|
||||
public static final ErrorCode ORDER_PACK_ERROR = new ErrorCode(1_002_041_018, "当前生产单信息有误,请重新选择包裹");
|
||||
public static final ErrorCode ORDER_PACK_DATA_ERROR = new ErrorCode(1_002_041_019, "当前包裹信息有误,请重新选择包裹");
|
||||
public static final ErrorCode PLAN_BODY_DATA_ERROR = new ErrorCode(1_002_041_019, "当前排单的生产单对应的柜体数据异常,请查看柜体数据或联系客服");
|
||||
|
||||
|
||||
|
||||
|
||||
+2
@@ -1,6 +1,7 @@
|
||||
package com.cf.imes.module.system.controller.admin.permission.vo.menu;
|
||||
|
||||
import com.cf.imes.module.system.validation.common.CommonStatus;
|
||||
import com.cf.imes.module.system.validation.menu.MenuTypeValid;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
@@ -27,6 +28,7 @@ public class MenuSaveVO {
|
||||
|
||||
@Schema(description = "类型,参见 MenuTypeEnum 枚举类", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotNull(message = "菜单类型不能为空")
|
||||
@MenuTypeValid
|
||||
private Integer type;
|
||||
|
||||
@Schema(description = "显示顺序不能为空", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024")
|
||||
|
||||
+5
-7
@@ -131,15 +131,13 @@ public class OAuth2TokenServiceImpl implements OAuth2TokenService {
|
||||
@Override
|
||||
public OAuth2AccessTokenDO removeAccessToken(String accessToken) {
|
||||
// 删除访问令牌
|
||||
OAuth2AccessTokenDO accessTokenDO = oauth2AccessTokenMapper.selectByAccessToken(accessToken);
|
||||
if (accessTokenDO == null) {
|
||||
OAuth2AccessTokenDO oauth2AccessTokenDO = oauth2AccessTokenRedisDAO.get(accessToken);
|
||||
if (ObjectUtil.isNotNull(oauth2AccessTokenDO)) {
|
||||
oauth2AccessTokenRedisDAO.delete(accessToken);
|
||||
return oauth2AccessTokenDO;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
oauth2AccessTokenMapper.deleteById(accessTokenDO.getId());
|
||||
oauth2AccessTokenRedisDAO.delete(accessToken);
|
||||
// 删除刷新令牌
|
||||
oauth2RefreshTokenMapper.deleteByRefreshToken(accessTokenDO.getRefreshToken());
|
||||
return accessTokenDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.cf.imes.module.system.validation.menu;
|
||||
|
||||
import javax.validation.Constraint;
|
||||
import javax.validation.Payload;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* 菜单类型校验注解
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/10/21 11:25
|
||||
*/
|
||||
@Target({
|
||||
ElementType.PARAMETER,
|
||||
ElementType.FIELD,
|
||||
})
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Documented
|
||||
@Constraint(
|
||||
validatedBy = {MenuTypeValidator.class}
|
||||
)
|
||||
public @interface MenuTypeValid {
|
||||
String message() default "菜单类型不合法";
|
||||
|
||||
Class<?>[] groups() default {};
|
||||
|
||||
Class<? extends Payload>[] payload() default {};
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.cf.imes.module.system.validation.menu;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.cf.imes.module.system.enums.permission.MenuTypeEnum;
|
||||
|
||||
import javax.validation.ConstraintValidator;
|
||||
import javax.validation.ConstraintValidatorContext;
|
||||
|
||||
/**
|
||||
* 菜单类型校验器
|
||||
*
|
||||
* @author Gqr
|
||||
* @since 2024/10/21 11:26
|
||||
*/
|
||||
public class MenuTypeValidator implements ConstraintValidator<MenuTypeValid, Integer> {
|
||||
@Override
|
||||
public boolean isValid(Integer value, ConstraintValidatorContext context) {
|
||||
if (ObjectUtil.isNull(value)) {
|
||||
return true;
|
||||
}
|
||||
for (MenuTypeEnum typeEnum : MenuTypeEnum.values()) {
|
||||
if (ObjectUtil.equal(typeEnum.getType(), value)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user