package com.vincent.rsf.server.api.controller.erp.params;
|
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModelProperty;
|
import lombok.Data;
|
import lombok.experimental.Accessors;
|
|
import java.util.Map;
|
|
/**
|
* 库存查询明细条件参数(供ERP调用)
|
* 对应open-api的InventoryQueryCondition
|
*/
|
@Data
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
@Accessors(chain = true)
|
@ApiModel(value = "InventoryQueryConditionParam", description = "库存查询明细条件参数")
|
public class InventoryQueryConditionParam {
|
|
/**
|
* 仓库编码
|
*/
|
@ApiModelProperty(value = "仓库编码")
|
private String wareHouseId;
|
|
/**
|
* 库位编码
|
*/
|
@ApiModelProperty(value = "库位编码")
|
private String locId;
|
|
/**
|
* 物料编码
|
*/
|
@ApiModelProperty(value = "物料编码")
|
private String matNr;
|
|
/**
|
* 订单号/工单号/MES工单号
|
*/
|
@ApiModelProperty(value = "订单号/工单号/MES工单号")
|
private String orderNo;
|
|
/**
|
* 计划跟踪号
|
*/
|
@ApiModelProperty(value = "计划跟踪号")
|
private String planNo;
|
|
/**
|
* 批次号
|
*/
|
@ApiModelProperty(value = "批次号")
|
private String batch;
|
|
/**
|
* 物料组
|
*/
|
@ApiModelProperty(value = "物料组")
|
private String matGroup;
|
|
/**
|
* 从Map构造InventoryQueryConditionParam对象
|
* 用于接收其他方法返回的Map参数并自动转换
|
*
|
* @param map 查询条件Map
|
* @return InventoryQueryConditionParam对象
|
*/
|
public static InventoryQueryConditionParam fromMap(Map<String, Object> map) {
|
if (map == null) {
|
return null;
|
}
|
InventoryQueryConditionParam param = new InventoryQueryConditionParam();
|
if (map.containsKey("wareHouseId")) {
|
param.setWareHouseId((String) map.get("wareHouseId"));
|
}
|
if (map.containsKey("locId")) {
|
param.setLocId((String) map.get("locId"));
|
}
|
if (map.containsKey("matNr")) {
|
param.setMatNr((String) map.get("matNr"));
|
}
|
if (map.containsKey("orderNo")) {
|
param.setOrderNo((String) map.get("orderNo"));
|
}
|
if (map.containsKey("planNo")) {
|
param.setPlanNo((String) map.get("planNo"));
|
}
|
if (map.containsKey("batch")) {
|
param.setBatch((String) map.get("batch"));
|
}
|
if (map.containsKey("matGroup")) {
|
param.setMatGroup((String) map.get("matGroup"));
|
}
|
return param;
|
}
|
|
/**
|
* 转换为Map(用于兼容需要Map参数的方法)
|
*
|
* @return Map对象
|
*/
|
public Map<String, Object> toMap() {
|
Map<String, Object> map = new java.util.HashMap<>();
|
if (wareHouseId != null) {
|
map.put("wareHouseId", wareHouseId);
|
}
|
if (locId != null) {
|
map.put("locId", locId);
|
}
|
if (matNr != null) {
|
map.put("matNr", matNr);
|
}
|
if (orderNo != null) {
|
map.put("orderNo", orderNo);
|
}
|
if (planNo != null) {
|
map.put("planNo", planNo);
|
}
|
if (batch != null) {
|
map.put("batch", batch);
|
}
|
if (matGroup != null) {
|
map.put("matGroup", matGroup);
|
}
|
return map;
|
}
|
}
|