package kr.wisestone.owl.web.form;
|
|
import com.google.common.collect.Lists;
|
import kr.wisestone.owl.constant.UsePartner;
|
import kr.wisestone.owl.util.ConvertUtil;
|
import kr.wisestone.owl.util.MapUtil;
|
|
import java.util.List;
|
import java.util.Map;
|
|
/**
|
* Created by wisestone on 2018-05-29.
|
*/
|
public class IssueTypeForm {
|
private Long id;
|
private String name;
|
private String description;
|
private String color;
|
private Long workflowId;
|
private Long projectId;
|
private List<Long> removeIds = Lists.newArrayList();
|
private Long usePartner;
|
|
public IssueTypeForm(){}
|
|
public static IssueTypeForm make(Map<String, Object> params) {
|
IssueTypeForm form = ConvertUtil.convertMapToClass(params, IssueTypeForm.class);
|
|
if (MapUtil.getLongs(params, "removeIds") != null) {
|
form.setRemoveIds(MapUtil.getLongs(params, "removeIds"));
|
}
|
|
if (MapUtil.getLongs(params, "companyIds") != null) {
|
// form.setRemoveIds(MapUtil.getLongs(params, "companyIds"));
|
List<Long> longs = MapUtil.getLongs(params, "companyIds");
|
form.usePartner = 0L;
|
|
for (Long id : longs) {
|
if (id == UsePartner.USE_PARTNER_COMPANY - 1) {
|
form.usePartner += 1;
|
} else {
|
form.usePartner += id * 2;
|
}
|
}
|
}
|
|
return form;
|
}
|
|
public Long getId() {
|
return id;
|
}
|
|
public void setId(Long id) {
|
this.id = id;
|
}
|
|
public String getName() {
|
return name;
|
}
|
|
public void setName(String name) {
|
this.name = name;
|
}
|
|
public String getDescription() {
|
return description;
|
}
|
|
public void setDescription(String description) {
|
this.description = description;
|
}
|
|
public String getColor() {
|
return color;
|
}
|
|
public void setColor(String color) {
|
this.color = color;
|
}
|
|
public Long getWorkflowId() {
|
return workflowId;
|
}
|
|
public void setWorkflowId(Long workflowId) {
|
this.workflowId = workflowId;
|
}
|
|
public List<Long> getRemoveIds() {
|
return removeIds;
|
}
|
|
public void setRemoveIds(List<Long> removeIds) {
|
this.removeIds = removeIds;
|
}
|
|
public void addRemoveIds(Long removeId) {
|
this.removeIds.add(removeId);
|
}
|
|
public Long getProjectId() {
|
return projectId;
|
}
|
|
public void setProjectId(Long projectId) {
|
this.projectId = projectId;
|
}
|
|
public Long getUsePartner() {
|
return usePartner;
|
}
|
|
public void setUsePartner(Long usePartner) {
|
this.usePartner = usePartner;
|
}
|
}
|