From 6447194fa338ff26be052a227a8c6cb1a989dd43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Tue, 10 Oct 2017 23:32:26 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=8A=8A=20=E5=88=B6=E9=80=A0=E5=95=86=20?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=20=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsh/action/materials/DepotItemAction.java | 5 +-- .../jsh/action/materials/MaterialAction.java | 13 ++++---- .../com/jsh/dao/materials/DepotHeadDAO.java | 4 +-- .../service/materials/MaterialService.java | 16 +++++----- .../java/com/jsh/util/MaterialConstants.java | 4 +-- src/main/webapp/js/pages/materials/in_out.js | 8 ++--- .../pages/materials/allocation_out_list.jsp | 2 +- .../webapp/pages/materials/assemble_list.jsp | 2 +- .../pages/materials/disassemble_list.jsp | 2 +- .../webapp/pages/materials/gift_out_list.jsp | 2 +- .../pages/materials/gift_recharge_list.jsp | 2 +- src/main/webapp/pages/materials/material.jsp | 32 +++++++++---------- .../webapp/pages/materials/other_in_list.jsp | 2 +- .../webapp/pages/materials/other_out_list.jsp | 2 +- .../pages/materials/purchase_back_list.jsp | 2 +- .../pages/materials/purchase_in_list.jsp | 2 +- .../pages/materials/retail_back_list.jsp | 2 +- .../pages/materials/retail_out_list.jsp | 2 +- .../webapp/pages/materials/sale_back_list.jsp | 2 +- .../webapp/pages/materials/sale_out_list.jsp | 2 +- 20 files changed, 55 insertions(+), 53 deletions(-) diff --git a/src/main/java/com/jsh/action/materials/DepotItemAction.java b/src/main/java/com/jsh/action/materials/DepotItemAction.java index 935c27e4..bc061494 100644 --- a/src/main/java/com/jsh/action/materials/DepotItemAction.java +++ b/src/main/java/com/jsh/action/materials/DepotItemAction.java @@ -280,9 +280,10 @@ public class DepotItemAction extends BaseAction ratio = depotItem.getMaterialId().getUnitId().getUName(); ratio = ratio.substring(ratio.indexOf("(")); } - //品名/型号/制造商/包装 + //品名/型号/规格/颜色/包装 String MaterialName = depotItem.getMaterialId().getName() + ((depotItem.getMaterialId().getModel() == null||depotItem.getMaterialId().getModel().equals(""))?"":"("+depotItem.getMaterialId().getModel()+ ")") - +((depotItem.getMaterialId().getMfrs() == null||depotItem.getMaterialId().getMfrs().equals(""))?"":"("+depotItem.getMaterialId().getMfrs() + ")") + +((depotItem.getMaterialId().getStandard() == null||depotItem.getMaterialId().getStandard().equals(""))?"":"("+depotItem.getMaterialId().getStandard() + ")") + +((depotItem.getMaterialId().getColor() == null||depotItem.getMaterialId().getColor().equals(""))?"":"("+depotItem.getMaterialId().getColor() + ")") + ratio; item.put("MaterialName", MaterialName); item.put("Unit", depotItem.getMUnit()); diff --git a/src/main/java/com/jsh/action/materials/MaterialAction.java b/src/main/java/com/jsh/action/materials/MaterialAction.java index dff7510e..e005cb81 100644 --- a/src/main/java/com/jsh/action/materials/MaterialAction.java +++ b/src/main/java/com/jsh/action/materials/MaterialAction.java @@ -374,7 +374,7 @@ public class MaterialAction extends BaseAction item.put("SafetyStock", material.getSafetyStock()==null?"" : material.getSafetyStock()); item.put("Model", material.getModel()); item.put("Standard", material.getStandard()); - item.put("Color", material.getColor()); + item.put("Color", material.getColor()==null?"": material.getColor()); item.put("Unit", material.getUnit()); item.put("RetailPrice", material.getRetailPrice()); item.put("LowPrice", material.getLowPrice()); @@ -430,9 +430,10 @@ public class MaterialAction extends BaseAction ratio = material.getUnitId().getUName(); ratio = ratio.substring(ratio.indexOf("(")); } - //品名/型号/制造商/包装 + //品名/型号/规格/颜色/包装 String MaterialName = material.getName() + ((material.getModel() == null || material.getModel().equals(""))?"":"("+material.getModel() + ")") - + ((material.getMfrs() == null || material.getMfrs().equals(""))?"":"("+material.getMfrs() + ")") + + ((material.getStandard() == null || material.getStandard().equals(""))?"":"("+material.getStandard() + ")") + + ((material.getColor() == null || material.getColor().equals(""))?"":"("+material.getColor() + ")") + ratio; item.put("MaterialName", MaterialName); dataArray.add(item); @@ -563,7 +564,7 @@ public class MaterialAction extends BaseAction Map condition = new HashMap(); condition.put("Name_s_like", model.getName()); condition.put("Model_s_like", model.getModel()); - condition.put("Mfrs_s_like", model.getMfrs()); + condition.put("Color_s_like", model.getColor()); condition.put("Id_s_order", "asc"); return condition; } @@ -579,7 +580,7 @@ public class MaterialAction extends BaseAction Map condition = new HashMap(); condition.put("Name_s_like", model.getName()); condition.put("Model_s_like", model.getModel()); - condition.put("Mfrs_s_like", model.getMfrs()); + condition.put("Color_s_like", model.getColor()); condition.put("CategoryId_s_in", model.getCategoryIds()); condition.put("Id_s_order", "asc"); return condition; @@ -592,7 +593,7 @@ public class MaterialAction extends BaseAction } condition.put("Name_s_eq", model.getName()); condition.put("Model_s_eq", model.getModel()); - condition.put("Mfrs_s_eq", model.getMfrs()); + condition.put("Color_s_eq", model.getColor()); if(model.getUnit()!=null){ condition.put("Unit_s_eq", model.getUnit()); } diff --git a/src/main/java/com/jsh/dao/materials/DepotHeadDAO.java b/src/main/java/com/jsh/dao/materials/DepotHeadDAO.java index b09a287d..e4ca6588 100644 --- a/src/main/java/com/jsh/dao/materials/DepotHeadDAO.java +++ b/src/main/java/com/jsh/dao/materials/DepotHeadDAO.java @@ -122,7 +122,7 @@ public class DepotHeadDAO extends BaseDAO implements DepotHeadIDAO { @SuppressWarnings("unchecked") public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException { StringBuffer queryString = new StringBuffer(); - queryString.append("select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model,' ',jsh_material.Mfrs)) as mName from jsh_depotitem inner join jsh_material " + + queryString.append("select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model,' ',jsh_material.Color)) as mName from jsh_depotitem inner join jsh_material " + " on jsh_depotitem.MaterialId = jsh_material.Id where jsh_depotitem.HeaderId ="+ headerId); Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch())); pageUtil.setPageList(query.list()); @@ -164,7 +164,7 @@ public class DepotHeadDAO extends BaseDAO implements DepotHeadIDAO { public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam) throws JshException { StringBuffer queryString = new StringBuffer(); queryString.append("select group_concat(CAST(dt.HeaderId AS CHAR)) as ids from jsh_depotitem dt INNER JOIN jsh_material m on dt.MaterialId = m.Id where m.`Name` "+ - " like '%" + materialParam + "%' or m.Model like '%" + materialParam + "%' or m.Mfrs like '%" + materialParam + "%'"); + " like '%" + materialParam + "%' or m.Model like '%" + materialParam + "%' or m.Color like '%" + materialParam + "%'"); Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch())); pageUtil.setPageList(query.list()); } diff --git a/src/main/java/com/jsh/service/materials/MaterialService.java b/src/main/java/com/jsh/service/materials/MaterialService.java index 485861bb..0801e853 100644 --- a/src/main/java/com/jsh/service/materials/MaterialService.java +++ b/src/main/java/com/jsh/service/materials/MaterialService.java @@ -89,7 +89,7 @@ public class MaterialService extends BaseService implements MaterialIS workbook = Workbook.createWorkbook(os); WritableSheet sheet = workbook.createSheet("信息报表", 0); //增加列头 - String[] colunmName = {"品名","类型","型号","制造商","规格","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态"}; + String[] colunmName = {"品名","类型","型号","颜色","规格","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态"}; for(int i = 0 ;i < colunmName.length;i ++) { sheet.setColumnView(i, 10); sheet.addCell(new Label(i, 0, colunmName[i])); @@ -102,7 +102,7 @@ public class MaterialService extends BaseService implements MaterialIS sheet.addCell(new Label(j++,i, material.getName())); sheet.addCell(new Label(j++,i, material.getMaterialCategory().getName())); sheet.addCell(new Label(j++,i, material.getModel() == null ?"": material.getModel())); - sheet.addCell(new Label(j++,i, material.getMfrs() == null ?"": material.getMfrs())); + sheet.addCell(new Label(j++,i, material.getColor() == null ?"": material.getColor())); sheet.addCell(new Label(j++,i, material.getStandard() == null ?"": material.getStandard())); sheet.addCell(getLabelInfo(cellInfo,j++,i, material.getSafetyStock() == null ?"": material.getSafetyStock().toString(),material)); sheet.addCell(new Label(j++,i, material.getUnit() == null ?"": material.getUnit())); @@ -242,7 +242,7 @@ public class MaterialService extends BaseService implements MaterialIS Log.infoFileSync("==================excel表格中第" + totalRow + "行的第 " + cellIndex + "列的值为" + cell.getStringCellValue()); - //每行中数据顺序 "品名","类型","型号","制造商","规格","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态" + //每行中数据顺序 "品名","类型","型号","颜色","规格","安全存量","单位","零售价","最低售价","预计采购价","批发价","备注","状态" switch(cellIndex) { case MaterialConstants.BusinessForExcel.EXCEL_NAME : String materialName = cell.getStringCellValue(); @@ -268,13 +268,13 @@ public class MaterialService extends BaseService implements MaterialIS } material.setModel(model); break; - case MaterialConstants.BusinessForExcel.EXCEL_MFRS : - String mfrs = cell.getStringCellValue(); - if(null == mfrs || "".equals(mfrs)) { - Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(制造商)信息"); + case MaterialConstants.BusinessForExcel.EXCEL_COLOR : + String color = cell.getStringCellValue(); + if(null == color || "".equals(color)) { + Log.errorFileSync(">>>>>>>>>>>>>>>>列表没有填写(颜色)信息"); break; } - material.setMfrs(mfrs); + material.setColor(color); break; case MaterialConstants.BusinessForExcel.EXCEL_STANDARD : String standard = cell.getStringCellValue(); diff --git a/src/main/java/com/jsh/util/MaterialConstants.java b/src/main/java/com/jsh/util/MaterialConstants.java index 1bd26e87..68a6bdf1 100644 --- a/src/main/java/com/jsh/util/MaterialConstants.java +++ b/src/main/java/com/jsh/util/MaterialConstants.java @@ -32,9 +32,9 @@ public interface MaterialConstants public static final int EXCEL_CATEGORY = 1; /** - * 制造商 + * 颜色 */ - public static final int EXCEL_MFRS = 2; + public static final int EXCEL_COLOR = 2; /** * 型号 diff --git a/src/main/webapp/js/pages/materials/in_out.js b/src/main/webapp/js/pages/materials/in_out.js index 2bdb8270..210e165f 100644 --- a/src/main/webapp/js/pages/materials/in_out.js +++ b/src/main/webapp/js/pages/materials/in_out.js @@ -788,7 +788,7 @@ } } }, - { title: '品名(型号)(制造商)(包装)',field: 'MaterialId',width:230, + { title: '品名(型号)(规格)(颜色)(包装)',field: 'MaterialId',width:230, formatter:function(value,row,index){ return row.MaterialName; }, @@ -1039,7 +1039,7 @@ { title: '备注',field: 'Remark',editor:'validatebox',width:150}, { title: '品名-别',field: 'OtherField1',editor:'validatebox',hidden:otherColumns,width:60}, { title: '型号-别',field: 'OtherField2',editor:'validatebox',hidden:otherColumns,width:60}, - { title: '制造商-别',field: 'OtherField3',editor:'validatebox',hidden:otherColumns,width:60}, + { title: '颜色-别',field: 'OtherField3',editor:'validatebox',hidden:otherColumns,width:60}, { title: '备注1',field: 'OtherField4',editor:'validatebox',hidden:true,width:60}, { title: '备注2',field: 'OtherField5',editor:'validatebox',hidden:true,width:60} ]], @@ -1150,7 +1150,7 @@ columns:[[ { title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn}, { title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90}, - { title: '品名(型号)(制造商)(包装)',field: 'MaterialName',width:230}, + { title: '品名(型号)(规格)(颜色)(包装)',field: 'MaterialName',width:230}, { title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90}, { title: '单位',field: 'Unit',editor:'validatebox',width:70}, { title: '数量',field: 'OperNumber',editor:'validatebox',width:70}, @@ -1163,7 +1163,7 @@ { title: '备注',field: 'Remark',editor:'validatebox',width:150}, { title: '品名-别',field: 'OtherField1',editor:'validatebox',hidden:otherColumns,width:60}, { title: '型号-别',field: 'OtherField2',editor:'validatebox',hidden:otherColumns,width:60}, - { title: '制造商-别',field: 'OtherField3',editor:'validatebox',hidden:otherColumns,width:60}, + { title: '颜色-别',field: 'OtherField3',editor:'validatebox',hidden:otherColumns,width:60}, { title: '备注1',field: 'OtherField4',editor:'validatebox',hidden:true,width:60}, { title: '备注2',field: 'OtherField5',editor:'validatebox',hidden:true,width:60} ]], diff --git a/src/main/webapp/pages/materials/allocation_out_list.jsp b/src/main/webapp/pages/materials/allocation_out_list.jsp index 1d06358f..6f8e1c1d 100644 --- a/src/main/webapp/pages/materials/allocation_out_list.jsp +++ b/src/main/webapp/pages/materials/allocation_out_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/assemble_list.jsp b/src/main/webapp/pages/materials/assemble_list.jsp index 7b5b671f..d6a91e70 100644 --- a/src/main/webapp/pages/materials/assemble_list.jsp +++ b/src/main/webapp/pages/materials/assemble_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/disassemble_list.jsp b/src/main/webapp/pages/materials/disassemble_list.jsp index 14da5f30..13f77a65 100644 --- a/src/main/webapp/pages/materials/disassemble_list.jsp +++ b/src/main/webapp/pages/materials/disassemble_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/gift_out_list.jsp b/src/main/webapp/pages/materials/gift_out_list.jsp index 537ff17d..f403257b 100644 --- a/src/main/webapp/pages/materials/gift_out_list.jsp +++ b/src/main/webapp/pages/materials/gift_out_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/gift_recharge_list.jsp b/src/main/webapp/pages/materials/gift_recharge_list.jsp index 961c8f6d..cb7c05a4 100644 --- a/src/main/webapp/pages/materials/gift_recharge_list.jsp +++ b/src/main/webapp/pages/materials/gift_recharge_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/material.jsp b/src/main/webapp/pages/materials/material.jsp index 2c2203e9..5abeb983 100644 --- a/src/main/webapp/pages/materials/material.jsp +++ b/src/main/webapp/pages/materials/material.jsp @@ -35,9 +35,9 @@ - 制造商: + 颜色: - + 类别: @@ -86,9 +86,9 @@ - 制造商 + 颜色 - + 规格 @@ -503,7 +503,7 @@ 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 + 'AaBb' + rec.Standard - + 'AaBb' + rec.Mfrs + 'AaBb' + rec.Packing + 'AaBb' + rec.SafetyStock + 'AaBb' + rec.CategoryId + 'AaBb' + rec.CategoryName + + 'AaBb' + rec.Color + 'AaBb' + rec.Packing + 'AaBb' + rec.SafetyStock + 'AaBb' + rec.CategoryId + 'AaBb' + rec.CategoryName + 'AaBb' + rec.UnitId + 'AaBb' + rec.UnitName + 'AaBb' + rec.FirstOutUnit + 'AaBb' + rec.FirstInUnit; if(1 == value) { @@ -515,7 +515,7 @@ }, { title: '品名',field: 'Name',width:80}, { title: '型号',field: 'Model',width:80}, - { title: '制造商',field: 'Mfrs',width:150}, + { title: '颜色',field: 'Color',width:80}, { title: '规格',field: 'Standard',width:80}, { title: '单位',field: 'Unit',width:60}, { title: '安全存量',field: 'SafetyStock',width:90}, @@ -872,10 +872,10 @@ //增加 var url; var materialID = 0; - //保存编辑前的名称/型号/制造商 + //保存编辑前的名称/型号/颜色 var oldName = ""; var oldModel = ""; - var oldMfrs = ""; + var oldColor = ""; var oldUnit = ""; var oldManyUnit = ""; @@ -901,7 +901,7 @@ $(".price-two").show(); oldName = ""; oldModel = ""; - oldMfrs = ""; + oldColor = ""; oldUnit = ""; oldManyUnit = ""; materialID = 0; @@ -912,13 +912,13 @@ function checkIsExist() { var mName = $.trim($("#Name").val()); var mModel = $.trim($("#Model").val()); - var mMfrs = $.trim($("#Mfrs").val()); + var mColor = $.trim($("#Color").val()); var mUnit = $.trim($("#Unit").val()); var mUnitId = $.trim($("#manyUnit").val()); //表示是否存在 true == 存在 false = 不存在 var flag = false; //开始ajax名称检验,不能重名(新增或编辑) - if(materialID==0 || (materialID!=0 && (mName != oldName || mModel != oldModel || mMfrs != oldMfrs || mUnit != oldUnit || mUnitId != oldManyUnit))) { + if(materialID==0 || (materialID!=0 && (mName != oldName || mModel != oldModel || mColor != oldColor || mUnit != oldUnit || mUnitId != oldManyUnit))) { $.ajax({ type:"post", url: "<%=path%>/material/checkIsExist.action", @@ -928,7 +928,7 @@ MaterialID : materialID, Name : mName, Model: mModel, - Mfrs: mMfrs, + Color: mColor, Unit: mUnit, UnitId: mUnitId }), @@ -1001,7 +1001,7 @@ data: ({ CategoryId : parent, Name : $.trim($("#Name").val()), - Mfrs : $.trim($("#Mfrs").val()), + Color : $.trim($("#Color").val()), Packing : $.trim($("#Packing").val()), SafetyStock : $.trim($("#SafetyStock").val()), Model : $.trim($("#Model").val()), @@ -1075,7 +1075,7 @@ $("#clientIp").val('<%=clientIp %>'); $("#Name").focus().val(materialInfo[1]); - $("#Mfrs").focus().val(materialInfo[11]); + $("#Color").focus().val(materialInfo[11]); var categoryName = ""; //类型名称 mId = materialInfo[14]; @@ -1191,7 +1191,7 @@ oldName = materialInfo[1]; oldModel = materialInfo[2]; - oldMfrs = materialInfo[11]; + oldColor = materialInfo[11]; oldUnit = materialInfo[4]; oldManyUnit = materialInfo[16]; $('#materialDlg').dialog('open').dialog('setTitle',' 编辑商品信息'); @@ -1240,7 +1240,7 @@ data: ({ Name: $.trim($("#searchName").val()), Model: $.trim($("#searchModel").val()), - Mfrs: $.trim($("#searchMfrs").val()), + Color: $.trim($("#searchColor").val()), CategoryId:cid, CategoryIds:setCategoryId, pageNo:pageNo, diff --git a/src/main/webapp/pages/materials/other_in_list.jsp b/src/main/webapp/pages/materials/other_in_list.jsp index b8885a88..b03e4aac 100644 --- a/src/main/webapp/pages/materials/other_in_list.jsp +++ b/src/main/webapp/pages/materials/other_in_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/other_out_list.jsp b/src/main/webapp/pages/materials/other_out_list.jsp index d134ecda..6e38c6b4 100644 --- a/src/main/webapp/pages/materials/other_out_list.jsp +++ b/src/main/webapp/pages/materials/other_out_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/purchase_back_list.jsp b/src/main/webapp/pages/materials/purchase_back_list.jsp index 288d1dad..bd7b2586 100644 --- a/src/main/webapp/pages/materials/purchase_back_list.jsp +++ b/src/main/webapp/pages/materials/purchase_back_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/purchase_in_list.jsp b/src/main/webapp/pages/materials/purchase_in_list.jsp index db7bacf8..0b66495c 100644 --- a/src/main/webapp/pages/materials/purchase_in_list.jsp +++ b/src/main/webapp/pages/materials/purchase_in_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/retail_back_list.jsp b/src/main/webapp/pages/materials/retail_back_list.jsp index ba80d698..7410e010 100644 --- a/src/main/webapp/pages/materials/retail_back_list.jsp +++ b/src/main/webapp/pages/materials/retail_back_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/retail_out_list.jsp b/src/main/webapp/pages/materials/retail_out_list.jsp index 0c2fdaf7..7c511c50 100644 --- a/src/main/webapp/pages/materials/retail_out_list.jsp +++ b/src/main/webapp/pages/materials/retail_out_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/sale_back_list.jsp b/src/main/webapp/pages/materials/sale_back_list.jsp index 13a9235b..6e75e058 100644 --- a/src/main/webapp/pages/materials/sale_back_list.jsp +++ b/src/main/webapp/pages/materials/sale_back_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/sale_out_list.jsp b/src/main/webapp/pages/materials/sale_out_list.jsp index 3869b31c..6d5f75fa 100644 --- a/src/main/webapp/pages/materials/sale_out_list.jsp +++ b/src/main/webapp/pages/materials/sale_out_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: From 4fe50cf52af862d6ea47cad0c0b1c817cf9e8c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 11 Oct 2017 00:11:43 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=95=86=E5=93=81=E7=BC=96=E8=BE=91=20?= =?UTF-8?q?=E9=A2=9C=E8=89=B2=E4=BF=AE=E6=94=B9=E7=9A=84bug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/pages/materials/material.jsp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/webapp/pages/materials/material.jsp b/src/main/webapp/pages/materials/material.jsp index 5abeb983..46cac08b 100644 --- a/src/main/webapp/pages/materials/material.jsp +++ b/src/main/webapp/pages/materials/material.jsp @@ -1006,7 +1006,7 @@ SafetyStock : $.trim($("#SafetyStock").val()), Model : $.trim($("#Model").val()), Standard : $.trim($("#Standard").val()), - Color : "", + Mfrs : "", Unit : $.trim($("#Unit").val()), RetailPrice : $.trim($("#RetailPrice").val()), LowPrice : $.trim($("#LowPrice").val()), From d82e3daaec92b2c9ab01aae743f359a5480d7e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 11 Oct 2017 23:53:00 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E7=9A=84=E6=98=BE=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/pages/materials/material.jsp | 223 ++++++++++--------- 1 file changed, 122 insertions(+), 101 deletions(-) diff --git a/src/main/webapp/pages/materials/material.jsp b/src/main/webapp/pages/materials/material.jsp index 46cac08b..e3312374 100644 --- a/src/main/webapp/pages/materials/material.jsp +++ b/src/main/webapp/pages/materials/material.jsp @@ -59,116 +59,133 @@
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
品名 - - 型号 - -
类别 - - - - - 修改 -
颜色 - - 规格
安全存量 - - 单位 - - - - 多单位 -
首选出库单位 - - 首选入库单位 - -
- +
+
+
- - - - - - + + + + + - - - - - - + + + - - - - - - + + +
价格列表计量单位零售价最低售价预计采购价批发价品名 + + 型号 + +
基本单位类别 + + + + + 修改 +
副单位备注 + +
-
零售价最低售价
预计采购价批发价
备注
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
安全存量 + + 单位 + + + + 多单位 +
首选出库单位 + + 首选入库单位 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
价格列表计量单位零售价最低售价预计采购价批发价
基本单位
副单位
+
零售价最低售价
预计采购价批发价
+
+
+ + + + + + + + + +
颜色 + +
规格 + +
+
+ @@ -899,6 +916,8 @@ $(".price-list").hide(); $(".price-one").show(); $(".price-two").show(); + //选中基本资料tab + $("#materialFM #tt .tabs li").first().click(); oldName = ""; oldModel = ""; oldColor = ""; @@ -1199,6 +1218,8 @@ materialID = materialInfo[0]; //焦点在名称输入框==定焦在输入文字后面 $("#Name").val("").focus().val(materialInfo[1]); + //选中基本资料tab + $("#materialFM #tt .tabs li").first().click(); url = '<%=path %>/material/update.action?materialID=' + materialInfo[0]; } From db7052dec0893d155cf2b00196eb35658bb2a3dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Mon, 16 Oct 2017 00:15:18 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=9A=84=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsh/action/materials/MaterialAction.java | 9 + .../materials/MaterialPropertyAction.java | 132 ++++++++ .../dao/materials/MaterialPropertyDAO.java | 17 + .../dao/materials/MaterialPropertyIDAO.java | 9 + src/main/java/com/jsh/model/po/Material.java | 33 +- .../com/jsh/model/po/MaterialProperty.java | 66 ++++ .../jsh/model/vo/materials/MaterialModel.java | 30 ++ .../vo/materials/MaterialPropertyModel.java | 122 +++++++ .../materials/MaterialPropertyShowModel.java | 43 +++ .../materials/MaterialPropertyIService.java | 9 + .../materials/MaterialPropertyService.java | 24 ++ src/main/resources/hibernate/Material.hbm.xml | 15 + .../hibernate/MaterialProperty.hbm.xml | 31 ++ .../resources/hibernate/hibernate.cfg.xml | 1 + .../spring/basic-applicationContext.xml | 11 + .../spring/dao-applicationContext.xml | 2 + .../struts2/materialProperty-struts.xml | 11 + src/main/webapp/pages/materials/material.jsp | 40 ++- .../pages/materials/materialProperty.jsp | 298 ++++++++++++++++++ 19 files changed, 898 insertions(+), 5 deletions(-) create mode 100644 src/main/java/com/jsh/action/materials/MaterialPropertyAction.java create mode 100644 src/main/java/com/jsh/dao/materials/MaterialPropertyDAO.java create mode 100644 src/main/java/com/jsh/dao/materials/MaterialPropertyIDAO.java create mode 100644 src/main/java/com/jsh/model/po/MaterialProperty.java create mode 100644 src/main/java/com/jsh/model/vo/materials/MaterialPropertyModel.java create mode 100644 src/main/java/com/jsh/model/vo/materials/MaterialPropertyShowModel.java create mode 100644 src/main/java/com/jsh/service/materials/MaterialPropertyIService.java create mode 100644 src/main/java/com/jsh/service/materials/MaterialPropertyService.java create mode 100644 src/main/resources/hibernate/MaterialProperty.hbm.xml create mode 100644 src/main/resources/struts2/materialProperty-struts.xml create mode 100644 src/main/webapp/pages/materials/materialProperty.jsp diff --git a/src/main/java/com/jsh/action/materials/MaterialAction.java b/src/main/java/com/jsh/action/materials/MaterialAction.java index e005cb81..41108f05 100644 --- a/src/main/java/com/jsh/action/materials/MaterialAction.java +++ b/src/main/java/com/jsh/action/materials/MaterialAction.java @@ -67,6 +67,9 @@ public class MaterialAction extends BaseAction material.setPriceStrategy(model.getPriceStrategy()); material.setRemark(model.getRemark()); material.setEnabled(model.getEnabled()); + material.setOtherField1(model.getOtherField1()); + material.setOtherField2(model.getOtherField2()); + material.setOtherField3(model.getOtherField3()); materialService.create(material); //========标识位=========== @@ -161,6 +164,9 @@ public class MaterialAction extends BaseAction material.setFirstInUnit(model.getFirstInUnit()); material.setPriceStrategy(model.getPriceStrategy()); material.setRemark(model.getRemark()); + material.setOtherField1(model.getOtherField1()); + material.setOtherField2(model.getOtherField2()); + material.setOtherField3(model.getOtherField3()); materialService.update(material); flag = true; @@ -329,6 +335,9 @@ public class MaterialAction extends BaseAction item.put("PriceStrategy", material.getPriceStrategy()); item.put("Enabled", material.getEnabled()); item.put("Remark", material.getRemark()); + item.put("OtherField1", material.getOtherField1()); + item.put("OtherField2", material.getOtherField2()); + item.put("OtherField3", material.getOtherField3()); item.put("op", 1); dataArray.add(item); } diff --git a/src/main/java/com/jsh/action/materials/MaterialPropertyAction.java b/src/main/java/com/jsh/action/materials/MaterialPropertyAction.java new file mode 100644 index 00000000..9487f024 --- /dev/null +++ b/src/main/java/com/jsh/action/materials/MaterialPropertyAction.java @@ -0,0 +1,132 @@ +package com.jsh.action.materials; + +import com.jsh.base.BaseAction; +import com.jsh.base.Log; +import com.jsh.model.po.Logdetails; +import com.jsh.model.po.MaterialProperty; +import com.jsh.model.vo.materials.MaterialPropertyModel; +import com.jsh.service.materials.MaterialPropertyIService; +import com.jsh.util.PageUtil; +import net.sf.json.JSONArray; +import net.sf.json.JSONObject; +import org.springframework.dao.DataAccessException; + +import java.io.IOException; +import java.sql.Timestamp; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/* + * 商品属性 + * @author ji s h e n g hua qq:75 27 18 920 +*/ +@SuppressWarnings("serial") +public class MaterialPropertyAction extends BaseAction +{ + private MaterialPropertyIService materialPropertyService; + private MaterialPropertyModel model = new MaterialPropertyModel(); + + /** + * 更新商品属性 + * @return + */ + public void update() { + Boolean flag = false; + try { + MaterialProperty materialProperty = materialPropertyService.get(model.getId()); + materialProperty.setNativeName(model.getNativeName()); + materialProperty.setEnabled(model.getEnabled()); + materialProperty.setSort(model.getSort()); + materialProperty.setAnotherName(model.getAnotherName()); + materialPropertyService.update(materialProperty); + + flag = true; + tipMsg = "成功"; + tipType = 0; + } + catch (DataAccessException e) { + Log.errorFileSync(">>>>>>>>>>>>>修改商品属性ID为 : " + model.getId() + "失败", e); + flag = false; + tipMsg = "失败"; + tipType = 1; + } + finally { + try { + toClient(flag.toString()); + } + catch (IOException e) { + Log.errorFileSync(">>>>>>>>>>>>修改商品属性回写客户端结果异常", e); + } + } + logService.create(new Logdetails(getUser(), "更新商品属性", model.getClientIp(), + new Timestamp(System.currentTimeMillis()) + , tipType, "更新商品属性ID为 "+ model.getId() + " " + tipMsg + "!", "更新商品属性" + tipMsg)); + } + + /** + * 查找商品属性 + * @return + */ + public void findBy() { + try { + PageUtil pageUtil = new PageUtil(); + pageUtil.setPageSize(0); + pageUtil.setCurPage(0); + pageUtil.setAdvSearch(getCondition()); + materialPropertyService.find(pageUtil); + List dataList = pageUtil.getPageList(); + + JSONObject outer = new JSONObject(); + outer.put("total", pageUtil.getTotalCount()); + //存放数据json数组 + JSONArray dataArray = new JSONArray(); + if(null != dataList) { + for(MaterialProperty materialProperty:dataList) { + JSONObject item = new JSONObject(); + item.put("id", materialProperty.getId()); + item.put("nativeName", materialProperty.getNativeName()); + item.put("enabled", materialProperty.getEnabled()); + item.put("sort", materialProperty.getSort()); + item.put("anotherName", materialProperty.getAnotherName()); + dataArray.add(item); + } + } + outer.put("rows", dataArray); + //回写查询结果 + toClient(outer.toString()); + } + catch (DataAccessException e) + { + Log.errorFileSync(">>>>>>>>>>>>>>>>>>>查找商品属性异常", e); + } + catch (IOException e) + { + Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品属性结果异常", e); + } + } + + /** + * 拼接搜索条件 + * @return + */ + private Map getCondition() + { + /** + * 拼接搜索条件 + */ + Map condition = new HashMap(); + condition.put("nativeName_s_like", model.getNativeName()); + condition.put("sort_s_order", "asc"); + return condition; + } + + //=============以下spring注入以及Model驱动公共方法,与Action处理无关================== + @Override + public MaterialPropertyModel getModel() { + return model; + } + public void setMaterialPropertyService(MaterialPropertyIService materialPropertyService) { + this.materialPropertyService = materialPropertyService; + } +} diff --git a/src/main/java/com/jsh/dao/materials/MaterialPropertyDAO.java b/src/main/java/com/jsh/dao/materials/MaterialPropertyDAO.java new file mode 100644 index 00000000..ba8b8bb9 --- /dev/null +++ b/src/main/java/com/jsh/dao/materials/MaterialPropertyDAO.java @@ -0,0 +1,17 @@ +package com.jsh.dao.materials; + +import com.jsh.base.BaseDAO; +import com.jsh.model.po.MaterialProperty; + +public class MaterialPropertyDAO extends BaseDAO implements MaterialPropertyIDAO +{ + /** + * 设置dao映射基类 + * @return + */ + @Override + public Class getEntityClass() + { + return MaterialProperty.class; + } +} diff --git a/src/main/java/com/jsh/dao/materials/MaterialPropertyIDAO.java b/src/main/java/com/jsh/dao/materials/MaterialPropertyIDAO.java new file mode 100644 index 00000000..da144b83 --- /dev/null +++ b/src/main/java/com/jsh/dao/materials/MaterialPropertyIDAO.java @@ -0,0 +1,9 @@ +package com.jsh.dao.materials; + +import com.jsh.base.BaseIDAO; +import com.jsh.model.po.MaterialProperty; + +public interface MaterialPropertyIDAO extends BaseIDAO +{ + +} diff --git a/src/main/java/com/jsh/model/po/Material.java b/src/main/java/com/jsh/model/po/Material.java index 9fd5344f..11d952ff 100644 --- a/src/main/java/com/jsh/model/po/Material.java +++ b/src/main/java/com/jsh/model/po/Material.java @@ -25,6 +25,9 @@ public class Material implements java.io.Serializable private String PriceStrategy; private String Remark; private Boolean Enabled; + private String OtherField1; + private String OtherField2; + private String OtherField3; //----------以下属性导入exel表格使用-------------------- /** @@ -52,7 +55,8 @@ public class Material implements java.io.Serializable public Material(MaterialCategory materialCategory, String name, String mfrs, Double packing, Double safetyStock, String model, String standard, String color, String unit, String remark, Double retailPrice, Double lowPrice, Double presetPriceOne, Double presetPriceTwo, - Unit unitId, String firstOutUnit, String firstInUnit, String priceStrategy, Boolean enabled) { + Unit unitId, String firstOutUnit, String firstInUnit, String priceStrategy, Boolean enabled, + String otherField1, String otherField2, String otherField3) { super(); this.materialCategory = materialCategory; Name = name; @@ -73,6 +77,9 @@ public class Material implements java.io.Serializable FirstInUnit = firstInUnit; PriceStrategy = priceStrategy; Enabled = enabled; + OtherField1 = otherField1; + OtherField2 = otherField2; + OtherField3 = otherField3; } public Long getId() @@ -255,6 +262,30 @@ public class Material implements java.io.Serializable Enabled = enabled; } + public String getOtherField1() { + return OtherField1; + } + + public void setOtherField1(String otherField1) { + OtherField1 = otherField1; + } + + public String getOtherField3() { + return OtherField3; + } + + public void setOtherField3(String otherField3) { + OtherField3 = otherField3; + } + + public String getOtherField2() { + return OtherField2; + } + + public void setOtherField2(String otherField2) { + OtherField2 = otherField2; + } + public Map getCellInfo() { return cellInfo; } diff --git a/src/main/java/com/jsh/model/po/MaterialProperty.java b/src/main/java/com/jsh/model/po/MaterialProperty.java new file mode 100644 index 00000000..b3aea945 --- /dev/null +++ b/src/main/java/com/jsh/model/po/MaterialProperty.java @@ -0,0 +1,66 @@ +package com.jsh.model.po; + +@SuppressWarnings("serial") +public class MaterialProperty implements java.io.Serializable { + private Long id; + private String nativeName; + private Boolean enabled; + private String sort; + private String anotherName; + + public MaterialProperty() { + + } + + public MaterialProperty(Long id) + { + this.id = id; + } + + public MaterialProperty(String nativeName, Boolean enabled,String sort, String anotherName) { + nativeName = nativeName; + enabled = enabled; + sort = sort; + anotherName = anotherName; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getNativeName() { + return nativeName; + } + + public void setNativeName(String nativeName) { + this.nativeName = nativeName; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public String getAnotherName() { + return anotherName; + } + + public void setAnotherName(String anotherName) { + this.anotherName = anotherName; + } +} \ No newline at end of file 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 52e5816d..cd25db10 100644 --- a/src/main/java/com/jsh/model/vo/materials/MaterialModel.java +++ b/src/main/java/com/jsh/model/vo/materials/MaterialModel.java @@ -76,6 +76,12 @@ public class MaterialModel implements Serializable private File materialFile; private Boolean Enabled = true; //是否启用 + + private String OtherField1; + + private String OtherField2; + + private String OtherField3; /** * CategoryId @@ -332,6 +338,30 @@ public class MaterialModel implements Serializable Enabled = enabled; } + public String getOtherField1() { + return OtherField1; + } + + public void setOtherField1(String otherField1) { + OtherField1 = otherField1; + } + + public String getOtherField2() { + return OtherField2; + } + + public void setOtherField2(String otherField2) { + OtherField2 = otherField2; + } + + public String getOtherField3() { + return OtherField3; + } + + public void setOtherField3(String otherField3) { + OtherField3 = otherField3; + } + public String getBrowserType() { return browserType; } diff --git a/src/main/java/com/jsh/model/vo/materials/MaterialPropertyModel.java b/src/main/java/com/jsh/model/vo/materials/MaterialPropertyModel.java new file mode 100644 index 00000000..8673eb6c --- /dev/null +++ b/src/main/java/com/jsh/model/vo/materials/MaterialPropertyModel.java @@ -0,0 +1,122 @@ +package com.jsh.model.vo.materials; + +import java.io.Serializable; + +@SuppressWarnings("serial") +public class MaterialPropertyModel implements Serializable +{ + private MaterialCategoryShowModel showModel = new MaterialCategoryShowModel(); + + /**======开始接受页面参数=================**/ + /** + * 名称 + */ + private String nativeName; + + /** + * 是否启用 + */ + private Boolean enabled = true; + + /** + * 排序 + */ + private String sort; + + /** + * 别名 + */ + private String anotherName; + + /** + * Id编号 + */ + private Long id; + + /** + * 每页显示的个数 + */ + private int pageSize = 10; + + /** + * 当前页码 + */ + private int pageNo = 1; + + /** + * 用户IP,用户记录操作日志 + */ + private String clientIp = ""; + + public MaterialCategoryShowModel getShowModel() { + return showModel; + } + + public void setShowModel(MaterialCategoryShowModel showModel) { + this.showModel = showModel; + } + + public String getNativeName() { + return nativeName; + } + + public void setNativeName(String nativeName) { + this.nativeName = nativeName; + } + + public Boolean getEnabled() { + return enabled; + } + + public void setEnabled(Boolean enabled) { + this.enabled = enabled; + } + + public String getSort() { + return sort; + } + + public void setSort(String sort) { + this.sort = sort; + } + + public String getAnotherName() { + return anotherName; + } + + public void setAnotherName(String anotherName) { + this.anotherName = anotherName; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public int getPageSize() { + return pageSize; + } + + public void setPageSize(int pageSize) { + this.pageSize = pageSize; + } + + public int getPageNo() { + return pageNo; + } + + public void setPageNo(int pageNo) { + this.pageNo = pageNo; + } + + public String getClientIp() { + return clientIp; + } + + public void setClientIp(String clientIp) { + this.clientIp = clientIp; + } +} diff --git a/src/main/java/com/jsh/model/vo/materials/MaterialPropertyShowModel.java b/src/main/java/com/jsh/model/vo/materials/MaterialPropertyShowModel.java new file mode 100644 index 00000000..5fda4daa --- /dev/null +++ b/src/main/java/com/jsh/model/vo/materials/MaterialPropertyShowModel.java @@ -0,0 +1,43 @@ +package com.jsh.model.vo.materials; + +import java.io.Serializable; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@SuppressWarnings("serial") +public class MaterialPropertyShowModel implements Serializable +{ + /** + * 提示信息 + */ + private String msgTip = ""; + + /** + * 系统数据 + */ + @SuppressWarnings("rawtypes") + private Map map = new HashMap(); + + public String getMsgTip() + { + return msgTip; + } + + public void setMsgTip(String msgTip) + { + this.msgTip = msgTip; + } + + @SuppressWarnings("rawtypes") + public Map getMap() { + return map; + } + + @SuppressWarnings("rawtypes") + public void setMap(Map map) { + this.map = map; + } + + +} diff --git a/src/main/java/com/jsh/service/materials/MaterialPropertyIService.java b/src/main/java/com/jsh/service/materials/MaterialPropertyIService.java new file mode 100644 index 00000000..211a8adf --- /dev/null +++ b/src/main/java/com/jsh/service/materials/MaterialPropertyIService.java @@ -0,0 +1,9 @@ +package com.jsh.service.materials; + +import com.jsh.base.BaseIService; +import com.jsh.model.po.MaterialProperty; + +public interface MaterialPropertyIService extends BaseIService +{ + +} diff --git a/src/main/java/com/jsh/service/materials/MaterialPropertyService.java b/src/main/java/com/jsh/service/materials/MaterialPropertyService.java new file mode 100644 index 00000000..a1a30a7c --- /dev/null +++ b/src/main/java/com/jsh/service/materials/MaterialPropertyService.java @@ -0,0 +1,24 @@ +package com.jsh.service.materials; + +import com.jsh.base.BaseService; +import com.jsh.dao.materials.MaterialPropertyIDAO; +import com.jsh.model.po.MaterialProperty; + +public class MaterialPropertyService extends BaseService implements MaterialPropertyIService +{ + @SuppressWarnings("unused") + private MaterialPropertyIDAO materialPropertyDao; + + + public void setMaterialPropertyDao(MaterialPropertyIDAO materialPropertyDao) { + this.materialPropertyDao = materialPropertyDao; + } + + + @Override + protected Class getEntityClass() + { + return MaterialProperty.class; + } + +} diff --git a/src/main/resources/hibernate/Material.hbm.xml b/src/main/resources/hibernate/Material.hbm.xml index 5bf5270a..6bfb6b20 100644 --- a/src/main/resources/hibernate/Material.hbm.xml +++ b/src/main/resources/hibernate/Material.hbm.xml @@ -100,5 +100,20 @@ 启用 + + + 自定义1 + + + + + 自定义2 + + + + + 自定义3 + + diff --git a/src/main/resources/hibernate/MaterialProperty.hbm.xml b/src/main/resources/hibernate/MaterialProperty.hbm.xml new file mode 100644 index 00000000..e12109d9 --- /dev/null +++ b/src/main/resources/hibernate/MaterialProperty.hbm.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + 原始名称 + + + + + 是否启用 + + + + + 排序 + + + + + 别名 + + + + diff --git a/src/main/resources/hibernate/hibernate.cfg.xml b/src/main/resources/hibernate/hibernate.cfg.xml index a8301e72..da0f8651 100644 --- a/src/main/resources/hibernate/hibernate.cfg.xml +++ b/src/main/resources/hibernate/hibernate.cfg.xml @@ -44,5 +44,6 @@ + diff --git a/src/main/resources/spring/basic-applicationContext.xml b/src/main/resources/spring/basic-applicationContext.xml index ac3ab20e..29f61596 100644 --- a/src/main/resources/spring/basic-applicationContext.xml +++ b/src/main/resources/spring/basic-applicationContext.xml @@ -125,6 +125,17 @@ + + + + + + + + + + + diff --git a/src/main/resources/spring/dao-applicationContext.xml b/src/main/resources/spring/dao-applicationContext.xml index f9448c9d..48ad2418 100644 --- a/src/main/resources/spring/dao-applicationContext.xml +++ b/src/main/resources/spring/dao-applicationContext.xml @@ -56,4 +56,6 @@ + + diff --git a/src/main/resources/struts2/materialProperty-struts.xml b/src/main/resources/struts2/materialProperty-struts.xml new file mode 100644 index 00000000..9c29f29f --- /dev/null +++ b/src/main/resources/struts2/materialProperty-struts.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/pages/materials/material.jsp b/src/main/webapp/pages/materials/material.jsp index e3312374..befadd13 100644 --- a/src/main/webapp/pages/materials/material.jsp +++ b/src/main/webapp/pages/materials/material.jsp @@ -59,10 +59,10 @@
-
-
+
@@ -183,6 +183,30 @@ + + + + + + + + + + + + + + + +
制造商 + +
自定义1 + +
自定义2 + +
自定义3 + +
@@ -521,7 +545,8 @@ 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 + 'AaBb' + rec.Color + 'AaBb' + rec.Packing + 'AaBb' + rec.SafetyStock + 'AaBb' + rec.CategoryId + 'AaBb' + rec.CategoryName - + 'AaBb' + rec.UnitId + 'AaBb' + rec.UnitName + 'AaBb' + rec.FirstOutUnit + 'AaBb' + rec.FirstInUnit; + + 'AaBb' + rec.UnitId + 'AaBb' + rec.UnitName + 'AaBb' + rec.FirstOutUnit + 'AaBb' + rec.FirstInUnit + + 'AaBb' + rec.Mfrs + 'AaBb' + rec.OtherField1 + 'AaBb' + rec.OtherField2 + 'AaBb' + rec.OtherField3; if(1 == value) { str += '   '; @@ -1025,7 +1050,10 @@ SafetyStock : $.trim($("#SafetyStock").val()), Model : $.trim($("#Model").val()), Standard : $.trim($("#Standard").val()), - Mfrs : "", + Mfrs : $.trim($("#Mfrs").val()), + OtherField1 : $.trim($("#OtherField1").val()), + OtherField2 : $.trim($("#OtherField2").val()), + OtherField3 : $.trim($("#OtherField3").val()), Unit : $.trim($("#Unit").val()), RetailPrice : $.trim($("#RetailPrice").val()), LowPrice : $.trim($("#LowPrice").val()), @@ -1136,6 +1164,10 @@ $("#Model").val(materialInfo[2]); $("#Standard").val(materialInfo[10]=="undefined"?"":materialInfo[10]); $("#Color").val(materialInfo[3]=="undefined"?"":materialInfo[3]); + $("#Mfrs").val(materialInfo[20]=="undefined"?"":materialInfo[20]); + $("#OtherField1").val(materialInfo[21]=="undefined"?"":materialInfo[21]); + $("#OtherField2").val(materialInfo[22]=="undefined"?"":materialInfo[22]); + $("#OtherField3").val(materialInfo[23]=="undefined"?"":materialInfo[23]); $("#Unit").val(materialInfo[4]=="undefined"?"":materialInfo[4]); $("#RetailPrice").val(materialInfo[5]=="undefined"?"":materialInfo[5]); $("#LowPrice").val(materialInfo[6]=="undefined"?"":materialInfo[6]); diff --git a/src/main/webapp/pages/materials/materialProperty.jsp b/src/main/webapp/pages/materials/materialProperty.jsp new file mode 100644 index 00000000..d61ec38e --- /dev/null +++ b/src/main/webapp/pages/materials/materialProperty.jsp @@ -0,0 +1,298 @@ +<%@page import="com.jsh.util.Tools"%> +<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> +<% + String path = request.getContextPath(); + String clientIp = Tools.getLocalIp(request); +%> + + + + 商品属性 + + + + + + + + + + + + + + +
+ + + + + + + +
名称: + +   + 查询   + 重置 +
+
+ + +
+
+
+ +
+ + + + + + + + + + + + + + + + + + +
名称 + +
是否启用 + +
排序 + +
别名 + +
+ + +
+
+ 保存 + 取消 +
+ + + + \ No newline at end of file From 91f0bdd8f78beb9f7334d30467f2187fa59f77d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 18 Oct 2017 00:12:30 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0-=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E7=9A=84=E9=80=89=E6=8B=A9=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../jsh/action/materials/DepotItemAction.java | 31 ++++- .../jsh/action/materials/MaterialAction.java | 38 ++++-- .../model/vo/materials/DepotItemModel.java | 10 ++ .../jsh/model/vo/materials/MaterialModel.java | 10 ++ src/main/java/com/jsh/util/Tools.java | 7 +- src/main/webapp/js/pages/materials/in_out.js | 44 ++++++- src/main/webapp/pages/materials/material.jsp | 124 ++++++++++++++++-- 7 files changed, 232 insertions(+), 32 deletions(-) diff --git a/src/main/java/com/jsh/action/materials/DepotItemAction.java b/src/main/java/com/jsh/action/materials/DepotItemAction.java index bc061494..16788073 100644 --- a/src/main/java/com/jsh/action/materials/DepotItemAction.java +++ b/src/main/java/com/jsh/action/materials/DepotItemAction.java @@ -262,7 +262,8 @@ public class DepotItemAction extends BaseAction pageUtil.setAdvSearch(getCondition()); depotItemService.find(pageUtil); List dataList = pageUtil.getPageList(); - + String mpList = model.getMpList(); //商品属性 + String[] mpArr = mpList.split(","); JSONObject outer = new JSONObject(); outer.put("total", pageUtil.getTotalCount()); //存放数据json数组 @@ -280,11 +281,29 @@ public class DepotItemAction extends BaseAction ratio = depotItem.getMaterialId().getUnitId().getUName(); ratio = ratio.substring(ratio.indexOf("(")); } - //品名/型号/规格/颜色/包装 - String MaterialName = depotItem.getMaterialId().getName() + ((depotItem.getMaterialId().getModel() == null||depotItem.getMaterialId().getModel().equals(""))?"":"("+depotItem.getMaterialId().getModel()+ ")") - +((depotItem.getMaterialId().getStandard() == null||depotItem.getMaterialId().getStandard().equals(""))?"":"("+depotItem.getMaterialId().getStandard() + ")") - +((depotItem.getMaterialId().getColor() == null||depotItem.getMaterialId().getColor().equals(""))?"":"("+depotItem.getMaterialId().getColor() + ")") - + ratio; + //品名/型号/扩展信息/包装 + String MaterialName = depotItem.getMaterialId().getName() + ((depotItem.getMaterialId().getModel() == null || depotItem.getMaterialId().getModel().equals(""))?"":"("+depotItem.getMaterialId().getModel() + ")"); + for(int i=0; i< mpArr.length; i++) { + if(mpArr[i].equals("颜色")) { + MaterialName = MaterialName + ((depotItem.getMaterialId().getColor() == null || depotItem.getMaterialId().getColor().equals(""))?"":"("+depotItem.getMaterialId().getColor() + ")"); + } + if(mpArr[i].equals("规格")) { + MaterialName = MaterialName + ((depotItem.getMaterialId().getStandard() == null || depotItem.getMaterialId().getStandard().equals(""))?"":"("+depotItem.getMaterialId().getStandard() + ")"); + } + if(mpArr[i].equals("制造商")) { + MaterialName = MaterialName + ((depotItem.getMaterialId().getMfrs() == null || depotItem.getMaterialId().getMfrs().equals(""))?"":"("+depotItem.getMaterialId().getMfrs() + ")"); + } + if(mpArr[i].equals("自定义1")) { + MaterialName = MaterialName + ((depotItem.getMaterialId().getOtherField1() == null || depotItem.getMaterialId().getOtherField1().equals(""))?"":"("+depotItem.getMaterialId().getOtherField1() + ")"); + } + if(mpArr[i].equals("自定义2")) { + MaterialName = MaterialName + ((depotItem.getMaterialId().getOtherField2() == null || depotItem.getMaterialId().getOtherField2().equals(""))?"":"("+depotItem.getMaterialId().getOtherField2() + ")"); + } + if(mpArr[i].equals("自定义3")) { + MaterialName = MaterialName + ((depotItem.getMaterialId().getOtherField3() == null || depotItem.getMaterialId().getOtherField3().equals(""))?"":"("+depotItem.getMaterialId().getOtherField3() + ")"); + } + } + MaterialName = MaterialName + ratio; item.put("MaterialName", MaterialName); item.put("Unit", depotItem.getMUnit()); item.put("OperNumber", depotItem.getOperNumber()); diff --git a/src/main/java/com/jsh/action/materials/MaterialAction.java b/src/main/java/com/jsh/action/materials/MaterialAction.java index 41108f05..a8199dd0 100644 --- a/src/main/java/com/jsh/action/materials/MaterialAction.java +++ b/src/main/java/com/jsh/action/materials/MaterialAction.java @@ -412,8 +412,8 @@ public class MaterialAction extends BaseAction Log.errorFileSync(">>>>>>>>>>>>>>>>>>>回写查询商品信息结果异常", e); } } - - /** + + /** * 查找商品信息-下拉框 * @return */ @@ -425,6 +425,8 @@ public class MaterialAction extends BaseAction pageUtil.setAdvSearch(getCondition_Select()); materialService.find(pageUtil); List dataList = pageUtil.getPageList(); + String mpList = model.getMpList(); //商品属性 + String[] mpArr = mpList.split(","); //存放数据json数组 JSONArray dataArray = new JSONArray(); if(null != dataList) { @@ -439,11 +441,29 @@ public class MaterialAction extends BaseAction ratio = material.getUnitId().getUName(); ratio = ratio.substring(ratio.indexOf("(")); } - //品名/型号/规格/颜色/包装 - String MaterialName = material.getName() + ((material.getModel() == null || material.getModel().equals(""))?"":"("+material.getModel() + ")") - + ((material.getStandard() == null || material.getStandard().equals(""))?"":"("+material.getStandard() + ")") - + ((material.getColor() == null || material.getColor().equals(""))?"":"("+material.getColor() + ")") - + ratio; + //品名/型号/扩展信息/包装 + String MaterialName = material.getName() + ((material.getModel() == null || material.getModel().equals(""))?"":"("+material.getModel() + ")"); + for(int i=0; i< mpArr.length; i++) { + if(mpArr[i].equals("颜色")) { + MaterialName = MaterialName + ((material.getColor() == null || material.getColor().equals(""))?"":"("+material.getColor() + ")"); + } + if(mpArr[i].equals("规格")) { + MaterialName = MaterialName + ((material.getStandard() == null || material.getStandard().equals(""))?"":"("+material.getStandard() + ")"); + } + if(mpArr[i].equals("制造商")) { + MaterialName = MaterialName + ((material.getMfrs() == null || material.getMfrs().equals(""))?"":"("+material.getMfrs() + ")"); + } + if(mpArr[i].equals("自定义1")) { + MaterialName = MaterialName + ((material.getOtherField1() == null || material.getOtherField1().equals(""))?"":"("+material.getOtherField1() + ")"); + } + if(mpArr[i].equals("自定义2")) { + MaterialName = MaterialName + ((material.getOtherField2() == null || material.getOtherField2().equals(""))?"":"("+material.getOtherField2() + ")"); + } + if(mpArr[i].equals("自定义3")) { + MaterialName = MaterialName + ((material.getOtherField3() == null || material.getOtherField3().equals(""))?"":"("+material.getOtherField3() + ")"); + } + } + MaterialName = MaterialName + ratio; item.put("MaterialName", MaterialName); dataArray.add(item); } @@ -456,8 +476,10 @@ public class MaterialAction extends BaseAction } catch (IOException e) { Log.errorFileSync(">>>>>>>>>回写查询供应商信息结果异常", e); + } catch (Exception e) { + e.printStackTrace(); } - } + } /** * 查找商品信息-统计排序 diff --git a/src/main/java/com/jsh/model/vo/materials/DepotItemModel.java b/src/main/java/com/jsh/model/vo/materials/DepotItemModel.java index c4efe367..1242ed0a 100644 --- a/src/main/java/com/jsh/model/vo/materials/DepotItemModel.java +++ b/src/main/java/com/jsh/model/vo/materials/DepotItemModel.java @@ -76,6 +76,8 @@ public class DepotItemModel implements Serializable */ private InputStream excelStream; + private String mpList = ""; //商品属性 + public DepotItemShowModel getShowModel() { return showModel; } @@ -371,4 +373,12 @@ public class DepotItemModel implements Serializable public void setMType(String MType) { this.MType = MType; } + + public String getMpList() { + return mpList; + } + + public void setMpList(String mpList) { + this.mpList = mpList; + } } 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 cd25db10..105054b6 100644 --- a/src/main/java/com/jsh/model/vo/materials/MaterialModel.java +++ b/src/main/java/com/jsh/model/vo/materials/MaterialModel.java @@ -122,6 +122,8 @@ public class MaterialModel implements Serializable private String fileName = ""; //文件名称 private InputStream excelStream; //输入流,导出excel文件 + private String mpList = ""; //商品属性 + public MaterialShowModel getShowModel() { return showModel; } @@ -393,4 +395,12 @@ public class MaterialModel implements Serializable public void setMaterialFile(File materialFile) { this.materialFile = materialFile; } + + public String getMpList() { + return mpList; + } + + public void setMpList(String mpList) { + this.mpList = mpList; + } } diff --git a/src/main/java/com/jsh/util/Tools.java b/src/main/java/com/jsh/util/Tools.java index 00826344..14044acd 100644 --- a/src/main/java/com/jsh/util/Tools.java +++ b/src/main/java/com/jsh/util/Tools.java @@ -11,10 +11,7 @@ import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Calendar; -import java.util.Date; -import java.util.Locale; -import java.util.UUID; +import java.util.*; import java.util.regex.Pattern; import java.math.BigInteger; /** @@ -576,7 +573,7 @@ public class Tools { return new SimpleDateFormat(pattern).parse(strDate); } - + // /** // * 过滤html文件中的图片文件 // * @param content diff --git a/src/main/webapp/js/pages/materials/in_out.js b/src/main/webapp/js/pages/materials/in_out.js index 210e165f..8006430f 100644 --- a/src/main/webapp/js/pages/materials/in_out.js +++ b/src/main/webapp/js/pages/materials/in_out.js @@ -31,6 +31,7 @@ var oldId = 0; //编辑前的单据Id var otherColumns = true; //明细中的‘别名’列是否显示 var btnEnableList = getBtnStr(); //获取按钮的权限 + var mPropertyList = ""; //商品属性列表 $(function(){ //初始化系统基础信息 getType(); @@ -46,6 +47,7 @@ initSalesman(); //销售人员 initGift(); //初始化礼品卡 initOutItemList(); //初始化支出项目 + initMProperty(); //初始化商品属性 initTableData(); ininPager(); initForm(); @@ -357,6 +359,33 @@ } }); } + + //初始化商品属性 + function initMProperty(){ + $.ajax({ + type: "post", + url: path + "/materialProperty/findBy.action", + dataType: "json", + success: function (res) { + if (res && res.rows) { + var thisRows = res.rows; + for(var i=0; i < thisRows.length; i++) { + if(thisRows[i].enabled){ + mPropertyList += thisRows[i].nativeName +","; + } + } + if(mPropertyList){ + mPropertyList = mPropertyList.substring(0,mPropertyList.length-1); + } + } + }, + //此处添加错误处理 + error:function() { + $.messager.alert('查询提示','查询信息异常,请稍后再试!','error'); + return; + } + }); + } //初始化系统基础信息 function initSystemData_person(){ @@ -788,7 +817,7 @@ } } }, - { title: '品名(型号)(规格)(颜色)(包装)',field: 'MaterialId',width:230, + { title: '品名(型号)(扩展信息)(包装)',field: 'MaterialId',width:230, formatter:function(value,row,index){ return row.MaterialName; }, @@ -797,7 +826,7 @@ options:{ valueField:'Id', textField:'MaterialName', - method:'get', + method:'post', url: path + "/material/findBySelect.action", panelWidth: 300, //下拉框的宽度 //全面模糊匹配,过滤字段 @@ -805,6 +834,9 @@ var opts = $(this).combobox('options'); return row[opts.textField].indexOf(q) >-1; }, + onBeforeLoad: function(param){ + param.mpList = mPropertyList; //商品属性 + }, onSelect:function(rec){ if(rec) { var mId = rec.Id; @@ -1081,6 +1113,9 @@ $.ajax({ type:"post", url: path + '/depotItem/findBy.action?HeaderId=' + depotHeadID, + data: { + mpList: mPropertyList + }, dataType: "json", success: function (res) { var AllPrice = 0; @@ -1150,7 +1185,7 @@ columns:[[ { title: '商品类型',field: 'MType',width:80, hidden:isShowMaterialTypeColumn}, { title: depotHeadName,field: 'DepotName',editor:'validatebox',width:90}, - { title: '品名(型号)(规格)(颜色)(包装)',field: 'MaterialName',width:230}, + { title: '品名(型号)(扩展信息)(包装)',field: 'MaterialName',width:230}, { title: anotherDepotHeadName,field: 'AnotherDepotName',hidden:isShowAnotherDepot,width:90}, { title: '单位',field: 'Unit',editor:'validatebox',width:70}, { title: '数量',field: 'OperNumber',editor:'validatebox',width:70}, @@ -1175,6 +1210,9 @@ $.ajax({ type:"post", url: path + '/depotItem/findBy.action?HeaderId=' + depotHeadID, + data: { + mpList: mPropertyList + }, dataType: "json", success: function (res) { var AllPrice = TotalPrice; diff --git a/src/main/webapp/pages/materials/material.jsp b/src/main/webapp/pages/materials/material.jsp index befadd13..9b653d09 100644 --- a/src/main/webapp/pages/materials/material.jsp +++ b/src/main/webapp/pages/materials/material.jsp @@ -170,38 +170,38 @@
- - +
+ - + - + - + - + - + ' + trColor + ''; + var trStandard = $(".tr-standard").html(); + trStandard = '' + trStandard + ''; + var trMfrs = $(".tr-mfrs").html(); + trMfrs = '' + trMfrs + ''; + var trOtherField1 = $(".tr-otherField1").html(); + trOtherField1 = '' + trOtherField1 + ''; + var trOtherField2 = $(".tr-otherField2").html(); + trOtherField2 = '' + trOtherField2 + ''; + var trOtherField3 = $(".tr-otherField3").html(); + trOtherField3 = '' + trOtherField3 + ''; + //表格模板变更 + $(".tb-other-info").html(""); + for(var i=0; i < mPropertyList.length; i++) { + if(mPropertyList[i].nativeName === "颜色"){ + $(".tb-other-info").append(trColor); + $(".tr-color td").first().text(mPropertyList[i].anotherName); + if(mPropertyList[i].enabled) { + $(".tr-color").show(); + } + else { + $(".tr-color").hide(); + } + } + if(mPropertyList[i].nativeName === "规格"){ + $(".tb-other-info").append(trStandard); + $(".tr-standard td").first().text(mPropertyList[i].anotherName); + if(mPropertyList[i].enabled) { + $(".tr-standard").show(); + } + else { + $(".tr-standard").hide(); + } + } + if(mPropertyList[i].nativeName === "制造商"){ + $(".tb-other-info").append(trMfrs); + $(".tr-mfrs td").first().text(mPropertyList[i].anotherName); + if(mPropertyList[i].enabled) { + $(".tr-mfrs").show(); + } + else { + $(".tr-mfrs").hide(); + } + } + if(mPropertyList[i].nativeName === "自定义1"){ + $(".tb-other-info").append(trOtherField1); + $(".tr-otherField1 td").first().text(mPropertyList[i].anotherName); + if(mPropertyList[i].enabled) { + $(".tr-otherField1").show(); + } + else { + $(".tr-otherField1").hide(); + } + } + if(mPropertyList[i].nativeName === "自定义2"){ + $(".tb-other-info").append(trOtherField2); + $(".tr-otherField2 td").first().text(mPropertyList[i].anotherName); + if(mPropertyList[i].enabled) { + $(".tr-otherField2").show(); + } + else { + $(".tr-otherField2").hide(); + } + } + if(mPropertyList[i].nativeName === "自定义3"){ + $(".tb-other-info").append(trOtherField3); + $(".tr-otherField3 td").first().text(mPropertyList[i].anotherName); + if(mPropertyList[i].enabled) { + $(".tr-otherField3").show(); + } + else { + $(".tr-otherField3").hide(); + } + } + } + } + + function addMaterial() { $("#clientIp").val('<%=clientIp %>'); - $('#materialFM').form('clear'); + $('#materialFM input').val(""); //将输入框全部清空 + + bindMProperty(); //根据商品属性绑定 + $('#materialDlg').dialog('open').dialog('setTitle',' 增加商品信息'); $(".window-mask").css({ width: webW ,height: webH}); $("#Name").val("").focus(); @@ -1121,6 +1222,9 @@ var materialInfo = materialTotalInfo.split("AaBb"); $("#clientIp").val('<%=clientIp %>'); + + bindMProperty(); //根据商品属性绑定 + $("#Name").focus().val(materialInfo[1]); $("#Color").focus().val(materialInfo[11]); From cebcb90f57f863132ced45ecb3cd88c5b769ac12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Wed, 18 Oct 2017 23:08:24 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=95=86=E5=93=81?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/webapp/pages/materials/material.jsp | 230 +++++++++---------- 1 file changed, 114 insertions(+), 116 deletions(-) diff --git a/src/main/webapp/pages/materials/material.jsp b/src/main/webapp/pages/materials/material.jsp index 9b653d09..bd3f8350 100644 --- a/src/main/webapp/pages/materials/material.jsp +++ b/src/main/webapp/pages/materials/material.jsp @@ -1095,103 +1095,105 @@ } //保存信息 - $("#saveMaterial").unbind().bind({ - click:function() - { - if(!$('#materialFM').form('validate')){ - return; - } - if(checkIsExist()){ - return; - } - var parent=1; - if($("#CategoryId_f").val()!=""&&$("#CategoryId_f").val()!=null) - { - parent=$("#CategoryId_f").val(); - } - if($("#CategoryId_s").val()!=""&&$("#CategoryId_s").val()!=null) - { - parent=$("#CategoryId_s").val(); - } - if($("#CategoryId_t").val()!=""&&$("#CategoryId_t").val()!=null) - { - parent=$("#CategoryId_t").val(); - } - //构造价格列表json - var priceStrategy = []; - var basicList = {}; - var otherList = {}; - basicList.Unit = $("#basicUnit").text(); - basicList.RetailPrice = $("#basicRetailPrice").val(); - basicList.LowPrice = $("#basicLowPrice").val(); - basicList.PresetPriceOne = $("#basicPresetPriceOne").val(); - basicList.PresetPriceTwo = $("#basicPresetPriceTwo").val(); - otherList.Unit = $("#otherUnit").text(); - otherList.RetailPrice = $("#otherRetailPrice").val(); - otherList.LowPrice = $("#otherLowPrice").val(); - otherList.PresetPriceOne = $("#otherPresetPriceOne").val(); - otherList.PresetPriceTwo = $("#otherPresetPriceTwo").val(); - var basic = {}; - var other = {}; - basic.basic = basicList; - other.other = otherList; - priceStrategy.push(basic); - priceStrategy.push(other); - - $.ajax({ - type:"post", - url: url, - dataType: "json", - async : false, - data: ({ - CategoryId : parent, - Name : $.trim($("#Name").val()), - Color : $.trim($("#Color").val()), - Packing : $.trim($("#Packing").val()), - SafetyStock : $.trim($("#SafetyStock").val()), - Model : $.trim($("#Model").val()), - Standard : $.trim($("#Standard").val()), - Mfrs : $.trim($("#Mfrs").val()), - OtherField1 : $.trim($("#OtherField1").val()), - OtherField2 : $.trim($("#OtherField2").val()), - OtherField3 : $.trim($("#OtherField3").val()), - Unit : $.trim($("#Unit").val()), - RetailPrice : $.trim($("#RetailPrice").val()), - LowPrice : $.trim($("#LowPrice").val()), - PresetPriceOne : $.trim($("#PresetPriceOne").val()), - PresetPriceTwo : $.trim($("#PresetPriceTwo").val()), - UnitId : $("#manyUnit").val(), - FirstOutUnit : $.trim($("#FirstOutUnit").val()), - FirstInUnit : $.trim($("#FirstInUnit").val()), - PriceStrategy : JSON.stringify(priceStrategy), //价格列表 - Remark : $.trim($("#Remark").val()), - clientIp:'<%=clientIp %>' - }), - success: function (tipInfo) - { - if(tipInfo) - { - $('#materialDlg').dialog('close'); - - var opts = $("#tableData").datagrid('options'); - showMaterialDetails(opts.pageNumber,opts.pageSize); - } - else - { - $.messager.show({ - title: '错误提示', - msg: '保存商品信息失败,请稍后重试!' - }); - } - }, - //此处添加错误处理 - error:function() - { - $.messager.alert('提示','保存商品信息异常,请稍后再试!','error'); - return; - } - }); + $("#saveMaterial").off("click").on("click",function() { + if(!$('#Name').val()){ + $.messager.alert('提示','品名不能为空!','warning'); + return; } + if(!$('#Model').val()){ + $.messager.alert('提示','型号不能为空!','warning'); + return; + } + if(checkIsExist()){ + return; + } + var parent=1; + if($("#CategoryId_f").val()!=""&&$("#CategoryId_f").val()!=null) + { + parent=$("#CategoryId_f").val(); + } + if($("#CategoryId_s").val()!=""&&$("#CategoryId_s").val()!=null) + { + parent=$("#CategoryId_s").val(); + } + if($("#CategoryId_t").val()!=""&&$("#CategoryId_t").val()!=null) + { + parent=$("#CategoryId_t").val(); + } + //构造价格列表json + var priceStrategy = []; + var basicList = {}; + var otherList = {}; + basicList.Unit = $("#basicUnit").text(); + basicList.RetailPrice = $("#basicRetailPrice").val(); + basicList.LowPrice = $("#basicLowPrice").val(); + basicList.PresetPriceOne = $("#basicPresetPriceOne").val(); + basicList.PresetPriceTwo = $("#basicPresetPriceTwo").val(); + otherList.Unit = $("#otherUnit").text(); + otherList.RetailPrice = $("#otherRetailPrice").val(); + otherList.LowPrice = $("#otherLowPrice").val(); + otherList.PresetPriceOne = $("#otherPresetPriceOne").val(); + otherList.PresetPriceTwo = $("#otherPresetPriceTwo").val(); + var basic = {}; + var other = {}; + basic.basic = basicList; + other.other = otherList; + priceStrategy.push(basic); + priceStrategy.push(other); + + $.ajax({ + type:"post", + url: url, + dataType: "json", + async : false, + data: ({ + CategoryId : parent, + Name : $.trim($("#Name").val()), + Color : $.trim($("#Color").val()), + Packing : $.trim($("#Packing").val()), + SafetyStock : $.trim($("#SafetyStock").val()), + Model : $.trim($("#Model").val()), + Standard : $.trim($("#Standard").val()), + Mfrs : $.trim($("#Mfrs").val()), + OtherField1 : $.trim($("#OtherField1").val()), + OtherField2 : $.trim($("#OtherField2").val()), + OtherField3 : $.trim($("#OtherField3").val()), + Unit : $.trim($("#Unit").val()), + RetailPrice : $.trim($("#RetailPrice").val()), + LowPrice : $.trim($("#LowPrice").val()), + PresetPriceOne : $.trim($("#PresetPriceOne").val()), + PresetPriceTwo : $.trim($("#PresetPriceTwo").val()), + UnitId : $("#manyUnit").val(), + FirstOutUnit : $.trim($("#FirstOutUnit").val()), + FirstInUnit : $.trim($("#FirstInUnit").val()), + PriceStrategy : JSON.stringify(priceStrategy), //价格列表 + Remark : $.trim($("#Remark").val()), + clientIp:'<%=clientIp %>' + }), + success: function (tipInfo) + { + if(tipInfo) + { + $('#materialDlg').dialog('close'); + + var opts = $("#tableData").datagrid('options'); + showMaterialDetails(opts.pageNumber,opts.pageSize); + } + else + { + $.messager.show({ + title: '错误提示', + msg: '保存商品信息失败,请稍后重试!' + }); + } + }, + //此处添加错误处理 + error:function() + { + $.messager.alert('提示','保存商品信息异常,请稍后再试!','error'); + return; + } + }); }); var mId=0,mName=""; @@ -1473,27 +1475,23 @@ }); //导入excel表格 - $("#saveimport").unbind().bind({ - click:function() - { - if($("#materialFile").val().length == 0) - { - $.messager.alert('提示','请选择文件!','info'); - return; - } - $("#importExcelFM").submit(); - $('#importExcelDlg').dialog('close'); - - $.messager.progress({ - title:'请稍候', - msg:'数据处理ing...' - }); - setTimeout(function(){ - $.messager.progress('close'); - var opts = $("#tableData").datagrid('options'); - showMaterialDetails(opts.pageNumber,opts.pageSize); - },3300); + $("#saveimport").off("click").on("click",function() { + if($("#materialFile").val().length == 0) { + $.messager.alert('提示','请选择文件!','info'); + return; } + $("#importExcelFM").submit(); + $('#importExcelDlg').dialog('close'); + + $.messager.progress({ + title:'请稍候', + msg:'数据处理ing...' + }); + setTimeout(function(){ + $.messager.progress('close'); + var opts = $("#tableData").datagrid('options'); + showMaterialDetails(opts.pageNumber,opts.pageSize); + },3300); }); } From fe48c6379bfa625cec3bcb751eaccf8262855f9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Thu, 19 Oct 2017 22:31:26 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E5=87=BA=E5=85=A5=E5=BA=93=E5=8D=95?= =?UTF-8?q?=E6=8D=AE=E5=8E=BB=E6=8E=89'=E9=A2=9C=E8=89=B2'=E5=AD=97?= =?UTF-8?q?=E6=AE=B5=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/jsh/dao/materials/DepotHeadDAO.java | 4 ++-- src/main/webapp/pages/materials/allocation_out_list.jsp | 2 +- src/main/webapp/pages/materials/assemble_list.jsp | 2 +- src/main/webapp/pages/materials/disassemble_list.jsp | 2 +- src/main/webapp/pages/materials/gift_out_list.jsp | 2 +- src/main/webapp/pages/materials/gift_recharge_list.jsp | 2 +- src/main/webapp/pages/materials/other_in_list.jsp | 2 +- src/main/webapp/pages/materials/other_out_list.jsp | 2 +- src/main/webapp/pages/materials/purchase_back_list.jsp | 2 +- src/main/webapp/pages/materials/purchase_in_list.jsp | 2 +- src/main/webapp/pages/materials/retail_back_list.jsp | 2 +- src/main/webapp/pages/materials/retail_out_list.jsp | 2 +- src/main/webapp/pages/materials/sale_back_list.jsp | 2 +- src/main/webapp/pages/materials/sale_out_list.jsp | 2 +- 14 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/jsh/dao/materials/DepotHeadDAO.java b/src/main/java/com/jsh/dao/materials/DepotHeadDAO.java index e4ca6588..27f9c8ea 100644 --- a/src/main/java/com/jsh/dao/materials/DepotHeadDAO.java +++ b/src/main/java/com/jsh/dao/materials/DepotHeadDAO.java @@ -122,7 +122,7 @@ public class DepotHeadDAO extends BaseDAO implements DepotHeadIDAO { @SuppressWarnings("unchecked") public void findMaterialsListByHeaderId(PageUtil pageUtil,Long headerId) throws JshException { StringBuffer queryString = new StringBuffer(); - queryString.append("select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model,' ',jsh_material.Color)) as mName from jsh_depotitem inner join jsh_material " + + queryString.append("select group_concat(concat(jsh_material.`Name`,' ',jsh_material.Model)) as mName from jsh_depotitem inner join jsh_material " + " on jsh_depotitem.MaterialId = jsh_material.Id where jsh_depotitem.HeaderId ="+ headerId); Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch())); pageUtil.setPageList(query.list()); @@ -164,7 +164,7 @@ public class DepotHeadDAO extends BaseDAO implements DepotHeadIDAO { public void getHeaderIdByMaterial(PageUtil pageUtil,String materialParam) throws JshException { StringBuffer queryString = new StringBuffer(); queryString.append("select group_concat(CAST(dt.HeaderId AS CHAR)) as ids from jsh_depotitem dt INNER JOIN jsh_material m on dt.MaterialId = m.Id where m.`Name` "+ - " like '%" + materialParam + "%' or m.Model like '%" + materialParam + "%' or m.Color like '%" + materialParam + "%'"); + " like '%" + materialParam + "%' or m.Model like '%" + materialParam + "%'"); Query query = this.getHibernateTemplate().getSessionFactory().getCurrentSession().createSQLQuery(queryString + SearchConditionUtil.getCondition(pageUtil.getAdvSearch())); pageUtil.setPageList(query.list()); } diff --git a/src/main/webapp/pages/materials/allocation_out_list.jsp b/src/main/webapp/pages/materials/allocation_out_list.jsp index 6f8e1c1d..2476827f 100644 --- a/src/main/webapp/pages/materials/allocation_out_list.jsp +++ b/src/main/webapp/pages/materials/allocation_out_list.jsp @@ -39,7 +39,7 @@
颜色
规格
制造商
自定义1
自定义2
自定义3 @@ -252,10 +252,12 @@ var setCategoryId="1"; var cid=1; var multiple = 0; //倍数 + var mPropertyList = null; //商品属性列表 //初始化界面 $(function() { //初始化系统基础信息 + initMProperty(); initSystemData(1); initSelectInfo("search_first"); initSelectInfo("edit_first"); @@ -268,6 +270,23 @@ }); //初始化系统基础信息 + function initMProperty() { + $.ajax({ + type: "post", + url: "<%=path%>/materialProperty/findBy.action", + dataType: "json", + success: function (res) { + if (res && res.rows) { + mPropertyList = res.rows; //属性列表 + } + }, + //此处添加错误处理 + error:function() { + $.messager.alert('查询提示','查询信息异常,请稍后再试!','error'); + return; + } + }); + } function initSystemData(parentid_search) { $.ajax({ type:"post", @@ -921,10 +940,92 @@ var oldUnit = ""; var oldManyUnit = ""; - function addMaterial() - { + //根据商品属性架子啊 + function bindMProperty(){ + var trColor = $(".tr-color").html(); + trColor = '
商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/assemble_list.jsp b/src/main/webapp/pages/materials/assemble_list.jsp index d6a91e70..bd7ba1d1 100644 --- a/src/main/webapp/pages/materials/assemble_list.jsp +++ b/src/main/webapp/pages/materials/assemble_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/disassemble_list.jsp b/src/main/webapp/pages/materials/disassemble_list.jsp index 13f77a65..e089d7c1 100644 --- a/src/main/webapp/pages/materials/disassemble_list.jsp +++ b/src/main/webapp/pages/materials/disassemble_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/gift_out_list.jsp b/src/main/webapp/pages/materials/gift_out_list.jsp index f403257b..cad30045 100644 --- a/src/main/webapp/pages/materials/gift_out_list.jsp +++ b/src/main/webapp/pages/materials/gift_out_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/gift_recharge_list.jsp b/src/main/webapp/pages/materials/gift_recharge_list.jsp index cb7c05a4..2999e724 100644 --- a/src/main/webapp/pages/materials/gift_recharge_list.jsp +++ b/src/main/webapp/pages/materials/gift_recharge_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/other_in_list.jsp b/src/main/webapp/pages/materials/other_in_list.jsp index b03e4aac..3f6231dd 100644 --- a/src/main/webapp/pages/materials/other_in_list.jsp +++ b/src/main/webapp/pages/materials/other_in_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/other_out_list.jsp b/src/main/webapp/pages/materials/other_out_list.jsp index 6e38c6b4..1552ec4f 100644 --- a/src/main/webapp/pages/materials/other_out_list.jsp +++ b/src/main/webapp/pages/materials/other_out_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/purchase_back_list.jsp b/src/main/webapp/pages/materials/purchase_back_list.jsp index bd7b2586..bda51069 100644 --- a/src/main/webapp/pages/materials/purchase_back_list.jsp +++ b/src/main/webapp/pages/materials/purchase_back_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/purchase_in_list.jsp b/src/main/webapp/pages/materials/purchase_in_list.jsp index 0b66495c..e0f17ab6 100644 --- a/src/main/webapp/pages/materials/purchase_in_list.jsp +++ b/src/main/webapp/pages/materials/purchase_in_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/retail_back_list.jsp b/src/main/webapp/pages/materials/retail_back_list.jsp index 7410e010..e1ec053e 100644 --- a/src/main/webapp/pages/materials/retail_back_list.jsp +++ b/src/main/webapp/pages/materials/retail_back_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/retail_out_list.jsp b/src/main/webapp/pages/materials/retail_out_list.jsp index 7c511c50..62398605 100644 --- a/src/main/webapp/pages/materials/retail_out_list.jsp +++ b/src/main/webapp/pages/materials/retail_out_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/sale_back_list.jsp b/src/main/webapp/pages/materials/sale_back_list.jsp index 6e75e058..427715cd 100644 --- a/src/main/webapp/pages/materials/sale_back_list.jsp +++ b/src/main/webapp/pages/materials/sale_back_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: diff --git a/src/main/webapp/pages/materials/sale_out_list.jsp b/src/main/webapp/pages/materials/sale_out_list.jsp index 6d5f75fa..e91a66e3 100644 --- a/src/main/webapp/pages/materials/sale_out_list.jsp +++ b/src/main/webapp/pages/materials/sale_out_list.jsp @@ -39,7 +39,7 @@ 商品信息: - + 单据日期: From 5e227b3c7d03528f3759f5354759a57ef630ae83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A3=E5=9C=A3=E5=8D=8E?= <752718920@qq.com> Date: Thu, 19 Oct 2017 23:17:31 +0800 Subject: [PATCH 8/8] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/jsh/util/AssetConstants.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/jsh/util/AssetConstants.java b/src/main/java/com/jsh/util/AssetConstants.java index 1940450e..06a190ed 100644 --- a/src/main/java/com/jsh/util/AssetConstants.java +++ b/src/main/java/com/jsh/util/AssetConstants.java @@ -115,5 +115,6 @@ public interface AssetConstants * action返回excel结果 */ public static final String EXCEL = "excel"; + } }