📄 orderlist.java
字号:
package com.easyjf.asp.business;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
import com.easyjf.dbo.EasyJDB;
import com.easyjf.dbo.IObject;
import com.easyjf.util.CommUtil;
public class OrderList implements IObject,Comparable {
private String cid;
private String orderSn;
private String productSn;
private String title;
private String types;
private Float num;
private Float width;
private Float height;
private BigDecimal price;
private BigDecimal amount;
private String unit;
private Integer status;
private Integer sequence;
private Integer unitType;
private Integer cou;
private Date vdate;
private final String[][] statusTitle={{"-1","暂不生产"},{"0","当日生产"},{"2","已生产"}};
private final String[][] unitTypeTitle={{"0","平方"},{"1","长度"}};
private final DecimalFormat df=new DecimalFormat("0.00");
public static OrderList read(String cid)
{
EasyJDB db=EasyJDB.getInstance();
return (OrderList)db.get(OrderList.class,cid);
}
public static List query(String scope)
{
EasyJDB db=EasyJDB.getInstance();
return db.query(OrderList.class,scope);
}
public boolean save()
{
EasyJDB db=EasyJDB.getInstance();
return db.add(this);
}
public boolean update()
{
EasyJDB db=EasyJDB.getInstance();
return db.update(this);
}
public boolean del()
{
EasyJDB db=EasyJDB.getInstance();
return db.del(this);
}
public String getTableName() {
// TODO Auto-generated method stub
return "OrderList";
}
public String getKeyField() {
// TODO Auto-generated method stub
return "cid";
}
public String getKeyGenerator() {
// TODO Auto-generated method stub
return "com.easyjf.dbo.IdGenerator";
}
public String showStatus()
{
return CommUtil.getSelectOptions(statusTitle,status!=null?status.toString():"0");
}
public String showUnitType()
{
return CommUtil.getSelectOptions(unitTypeTitle,unitType!=null?unitType.toString():"0");
}
//打印使用,根据unitType进行单位换算并显示在打印单据上
//统一显示为毫米
public String printWidth()
{
return ""+(new BigDecimal(this.width.floatValue() *1000).setScale(0,BigDecimal.ROUND_CEILING)).toString();
}
//统一显示为毫米
public String printHeight()
{
return ""+(new BigDecimal(this.height.floatValue()*1000)).setScale(0,BigDecimal.ROUND_CEILING).toString();
}
//根据unitType进行价格转换
public String printPrice()
{
if(unitType==null || (unitType.intValue()==0))return df.format(price.setScale(2,BigDecimal.ROUND_CEILING));
String ret= df.format(new BigDecimal(this.price.floatValue()*this.height.floatValue()).setScale(2,BigDecimal.ROUND_CEILING));
return ret;
}
//若unitType为1则显示为1
public String printNum()
{
if(unitType!=null && (unitType.intValue()==1)) return "1";
else
return ""+num;
}
public String printUnit()
{
if(unitType!=null && (unitType.intValue()==1)) return "米";
else
return unit;
}
//颜色
public String showColor()
{
String ret="";
if(status!=null)
{
if(status.intValue()==-1)ret="yellow";
else if(status.intValue()==2)ret="blue";
}
return ret;
}
public BigDecimal getAmount() {
return amount;
}
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
public String getCid() {
return cid;
}
public void setCid(String cid) {
this.cid = cid;
}
public Float getNum() {
return num;
}
public void setNum(Float num) {
this.num = num;
}
public String getOrderSn() {
return orderSn;
}
public void setOrderSn(String orderSn) {
this.orderSn = orderSn;
}
public BigDecimal getPrice() {
return price;
}
public void setPrice(BigDecimal price) {
this.price = price;
}
public String getProductSn() {
return productSn;
}
public void setProductSn(String productSn) {
this.productSn = productSn;
}
public Integer getStatus() {
return status;
}
public void setStatus(Integer status) {
this.status = status;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public Integer getSequence() {
return sequence;
}
public void setSequence(Integer sequence) {
this.sequence = sequence;
}
public String getTypes() {
return types;
}
public void setTypes(String types) {
this.types = types;
}
public Float getHeight() {
return height;
}
public void setHeight(Float height) {
this.height = height;
}
public Float getWidth() {
return width;
}
public void setWidth(Float width) {
this.width = width;
}
public Integer getUnitType() {
return unitType;
}
public void setUnitType(Integer unitType) {
this.unitType = unitType;
}
public Integer getCou() {
return cou;
}
public void setCou(Integer cou) {
this.cou = cou;
}
public int compareTo(Object o) {
OrderList m = (OrderList) o;
return (this.sequence.intValue()- m.sequence.intValue());
}
public Date getVdate() {
return vdate;
}
public void setVdate(Date vdate) {
this.vdate = vdate;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -