zhou zhou
1 天以前 1dcfa3702505f0c431757312b5304531029f90f6
rsf-server/src/main/java/com/vincent/rsf/server/manager/entity/Task.java
@@ -7,6 +7,7 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.vincent.rsf.server.manager.enums.TaskType;
import com.vincent.rsf.server.system.constant.DictTypeCode;
import com.vincent.rsf.server.system.entity.DictData;
import com.vincent.rsf.server.system.service.DictDataService;
@@ -55,6 +56,11 @@
    @TableField(exist = false,select = false)
    @ApiModelProperty(value = "是否可点击完成(有当前步骤且非终态)")
    private Boolean canComplete;
    /** 是否可取消:流程步骤能对应上 taskStatus 且未到最后一步(9999) 时为 true */
    @TableField(exist = false, select = false)
    @ApiModelProperty(value = "是否可取消")
    private Boolean canCancel;
    @ApiModelProperty("上级任务ID")
    private Long parentId;
@@ -170,6 +176,9 @@
    @ApiModelProperty(value= "添加人员")
    private Long createBy;
    @TableField(exist = false)
    private String createBy$;
    /**
     * 添加时间
     */
@@ -184,6 +193,9 @@
    @ApiModelProperty(value= "修改人员")
    private Long updateBy;
    @TableField(exist = false)
    private String updateBy$;
    /**
     * 修改时间
     */
@@ -191,6 +203,9 @@
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date updateTime;
    @Version
    private Integer version;
    /**
     * 备注
@@ -222,6 +237,19 @@
    private String targLocArea;
    private String targSiteAreaNow;
    @TableField(exist = false)
    private String taskStatus$;
    @TableField(exist = false)
    private String warehType$;
    @TableField(exist = false)
    private String orgSite$;
    @TableField(exist = false)
    private String targSite$;
    public Task() {}
@@ -273,54 +301,18 @@
//            null    // 备注
//    );
//    public String getParentId$() {
//        if (Cools.isEmpty(this.parentId)) {
//            return null;
//        }
//        TaskService taskService = SpringUtils.getBean(TaskService.class);
//        Task task = taskService.getById(this.parentId);
//        return task.getTaskCode();
//    }
    public String getTaskStatus$(){
        if (Cools.isEmpty(this.taskStatus)) {
            return null;
        }
        DictDataService dictDataService = SpringUtils.getBean(DictDataService.class);
        DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>()
                .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_TASK_STATUS)
                .eq(DictData::getValue, this.taskStatus));
        if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) {
            return null;
        }
        return dictDatas.getValue() + "." + dictDatas.getLabel();
        return this.taskStatus$;
    }
    public String getWarehType$(){
        if (null == this.warehType){ return null; }
        DictDataService dictDataService = SpringUtils.getBean(DictDataService.class);
        DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>()
                .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_DEVICE_TYPE)
                .eq(DictData::getValue, warehType));
        if (Objects.isNull(dictDatas)) {
            return null;
        }
        return dictDatas.getLabel();
        return this.warehType$;
    }
    public String getTaskType$() {
        if (Cools.isEmpty(this.taskType)) {
            return null;
        }
        DictDataService dictDataService = SpringUtils.getBean(DictDataService.class);
        DictData dictDatas = dictDataService.getOne(new LambdaQueryWrapper<DictData>()
                .eq(DictData::getDictTypeCode, DictTypeCode.DICT_SYS_TASK_TYPE)
                .eq(DictData::getValue, this.taskType));
        if (Objects.isNull(dictDatas) || Objects.isNull(dictDatas.getLabel())) {
            return null;
        }
        return dictDatas.getValue() + "." + dictDatas.getLabel();
        return TaskType.getTypeDesc(taskType);
    }
    public String getStartTime$(){
@@ -349,29 +341,11 @@
        }
    }
    public String getCreateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.getById(this.createBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public String getCreateTime$(){
        if (Cools.isEmpty(this.createTime)){
            return "";
        }
        return new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(this.createTime);
    }
    public String getUpdateBy$(){
        UserService service = SpringUtils.getBean(UserService.class);
        User user = service.getById(this.updateBy);
        if (!Cools.isEmpty(user)){
            return String.valueOf(user.getNickname());
        }
        return null;
    }
    public String getUpdateTime$(){
@@ -398,32 +372,14 @@
     * 获取源站点名称(站点编号 + 站点名称)
     */
    public String getOrgSite$(){
        if (Cools.isEmpty(this.orgSite)) {
            return this.orgSite;
        }
        BasStationService basStationService = SpringUtils.getBean(BasStationService.class);
        BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                .eq(BasStation::getStationName, this.orgSite));
        if (!Cools.isEmpty(station) && !Cools.isEmpty(station.getStationId())) {
            return this.orgSite + "(" + station.getStationId() + ")";
        }
        return this.orgSite;
        return this.orgSite$;
    }
    /**
     * 获取目标站点名称(站点编号 + 站点名称)
     */
    public String getTargSite$(){
        if (Cools.isEmpty(this.targSite)) {
            return this.targSite;
        }
        BasStationService basStationService = SpringUtils.getBean(BasStationService.class);
        BasStation station = basStationService.getOne(new LambdaQueryWrapper<BasStation>()
                .eq(BasStation::getStationName, this.targSite));
        if (!Cools.isEmpty(station) && !Cools.isEmpty(station.getStationId())) {
            return this.targSite + "(" + station.getStationId() + ")";
        }
        return this.targSite;
        return this.targSite$;
    }
}