skyouc
3 天以前 db0da79142146cd3de6e7fcca92dceeceb6d2665
rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/BasStation.java
@@ -4,8 +4,10 @@
import java.util.*;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.vincent.rsf.server.manager.enums.StationTypeEnum;
import com.vincent.rsf.server.manager.service.WarehouseAreasService;
import com.vincent.rsf.server.system.entity.DictData;
import com.vincent.rsf.server.system.service.DictDataService;
@@ -43,6 +45,9 @@
     */
    @ApiModelProperty(value= "站点名称")
    private String stationName;
    @ApiModelProperty("站点类型: {0:光电, 1:无光电}")
    private Integer type;
    /**
     * 可入
@@ -117,6 +122,10 @@
    @ApiModelProperty(value= "备注")
    private String memo;
    @ApiModelProperty(value= "是否删除 1: 是  0: 否  ")
    @TableLogic
    private Integer deleted;
    /**
     * 创建人
     */
@@ -143,6 +152,9 @@
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    @ApiModelProperty(value= "状态")
    private Integer status;
    /**
     * 所属机构
     */
@@ -150,34 +162,17 @@
    private Long tenantId;
    @TableField(exist = false)
    private Long[] areaIds;
    private List<Long> areaIds;
    @TableField(exist = false)
    private Long[] containerTypes;
    private List<Long> containerTypes;
    public BasStation() {}
//    BasStation basStation = new BasStation(
//            null,    // 站点名称
//            null,    // 可入
//            null,    // 可出
//            null,    // 状态
//            null,    // 所属库区id
//            null,    // 是否可跨区
//            null,    // 可跨区区域id
//            null,    // 是否wcs站点
//            null,    // wcs站点信息
//            null,    // 容器类型
//            null,    // 条码
//            null,    // 是否自动调拨
//            null,    // 备注
//            null,    // 创建人
//            null,    // 创建时间
//            null,    // 更新人
//            null    // 更新时间
//    );
    public String getType$() {
        if (this.type == null) return null;
        return StationTypeEnum.getStationDesc(this.type);
    }
    public List<Long> getContainerTypes$(){
        if (Cools.isEmpty(this.containerType)){
@@ -185,16 +180,11 @@
        }
        DictDataService service = SpringUtils.getBean(DictDataService.class);
        String content = this.getContainerType().substring(1, this.getContainerType().length() - 1);
        String[] parts = content.split(",");
        Long[] longArray = new Long[parts.length];
        for (int i = 0; i < parts.length; i++) {
            longArray[i] = Long.parseLong(parts[i].trim());
        }
        Object parse = JSONArray.parse(this.getContainerType());
        List<Long> longs1 = JSONObject.parseArray(parse.toString(), Long.class);
        List<DictData> dictData = service.list(new LambdaQueryWrapper<DictData>()
                .eq(DictData::getDictTypeCode, "sys_container_type")
                .in(DictData::getValue, longArray)
                .in(DictData::getValue, longs1)
        );
        List<Long> longs = dictData.stream().map(DictData::getId).collect(Collectors.toList());
        return longs;
@@ -240,4 +230,17 @@
        }
        return null;
    }
    public Boolean getStatusBool(){
        if (null == this.status){ return null; }
        switch (this.status){
            case 1:
                return true;
            case 0:
                return false;
            default:
                return null;
        }
    }
}