package com.sa.ibiz.demo.mob.controller.demo.vo;

import java.sql.Timestamp;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonProperty.Access;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.ArrayList;
import java.util.List;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.Data;
import com.sa.ibiz.demo.demo.domain.WFWorkList;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class WFWorkList_MOBMDCTRL_Usr{
    private String wfworkflowname;
    private String userdatainfo;
    private String wfstepname;
    private String createdate;
    private String srfkey;
    private String srfmajortext;
    private String originalwfuserid;
    private String wfinstanceid;

     public  void fromWFWorkList(WFWorkList sourceEntity)  {
	    this.setWfworkflowname(String.format("%s",sourceEntity.getWfworkflowname()));
	    this.setUserdatainfo(String.format("%s",sourceEntity.getUserdatainfo()));
	    this.setWfstepname(String.format("%s",sourceEntity.getWfstepname()));
	    this.setCreatedate(String.format("%s",sourceEntity.getCreatedate()));
	    this.setSrfkey(String.format("%s",sourceEntity.getWfworklistid()));
	    this.setSrfmajortext(String.format("%s",sourceEntity.getWfworklistname()));
	    this.setOriginalwfuserid(String.format("%s",sourceEntity.getOriginalwfuserid()));
	    this.setWfinstanceid(String.format("%s",sourceEntity.getWfinstanceid()));
	}

	public static Page<WFWorkList_MOBMDCTRL_Usr> fromWFWorkList(Page<WFWorkList> sourcePage)   {
        if(sourcePage==null)
            return null;
        Page<WFWorkList_MOBMDCTRL_Usr> targetpage=new Page<WFWorkList_MOBMDCTRL_Usr>(sourcePage.getCurrent(),sourcePage.getSize(),sourcePage.getTotal(),sourcePage.isSearchCount());
        List<WFWorkList_MOBMDCTRL_Usr> records=new ArrayList<WFWorkList_MOBMDCTRL_Usr>();
        for(WFWorkList source:sourcePage.getRecords()) {
    WFWorkList_MOBMDCTRL_Usr target=new WFWorkList_MOBMDCTRL_Usr();
            target.fromWFWorkList(source);
            records.add(target);
        }
        targetpage.setAsc(sourcePage.ascs());
        targetpage.setDesc(sourcePage.descs());
        targetpage.setOptimizeCountSql(sourcePage.optimizeCountSql());
        targetpage.setRecords(records);
        return targetpage;
    }

}