diff --git a/src/main/java/com/jsh/action/materials/DepotItemAction.java b/src/main/java/com/jsh/action/materials/DepotItemAction.java index 5ace8638..57ef9c23 100644 --- a/src/main/java/com/jsh/action/materials/DepotItemAction.java +++ b/src/main/java/com/jsh/action/materials/DepotItemAction.java @@ -153,8 +153,9 @@ public class DepotItemAction extends BaseAction 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 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 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 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 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); diff --git a/src/main/java/com/jsh/action/materials/MaterialAction.java b/src/main/java/com/jsh/action/materials/MaterialAction.java index 017568b7..d26a8a1c 100644 --- a/src/main/java/com/jsh/action/materials/MaterialAction.java +++ b/src/main/java/com/jsh/action/materials/MaterialAction.java @@ -43,6 +43,7 @@ public class MaterialAction extends BaseAction 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 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 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 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 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); diff --git a/src/main/java/com/jsh/model/po/Material.java b/src/main/java/com/jsh/model/po/Material.java index fa8dd352..52517bf3 100644 --- a/src/main/java/com/jsh/model/po/Material.java +++ b/src/main/java/com/jsh/model/po/Material.java @@ -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; diff --git a/src/main/java/com/jsh/model/vo/materials/MaterialModel.java b/src/main/java/com/jsh/model/vo/materials/MaterialModel.java index 0cc7bb51..e79c17bf 100644 --- a/src/main/java/com/jsh/model/vo/materials/MaterialModel.java +++ b/src/main/java/com/jsh/model/vo/materials/MaterialModel.java @@ -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; } diff --git a/src/main/java/com/jsh/service/materials/DepotItemService.java b/src/main/java/com/jsh/service/materials/DepotItemService.java index df0a6904..722b02ae 100644 --- a/src/main/java/com/jsh/service/materials/DepotItemService.java +++ b/src/main/java/com/jsh/service/materials/DepotItemService.java @@ -89,8 +89,8 @@ public class DepotItemService extends BaseService 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 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(); diff --git a/src/main/resources/hibernate/Material.hbm.xml b/src/main/resources/hibernate/Material.hbm.xml index 4b947e83..1ca3b9de 100644 --- a/src/main/resources/hibernate/Material.hbm.xml +++ b/src/main/resources/hibernate/Material.hbm.xml @@ -20,6 +20,11 @@ 型号 + + + 规格 + + 颜色 diff --git a/src/main/webapp/pages/materials/material.jsp b/src/main/webapp/pages/materials/material.jsp index 4a6ae81e..980c7188 100644 --- a/src/main/webapp/pages/materials/material.jsp +++ b/src/main/webapp/pages/materials/material.jsp @@ -48,53 +48,49 @@
-
- + - - - + + + + + + + + + + - - - - - - - - - - - - - - - + + + + + - - - - - - - + + + + + - +
名称
类别 -
-
- +
+ + +
型号型号规格
颜色单位
颜色
单位
零售价
最低售价
零售价最低售价
预设售价一
预设售价二
预设售价一预设售价二
备注
@@ -317,17 +313,17 @@ { field: 'Id',width:35,align:"center",checkbox:true}, { title: '名称',field: 'Name',width:80}, { title: '型号',field: 'Model',width:80}, - { title: '颜色',field: 'Color',width:40}, - { title: '单位',field: 'Unit',width:50}, - { title: '零售价',field: 'RetailPrice',width:50}, + { title: '规格',field: 'Standard',width:80}, + { title: '颜色',field: 'Color',width:60}, + { title: '单位',field: 'Unit',width:60}, + { title: '零售价',field: 'RetailPrice',width:60}, { title: '最低售价',field: 'LowPrice',width:70}, { title: '预设售价一',field: 'PresetPriceOne',width:70}, { title: '预设售价二',field: 'PresetPriceTwo',width:70}, - { title: '备注',field: 'Remark',width:90}, - { title: '操作',field: 'op',align:"center",width:150,formatter:function(value,rec) + { title: '操作',field: 'op',align:"center",width:110,formatter:function(value,rec) { var str = ''; - var rowInfo = rec.Id + 'AaBb' + rec.Name+ 'AaBb' + rec.Model + 'AaBb' + rec.Color + 'AaBb' + rec.Unit + 'AaBb' + rec.RetailPrice + 'AaBb' + rec.LowPrice + 'AaBb' + rec.PresetPriceOne + 'AaBb' + rec.PresetPriceTwo + 'AaBb' + rec.Remark; + var rowInfo = rec.Id + 'AaBb' + rec.Name+ 'AaBb' + rec.Model + 'AaBb' + rec.Color + 'AaBb' + rec.Unit + 'AaBb' + rec.RetailPrice + 'AaBb' + rec.LowPrice + 'AaBb' + rec.PresetPriceOne + 'AaBb' + rec.PresetPriceTwo + 'AaBb' + rec.Remark + 'AaBb' + rec.Standard; if(1 == value) { str += ' 编辑  '; @@ -556,6 +552,7 @@ CategoryId : parent, Name : $.trim($("#Name").val()), Model : $.trim($("#Model").val()), + Standard : $.trim($("#Standard").val()), Color : $.trim($("#Color").val()), Unit : $.trim($("#Unit").val()), RetailPrice : $.trim($("#RetailPrice").val()), @@ -601,8 +598,9 @@ $("#clientIp").val('<%=clientIp %>'); $("#Name").focus().val(materialInfo[1]); $("#Model").val(materialInfo[2]); - $("#Color").val(materialInfo[3]); - $("#Unit").val(materialInfo[4]); + $("#Standard").val(materialInfo[10]=="undefined"?"":materialInfo[10]); + $("#Color").val(materialInfo[3]=="undefined"?"":materialInfo[3]); + $("#Unit").val(materialInfo[4]=="undefined"?"":materialInfo[4]); $("#RetailPrice").val(materialInfo[5]); $("#LowPrice").val(materialInfo[6]); $("#PresetPriceOne").val(materialInfo[7]); diff --git a/src/main/webapp/pages/reports/buy_in_report.jsp b/src/main/webapp/pages/reports/buy_in_report.jsp index ee2eb891..e243ff48 100644 --- a/src/main/webapp/pages/reports/buy_in_report.jsp +++ b/src/main/webapp/pages/reports/buy_in_report.jsp @@ -79,6 +79,7 @@ columns:[[ { title: '名称',field: 'MaterialName',width:60}, { title: '型号',field: 'MaterialModel',width:80}, + { title: '规格',field: 'MaterialStandard',width:80}, { title: '颜色',field: 'MaterialColor',width:80}, { title: '单位',field: 'MaterialUnit',width:80}, { title: '进货数量',field: 'InSum',width:60}, diff --git a/src/main/webapp/pages/reports/in_out_stock_report.jsp b/src/main/webapp/pages/reports/in_out_stock_report.jsp index 580d0526..6329bafc 100644 --- a/src/main/webapp/pages/reports/in_out_stock_report.jsp +++ b/src/main/webapp/pages/reports/in_out_stock_report.jsp @@ -99,6 +99,7 @@ columns:[[ { title: '名称',field: 'MaterialName',width:60}, { title: '型号',field: 'MaterialModel',width:80}, + { title: '规格',field: 'MaterialStandard',width:80}, { title: '颜色',field: 'MaterialColor',width:80}, { title: '单位',field: 'MaterialUnit',width:80}, { title: '单价',field: 'UnitPrice',width:60,formatter: function(value,row,index){ diff --git a/src/main/webapp/pages/reports/sale_out_report.jsp b/src/main/webapp/pages/reports/sale_out_report.jsp index 0e2c12be..8b44d58a 100644 --- a/src/main/webapp/pages/reports/sale_out_report.jsp +++ b/src/main/webapp/pages/reports/sale_out_report.jsp @@ -81,6 +81,7 @@ columns:[[ { title: '名称',field: 'MaterialName',width:60}, { title: '型号',field: 'MaterialModel',width:80}, + { title: '规格',field: 'MaterialStandard',width:80}, { title: '颜色',field: 'MaterialColor',width:80}, { title: '单位',field: 'MaterialUnit',width:80}, { title: '销售数量',field: 'OutSum',width:60},