package org.jeecg.modules.stm.common.vo;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.jeecg.modules.stm.common.json.String2ArrayDeserialize;


import java.util.List;

/**
 * @Author: yzh
 * @Date 2023/4/7 21:15
 * @Description:
 */
public class DutyVo {
    private String code;
    private String uname;
    private String postName;
    private String departName;
    private String depCode;
    private String dutyName;

    @JsonDeserialize(using = String2ArrayDeserialize.class)
    private List<String> depIds;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getUname() {
        return uname;
    }

    public void setUname(String uname) {
        this.uname = uname;
    }

    public String getPostName() {
        if(postName==null){
            return "";
        }
        return postName;
    }

    public void setPostName(String postName) {
        this.postName = postName;
    }

    public String getDepartName() {
        return departName;
    }

    public void setDepartName(String departName) {
        this.departName = departName;
    }

    public String getDutyName() {
        if(dutyName==null){
            return "";
        }
        return dutyName;
    }

    public void setDutyName(String dutyName) {
        this.dutyName = dutyName;
    }

    public String initDutyNames(){
       this.dutyName =
               String.format("%s/%s-%s", this.getDepartName(),this.getPostName(),this.getUname());
       return this.dutyName;
    }

    public String getDepCode() {
        return depCode;
    }

    public void setDepCode(String depCode) {
        this.depCode = depCode;
    }

    public List<String> getDepIds() {
        return depIds;
    }

    public void setDepIds(List<String> depIds) {
        this.depIds = depIds;
    }
}
