Browse Source

add:查询空载具接口

master
zhangzq 4 months ago
parent
commit
f76b1a1581
  1. 47
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/enums/VehicleEnum.java
  2. 5
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/enums/region/RegionEnum.java
  3. 7
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java
  4. 2
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/SchBasePoint.java
  5. 39
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dto/PointMaterialInfo.java
  6. 24
      lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

47
lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/enums/VehicleEnum.java

@ -0,0 +1,47 @@
/*
* Copyright 2019-2020 Zheng Jie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.nl.common.enums;
import lombok.AllArgsConstructor;
import lombok.Getter;
/**
* 载具美剧
*/
@Getter
@AllArgsConstructor
public enum VehicleEnum {
/* 旧邮箱修改邮箱 */
S("1", "小"),
/* 通过邮箱修改密码 */
M("2", "中"),
L("3", "大"),
XL("4", "更大");
private final String code;
private final String description;
public static VehicleEnum find(Integer code) {
for (VehicleEnum value : VehicleEnum.values()) {
if (code.equals(value.getCode())) {
return value;
}
}
return null;
}
}

5
lms/nladmin-system/nlsso-server/src/main/java/org/nl/common/enums/region/RegionEnum.java

@ -8,8 +8,9 @@ import lombok.Getter;
public enum RegionEnum { public enum RegionEnum {
STAMPING_AND_BLANKING("Amada 80T冲床(手动加工)","111-06"), STAMPING_AND_BLANKING("Amada 80T冲床(手动加工)","111-06"),
TRUBEND_SHELVES_3_1_1("TruBend 7036货架03-01-01","111-07"); TRUBEND_SHELVES_3_1_1("TruBend 7036货架03-01-01","111-07"),
ZDFJ("分拣工序","111-08"),
;
private final String region_name; private final String region_name;
private final String region_code; private final String region_code;

7
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/ISchBasePointService.java

@ -81,10 +81,11 @@ public interface ISchBasePointService extends IService<SchBasePoint> {
SchBasePoint selectByRegionCode(String region_code,String vehicleCode); SchBasePoint selectByRegionCode(String region_code,String vehicleCode);
/** /**
* 根据工序查询区域空点位 * 根据工序查询区域空载具
* @param region_code * 没有点位则返回null
* @param region_code,vehicleType托盘类型允许多种类型
*/ */
SchBasePoint selectEmpPointByRegionCode(String region_code,String vehicleCode); SchBasePoint selectEmpVehicleByRegionCode(String region_code, String...vehicleType);
/** /**

2
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dao/SchBasePoint.java

@ -40,7 +40,7 @@ public class SchBasePoint implements Serializable {
@ApiModelProperty(value = "点位类型") @ApiModelProperty(value = "点位类型")
private String point_type; private String point_type;
@ApiModelProperty(value = "点位状态") @ApiModelProperty(value = "点位状态0无货1空托盘2有料")
private String point_status; private String point_status;
@ApiModelProperty(value = "允许的物料类型") @ApiModelProperty(value = "允许的物料类型")

39
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/dto/PointMaterialInfo.java

@ -0,0 +1,39 @@
package org.nl.wms.sch.point.service.dto;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.nl.wms.sch.point.service.dao.SchBasePoint;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @description /
* @author lyd
* @date 2023-05-15
**/
@Data
public class PointMaterialInfo extends SchBasePoint {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "组盘标识")
private String group_id;
@ApiModelProperty(value = "物料标识")
private String material_id;
@ApiModelProperty(value = "批次")
private String pcsn;
@ApiModelProperty(value = "物料数量")
private Integer material_qty;
@ApiModelProperty(value = "物料重量")
private BigDecimal material_weight;
@ApiModelProperty(value = "额外信息")
private String ext_data;
private String region_name;
}

24
lms/nladmin-system/nlsso-server/src/main/java/org/nl/wms/sch/point/service/impl/SchBasePointServiceImpl.java

@ -30,6 +30,9 @@ import org.nl.wms.sch.task_manage.enums.PointStatusEnum;
import org.nl.wms.util.PointUtils; import org.nl.wms.util.PointUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -319,7 +322,24 @@ public class SchBasePointServiceImpl extends ServiceImpl<SchBasePointMapper, Sch
} }
@Override @Override
public SchBasePoint selectEmpPointByRegionCode(String region_code, String vehicleCode) { @Transactional(propagation= Propagation.REQUIRES_NEW)
return null; public SchBasePoint selectEmpVehicleByRegionCode(String region_code, String...vehicleType) {
synchronized(region_code){
//查询满足条件的站点
List<SchBasePoint> schBasePoints = pointMapper.selectList(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getIs_lock, false).
isNotNull(SchBasePoint::getVehicle_code)
.eq(SchBasePoint::getRegion_code, region_code)
.eq(SchBasePoint::getPoint_status,GoodsEnum.EMPTY_PALLETS.getValue())
.in(SchBasePoint::getVehicle_type, vehicleType)
.eq(SchBasePoint::getIs_used, true));
if(CollectionUtils.isEmpty(schBasePoints)) {
return null;
}
SchBasePoint schBasePoint = schBasePoints.get(0);
this.update(new UpdateWrapper<SchBasePoint>()
.set("is_lock",true)
.eq("point_code",schBasePoint.getPoint_code()));
return schBasePoint;
}
} }
} }

Loading…
Cancel
Save