1
1 天以前 9f43ee66e8fa2e0d02945f4bdd40d9c3a53a4bd7
rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/DeviceSite.java
@@ -6,6 +6,8 @@
import java.util.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.vincent.rsf.server.manager.service.BasStationService;
import com.vincent.rsf.server.manager.service.LocTypeService;
import com.vincent.rsf.server.system.constant.DictTypeCode;
import com.vincent.rsf.server.system.entity.DictData;
@@ -64,8 +66,8 @@
    /**
     * wcs站点编号
     */
    @ApiModelProperty(value= "wcs站点编号")
    private String wcsCode;
    @ApiModelProperty(value= "目标位置")
    private String target;
    /**
     * 站点标签
@@ -82,7 +84,7 @@
    /**
     * 设备编号
     */
    @ApiModelProperty(value= "设备编号")
    @ApiModelProperty(value= "接驳位")
    private String deviceCode;
    /**
@@ -104,6 +106,10 @@
    @TableLogic
    private Integer deleted;
    @ApiModelProperty(value= "巷道")
    private Integer channel;
    /**
     * 租户
     */
@@ -121,6 +127,7 @@
     */
    @ApiModelProperty(value= "添加时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date createTime;
    /**
@@ -134,6 +141,7 @@
     */
    @ApiModelProperty(value= "修改时间")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;
@@ -148,13 +156,19 @@
    @ApiModelProperty(value= "备注")
    private String memo;
    @ApiModelProperty("源库区")
    private Long areaIdStart;
    @ApiModelProperty("目标库区")
    private Long areaIdEnd;
    public DeviceSite() {}
    public DeviceSite(String type,String site,String name,String wcsCode,String label,String device,String deviceCode,String deviceSite,Integer status,Integer deleted,Integer tenantId,Long createBy,Date createTime,Long updateBy,Date updateTime,String memo) {
        this.type = type;
        this.site = site;
        this.name = name;
        this.wcsCode = wcsCode;
        this.target = wcsCode;
        this.label = label;
        this.device = device;
        this.deviceCode = deviceCode;
@@ -188,6 +202,23 @@
//            null    // 备注
//    );
//    public String getSite$() {
//        if (this.site == null) {return  null;}
//        BasStationService service = SpringUtils.getBean(BasStationService.class);
//        BasStation station = service.getOne(new LambdaQueryWrapper<BasStation>().eq(BasStation::getStationName, this.site));
//        if (Objects.isNull(station)) {return  null;}
//        return station.getStationName();
//    }
//
//    public String getDeviceSite$() {
//        if (this.deviceSite == null) {return  null;}
//        BasStationService service = SpringUtils.getBean(BasStationService.class);
//        BasStation station = service.getById(this.deviceSite);
//        if (Objects.isNull(station)) {return  null;}
//        return station.getStationName();
//    }
    public String getType$(){
        if (null == this.type){ return null; }
        String[] split = this.type.split(",");
@@ -198,7 +229,26 @@
        DictDataService dictDataService = SpringUtils.getBean(DictDataService.class);
        List<DictData> dictDatas = dictDataService.list(new LambdaQueryWrapper<DictData>()
                .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_TASK_TYPE)
                .in(DictData::getId, asList));
                .in(DictData::getValue, asList));
        if (dictDatas.isEmpty()) {
            return null;
        }
        List<String> strings = dictDatas.stream().map(DictData::getLabel).collect(Collectors.toList());
        return StringUtils.join(strings, ",");
    }
    public String getDevice$(){
        if (null == this.device){ return null; }
        String[] split = this.device.split(",");
        List<String> asList = Arrays.asList(split);
        if (asList.isEmpty()) {
            return null;
        }
        DictDataService dictDataService = SpringUtils.getBean(DictDataService.class);
        List<DictData> dictDatas = dictDataService.list(new LambdaQueryWrapper<DictData>()
                .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_DEVICE_TYPE)
                .in(DictData::getValue, asList));
        if (dictDatas.isEmpty()) {
            return null;
        }