给商品增加“规格”字段
This commit is contained in:
@@ -153,8 +153,9 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
item.put("Id", depotItem.getId());
|
||||
item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
|
||||
String MaterialName = ((depotItem.getMaterialId().getModel().equals(""))?"":""+depotItem.getMaterialId().getModel())+" "+depotItem.getMaterialId().getName()
|
||||
+((depotItem.getMaterialId().getColor() == null)?"(":"("+depotItem.getMaterialId().getColor()) + ")"
|
||||
+((depotItem.getMaterialId().getUnit() == null)?"(":"("+depotItem.getMaterialId().getUnit()) + ")";
|
||||
+((depotItem.getMaterialId().getStandard() == null||depotItem.getMaterialId().getStandard().equals(""))?"":"("+depotItem.getMaterialId().getStandard() + ")")
|
||||
+((depotItem.getMaterialId().getColor() == null||depotItem.getMaterialId().getColor().equals(""))?"":"("+depotItem.getMaterialId().getColor() + ")")
|
||||
+((depotItem.getMaterialId().getUnit() == null||depotItem.getMaterialId().getUnit().equals(""))?"":"("+depotItem.getMaterialId().getUnit() + ")");
|
||||
item.put("MaterialName", MaterialName);
|
||||
item.put("OperNumber", depotItem.getOperNumber());
|
||||
item.put("UnitPrice", depotItem.getUnitPrice());
|
||||
@@ -210,6 +211,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
|
||||
item.put("MaterialName", depotItem.getMaterialId().getName());
|
||||
item.put("MaterialModel", depotItem.getMaterialId().getModel());
|
||||
item.put("MaterialStandard", depotItem.getMaterialId().getStandard());
|
||||
item.put("MaterialColor", depotItem.getMaterialId().getColor());
|
||||
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
|
||||
item.put("prevSum", prevSum);
|
||||
@@ -266,6 +268,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
|
||||
item.put("MaterialName", depotItem.getMaterialId().getName());
|
||||
item.put("MaterialModel", depotItem.getMaterialId().getModel());
|
||||
item.put("MaterialStandard", depotItem.getMaterialId().getStandard());
|
||||
item.put("MaterialColor", depotItem.getMaterialId().getColor());
|
||||
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
|
||||
item.put("InSum", InSum);
|
||||
@@ -324,6 +327,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
|
||||
item.put("MaterialName", depotItem.getMaterialId().getName());
|
||||
item.put("MaterialModel", depotItem.getMaterialId().getModel());
|
||||
item.put("MaterialStandard", depotItem.getMaterialId().getStandard());
|
||||
item.put("MaterialColor", depotItem.getMaterialId().getColor());
|
||||
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
|
||||
item.put("OutSum", OutSumRetail + OutSum);
|
||||
@@ -418,6 +422,7 @@ public class DepotItemAction extends BaseAction<DepotItemModel>
|
||||
item.put("MaterialId", depotItem.getMaterialId()==null?"":depotItem.getMaterialId().getId());
|
||||
item.put("MaterialName", depotItem.getMaterialId().getName());
|
||||
item.put("MaterialModel", depotItem.getMaterialId().getModel());
|
||||
item.put("MaterialStandard", depotItem.getMaterialId().getStandard());
|
||||
item.put("MaterialColor", depotItem.getMaterialId().getColor());
|
||||
item.put("MaterialUnit", depotItem.getMaterialId().getUnit());
|
||||
item.put("prevSum", prevSum);
|
||||
|
||||
@@ -43,6 +43,7 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
||||
|
||||
material.setName(model.getName());
|
||||
material.setModel(model.getModel());
|
||||
material.setStandard(model.getStandard());
|
||||
material.setColor(model.getColor());
|
||||
material.setUnit(model.getUnit());
|
||||
material.setRetailPrice(model.getRetailPrice());
|
||||
@@ -124,6 +125,7 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
||||
|
||||
material.setName(model.getName());
|
||||
material.setModel(model.getModel());
|
||||
material.setStandard(model.getStandard());
|
||||
material.setColor(model.getColor());
|
||||
material.setUnit(model.getUnit());
|
||||
material.setRetailPrice(model.getRetailPrice());
|
||||
@@ -223,6 +225,7 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
||||
item.put("Id", material.getId());
|
||||
item.put("Name", material.getName());
|
||||
item.put("Model", material.getModel());
|
||||
item.put("Standard", material.getStandard());
|
||||
item.put("Color", material.getColor());
|
||||
item.put("Unit", material.getUnit());
|
||||
item.put("RetailPrice", material.getRetailPrice());
|
||||
@@ -271,6 +274,7 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
||||
item.put("Id", material.getId());
|
||||
item.put("Name", material.getName());
|
||||
item.put("Model", material.getModel());
|
||||
item.put("Standard", material.getStandard());
|
||||
item.put("Color", material.getColor());
|
||||
item.put("Unit", material.getUnit());
|
||||
item.put("RetailPrice", material.getRetailPrice());
|
||||
@@ -319,7 +323,8 @@ public class MaterialAction extends BaseAction<MaterialModel>
|
||||
JSONObject item = new JSONObject();
|
||||
item.put("Id", material.getId());
|
||||
//名称
|
||||
String MaterialName = ((material.getModel().equals(""))?"":""+material.getModel()) +" "+ material.getName()
|
||||
String MaterialName = ((material.getModel().equals(""))?"":""+material.getModel()) +" "+ material.getName()
|
||||
+ ((material.getStandard() == null || material.getStandard().equals(""))?"":"("+material.getStandard() + ")")
|
||||
+ ((material.getColor() == null || material.getColor().equals(""))?"":"("+material.getColor() + ")")
|
||||
+ ((material.getUnit() == null || material.getUnit().equals(""))?"":"("+material.getUnit() + ")");
|
||||
item.put("MaterialName", MaterialName);
|
||||
|
||||
@@ -7,6 +7,7 @@ public class Material implements java.io.Serializable
|
||||
private MaterialCategory materialCategory;
|
||||
private String Name;
|
||||
private String Model;
|
||||
private String Standard;
|
||||
private String Color;
|
||||
private String Unit;
|
||||
private Double RetailPrice;
|
||||
@@ -26,13 +27,14 @@ public class Material implements java.io.Serializable
|
||||
}
|
||||
|
||||
public Material(MaterialCategory materialCategory, String name,
|
||||
String model, String color, String unit, String remark,
|
||||
String model, String standard, String color, String unit, String remark,
|
||||
Double retailPrice, Double lowPrice, Double presetPriceOne, Double presetPriceTwo)
|
||||
{
|
||||
super();
|
||||
this.materialCategory = materialCategory;
|
||||
Name = name;
|
||||
Model = model;
|
||||
Standard = standard;
|
||||
Color = color;
|
||||
Unit = unit;
|
||||
RetailPrice = retailPrice;
|
||||
@@ -82,6 +84,14 @@ public class Material implements java.io.Serializable
|
||||
Model = model;
|
||||
}
|
||||
|
||||
public String getStandard() {
|
||||
return Standard;
|
||||
}
|
||||
|
||||
public void setStandard(String standard) {
|
||||
Standard = standard;
|
||||
}
|
||||
|
||||
public String getColor()
|
||||
{
|
||||
return Color;
|
||||
|
||||
@@ -17,6 +17,11 @@ public class MaterialModel implements Serializable
|
||||
* 型号
|
||||
*/
|
||||
private String Model = "";
|
||||
|
||||
/**
|
||||
* 规格
|
||||
*/
|
||||
private String Standard = "";
|
||||
|
||||
/**
|
||||
* 颜色
|
||||
@@ -111,7 +116,15 @@ public class MaterialModel implements Serializable
|
||||
public void setModel(String model) {
|
||||
Model = model;
|
||||
}
|
||||
|
||||
|
||||
public String getStandard() {
|
||||
return Standard;
|
||||
}
|
||||
|
||||
public void setStandard(String standard) {
|
||||
Standard = standard;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return Color;
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
|
||||
workbook = Workbook.createWorkbook(os);
|
||||
WritableSheet sheet = workbook.createSheet("进销存报表", 0);
|
||||
//增加列头
|
||||
int[] colunmWidth = {10,10,10,10,10,15,15,15,15,15};
|
||||
String[] colunmName = {"名称","型号","颜色","单位","单价","上月结存数量","入库数量","出库数量","本月结存数量","结存金额"};
|
||||
int[] colunmWidth = {10,10,10,10,10,10,15,15,15,15,15};
|
||||
String[] colunmName = {"名称","型号","规格","颜色","单位","单价","上月结存数量","入库数量","出库数量","本月结存数量","结存金额"};
|
||||
for(int i = 0 ;i < colunmWidth.length;i ++)
|
||||
{
|
||||
sheet.setColumnView(i,colunmWidth[i]);
|
||||
@@ -102,16 +102,17 @@ public class DepotItemService extends BaseService<DepotItem> implements DepotIte
|
||||
JSONObject jo = JSONObject.fromObject(dataArray.get(j));
|
||||
sheet.addCell(new Label(0, j+1, jo.getString("MaterialName")));
|
||||
sheet.addCell(new Label(1, j+1, jo.getString("MaterialModel")));
|
||||
sheet.addCell(new Label(2, j+1, jo.getString("MaterialColor")));
|
||||
sheet.addCell(new Label(3, j+1, jo.getString("MaterialUnit")));
|
||||
sheet.addCell(new Label(4, j+1, jo.getString("UnitPrice")));
|
||||
sheet.addCell(new Label(5, j+1, jo.getString("prevSum")));
|
||||
sheet.addCell(new Label(6, j+1, jo.getString("InSum")));
|
||||
sheet.addCell(new Label(7, j+1, jo.getString("OutSum")));
|
||||
sheet.addCell(new Label(8, j+1, jo.getString("thisSum")));
|
||||
sheet.addCell(new Label(2, j+1, jo.getString("MaterialStandard")));
|
||||
sheet.addCell(new Label(3, j+1, jo.getString("MaterialColor")));
|
||||
sheet.addCell(new Label(4, j+1, jo.getString("MaterialUnit")));
|
||||
sheet.addCell(new Label(5, j+1, jo.getString("UnitPrice")));
|
||||
sheet.addCell(new Label(6, j+1, jo.getString("prevSum")));
|
||||
sheet.addCell(new Label(7, j+1, jo.getString("InSum")));
|
||||
sheet.addCell(new Label(8, j+1, jo.getString("OutSum")));
|
||||
sheet.addCell(new Label(9, j+1, jo.getString("thisSum")));
|
||||
double d = Double.parseDouble(jo.getString("thisAllPrice").toString());
|
||||
String s1 = String.format("%.2f", d);
|
||||
sheet.addCell(new Label(9, j+1, s1));
|
||||
sheet.addCell(new Label(10, j+1, s1));
|
||||
}
|
||||
}
|
||||
workbook.write();
|
||||
|
||||
Reference in New Issue
Block a user