package com.dev.swms.server.action.formatter;

import java.util.Date;
import java.util.List;

import com.dev.energy.server.format.Formatter;
import com.dev.swms.server.model.base.LocationType;

public class ColourFormatter implements Formatter  {
	public String format(String property, Object type, List origenData,
			String referenceModel, String locale) {
		
		if("TRANSIT".equals(type)){
			return "<div style='background-color:#CAFFFF' >" + "拣货" + "</div>";
		} else if("BAD".equals(type)){
			return "<div style='background-color:red' >" + "残次品" + "</div>";
		}else {
			if(type.equals(LocationType.STORAGE)){
				return "存货";
			}else if(type.equals(LocationType.RECEIVE)){
				return "收货";
			}else if(type.equals(LocationType.SHIP)){
				return "发货";
			}else if(type.equals(LocationType.COUNT)){
				return "盘点";
			}else if(type.equals(LocationType.PROCESS)){
				return "加工";
			}else if(type.equals(LocationType.QUALITY)){
				return "质检";
			}else if(type.equals(LocationType.TRANSIT)){
				return "拣货";
			}else if(type.equals(LocationType.RECEIVE)){
				return "收货";
			}else if(type.equals(LocationType.BAD)){
				return "残次品";
			}else if(type.equals(LocationType.READY)){
				return "备货";
			}else if(type.equals("")||type==null) {
				type="-";
			}
			return type.toString();
		}
	}
}
