mirror of
http://192.168.1.205:9980/cf_devdept2/cf_imes_server.git
synced 2026-08-12 21:02:08 +08:00
Merge branch 'main' of ssh://192.168.1.205:9922/cf_devdept2/cf_imes_server
This commit is contained in:
+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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user