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