批次规则的修改
This commit is contained in:
+9
@@ -37,6 +37,15 @@ public class StockInOrderAssembler {
|
||||
* 转换实体
|
||||
*/
|
||||
public StockInOrderDO toDOByEdit(StockInOrderDTO stockInOrderDTO) {
|
||||
// 兼容前端传 userName 作为货主名称字段的情况:
|
||||
// 如果 shipperName 为空但 userName 有值,则优先回填到 shipperName,
|
||||
// 以保证后续 shipperParam 能根据名称正确找到货主ID。
|
||||
if (ObjectUtil.isNull(stockInOrderDTO.getShipperId())
|
||||
&& (stockInOrderDTO.getShipperName() == null || stockInOrderDTO.getShipperName().trim().length() == 0)
|
||||
&& stockInOrderDTO.getUserName() != null && stockInOrderDTO.getUserName().trim().length() > 0) {
|
||||
stockInOrderDTO.setShipperName(stockInOrderDTO.getUserName().trim());
|
||||
}
|
||||
|
||||
StockInOrderDO stockInOrderDO = JSONUtil.toBean(JSONUtil.toJsonStr(stockInOrderDTO), StockInOrderDO.class);
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
|
||||
@@ -51,6 +51,13 @@ public class StockInOrderBaseDTO extends BaseVOEntity {
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
/**
|
||||
* 兼容前端使用 userName 作为货主名称字段:
|
||||
* 如果请求体中只传了 userName,将在组装器中自动回填到 shipperName。
|
||||
*/
|
||||
@ApiModelProperty("货主名称(兼容字段:userName)")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty("入库单类型编码")
|
||||
@Excel(name = "入库单类型编码")
|
||||
private String orderTypeCode;
|
||||
|
||||
Reference in New Issue
Block a user