Index: ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryrecordView.jsp =================================================================== diff -u -r13179 -r15651 --- ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryrecordView.jsp (.../inventoryrecordView.jsp) (revision 13179) +++ ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryrecordView.jsp (.../inventoryrecordView.jsp) (revision 15651) @@ -19,6 +19,7 @@ + Index: ssts-web/src/main/java/com/forgon/disinfectsystem/inventoryrecord/service/InventoryRecordManagerImpl.java =================================================================== diff -u -r15603 -r15651 --- ssts-web/src/main/java/com/forgon/disinfectsystem/inventoryrecord/service/InventoryRecordManagerImpl.java (.../InventoryRecordManagerImpl.java) (revision 15603) +++ ssts-web/src/main/java/com/forgon/disinfectsystem/inventoryrecord/service/InventoryRecordManagerImpl.java (.../InventoryRecordManagerImpl.java) (revision 15651) @@ -4,8 +4,10 @@ import java.io.IOException; import java.io.OutputStream; import java.sql.ResultSet; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.ArrayList; +import java.util.Calendar; import java.util.Date; import java.util.HashMap; import java.util.LinkedList; @@ -24,8 +26,9 @@ import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.poifs.filesystem.POIFSFileSystem; -import org.bouncycastle.crypto.RuntimeCryptoException; +import org.apache.poi.ss.util.Region; +import com.forgon.Constants; import com.forgon.directory.acegi.tools.AcegiHelper; import com.forgon.directory.model.OrgUnit; import com.forgon.directory.vo.LoginUserData; @@ -55,12 +58,12 @@ import com.forgon.excel.service.ExcelUtils; import com.forgon.serialnumber.model.SerialNum; import com.forgon.serialnumber.service.SerialNumManager; +import com.forgon.tools.MathTools; import com.forgon.tools.Path; import com.forgon.tools.db.DatabaseUtil; import com.forgon.tools.excel.ExcelCellStyle; import com.forgon.tools.excel.ExcelHelper; import com.forgon.tools.hibernate.ObjectDao; -import com.sun.xml.internal.ws.client.dispatch.DispatchImpl; /** * @author qjw @@ -431,7 +434,7 @@ List items = new ArrayList(); - String sql = "select min(m.externalCode),min(m.name),min(m.specification),sum(s.amount),min(m.cost),m.id from MaterialDefinition m " + String sql = "select min(m.externalCode),min(m.name),min(m.specification),sum(s.amount),min(m.cost),m.id,min(m.unit) from MaterialDefinition m " + "left join GoodsStock s on m.id = s.materialDefinitionId where m.isMonthCheck = '是' and " + "wareHouseId = " + wareHouseId + " group by m.id order by min(m.externalCode) asc"; ResultSet rs = objectDao.executeSql(sql); @@ -451,6 +454,7 @@ item.setExternalCode(rs.getString(1)); item.setWareHouseId(wareHouseId); item.setWareHouseName(warehouse.getName()); + item.setUnit(rs.getString(7)); items.add(item); } record.setItems(items); @@ -588,6 +592,7 @@ item.setExternalCode(disposableGoodsStock.getExternalCode()); item.setExpDate(disposableGoodsBatchStock.getExpDate()); item.setGoodsType(goodsType); + item.setUnit(disposableGoodsStock.getUnit()); return item; } @@ -739,31 +744,227 @@ } } + @Override - public void exportInventoryReocrd(OutputStream ops,String id) { + public void exportInventoryReocrd(OutputStream ops,String id,String params) { if(StringUtils.isNotBlank(id)){ InventoryRecord record = getById(id); if(record != null){ - createExportFile(record, ops); + JSONObject obj = null; + if(StringUtils.isNotBlank(params)){ + try { + obj = JSONObject.fromObject(params); + } catch (Exception e) { + throw new RuntimeException("导出excel配置错误!"); + } + } + createInventoryExportFile(record,obj,ops); } } } - - public void createExportFile(InventoryRecord record,OutputStream ops) { - String inputFile = Path.getWebAppRoot() - + "/disinfectsystem/reportforms/emptyExcelDemo.xls"; - FileInputStream fos = null; - POIFSFileSystem fs = null; - HSSFWorkbook wb = null; + private void createInventoryExportFile(InventoryRecord record,JSONObject params,OutputStream ops){ + buildTableColumnName(record, params, ops); + } + + public void buildTableColumnName(InventoryRecord record,JSONObject paramsJson,OutputStream ops){ try { - fos = new FileInputStream(inputFile); - fs = new POIFSFileSystem(fos); - wb = new HSSFWorkbook(fs); - ExcelHelper.setWorkbook(wb); - ExcelCellStyle.iniAllStyles(); + HSSFWorkbook wb = buildExcelFile(ops); HSSFSheet sheet = wb.getSheetAt(0); + HSSFCellStyle cellStyle = buildExcelStyle(wb); + int sheetColumnSize = 0; + //有配置项 + if (paramsJson == null) { + paramsJson = new JSONObject(); + if (InventoryRecord.TYPE_DISPOSABLEGOOD.equals(record.getType())) { + paramsJson.put("columns", InventoryItem.disposableGoodsColumnNameAndPoPropertyNameArrray); + sheetColumnSize = InventoryItem.disposableGoodsColumnNameAndPoPropertyNameArrray.size(); + } else { + sheetColumnSize = InventoryItem.materialColumnNameAndPoPropertyNameArrray.size(); + paramsJson.put("columns", InventoryItem.materialColumnNameAndPoPropertyNameArrray); + } + }else{ + JSONArray columns = paramsJson.optJSONArray("columns"); + if(columns != null){ + sheetColumnSize = columns.size(); + } + } + buildExcelCell(record,paramsJson, wb,sheet, cellStyle,sheetColumnSize); + //调整列宽度 + for(int i = 0 ;i sumColumnMap = new HashMap(); + int seriaNum = 1; + if(columnJsonArray != null && columnJsonArray.size() > 0 && record.getItems() != null){ + JSONArray itemsArray = JSONArray.fromObject(record.getItems()); + for (int i = 0 ;i < itemsArray.size() ; i++){ + HSSFRow operatingRow = sheet.createRow(row); + JSONObject obj = itemsArray.optJSONObject(i); + obj.put("rowIndex", seriaNum); + seriaNum++; + obj.put("totalPrice", MathTools.mul(obj.optInt("amount"), obj.optDouble("price"), 4).doubleValue()); + + for(int j = 0 ; j < columnJsonArray.size() ; j ++){ + JSONObject configObj = columnJsonArray.optJSONObject(j); + String propertyName = configObj.optString("dataIndex"); + if(propertyName.equals("inSixMonth")){ + obj.put("inSixMonth",isInSixMonthWithExpDate(obj.optString("expDateString"))); + } + //是否合计列 + if(configObj.optBoolean("columnValueSum")){ + Double sumValue = sumColumnMap.get(propertyName); + if(sumValue == null){ + sumValue = 0d; + } + sumColumnMap.put(propertyName, sumValue + obj.optDouble(propertyName)); + } + if(configObj.optString("type").equals("int")){ + ExcelUtils.createIntCell(operatingRow, cellStyle, j,obj.optInt(propertyName)); + }else if(configObj.optString("type").equals("double")){ + ExcelUtils.createDoubleCell(operatingRow, cellStyle, j,obj.optDouble(propertyName)); + }else{ + ExcelUtils.createStringCell(operatingRow, cellStyle, j,obj.optString(propertyName)); + } + } + row++; + } + } + //合计 + if(sumColumnMap.size() > 0){ + HSSFRow operatingRow = sheet.createRow(row); + if(columnJsonArray != null){ + for(int i = 0 ; i < columnJsonArray.size() ; i ++){ + JSONObject obj = columnJsonArray.optJSONObject(i); + Double columnTotalValue = sumColumnMap.get(obj.optString("dataIndex")); + if(columnTotalValue != null){ + ExcelUtils.createDoubleCell(operatingRow, cellStyle, i, columnTotalValue); + }else{ + ExcelUtils.createStringCell(operatingRow, cellStyle, i, ""); + } + } + } + } + //页脚 + JSONArray columnFooterArray = paramsJson.optJSONArray("columnFooter"); + if(columnFooterArray != null){ + for(int i = 0 ; i < columnFooterArray.size() ; i ++){ + row++; + HSSFRow operatingRow = sheet.createRow(row); + JSONArray itemArray = columnFooterArray.optJSONObject(i).optJSONArray("items"); + if(itemArray != null){ + for(int j = 0 ; j < itemArray.size() ; j++){ + JSONObject footerItem = itemArray.optJSONObject(j); + String header = footerItem.optString("header"); + String dataIndex = footerItem.optString("dataIndex"); + Integer columnIndex = footerItem.optInt("columnIndex"); + ExcelUtils.createStringCell(operatingRow, nullCellStyle, columnIndex,(header + ":" + recordJson.optString(dataIndex))); + } + } + } + } + } + private HSSFCellStyle buildNullCellStyle(HSSFWorkbook wb) { + HSSFCellStyle cellStyle2 = wb.createCellStyle(); // 数据单元格格式 + cellStyle2.setAlignment(HSSFCellStyle.ALIGN_CENTER); // 居中 + HSSFFont font = wb.createFont(); + font.setFontHeightInPoints((short) 10); // 设置字体大小为10 + font.setFontName("宋体"); + cellStyle2.setFont(font); + return cellStyle2; + } + + /** + * 失效期是否6个月以内 + * @param expDateString + * @return + */ + private String isInSixMonthWithExpDate(String expDateString){ + if(StringUtils.isNotBlank(expDateString)){ + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.MONTH, 6); + + Date date = calendar.getTime(); + Date goodsExpDate = null; + try { + goodsExpDate = Constants.SIMPLEDATEFORMAT_YYYYMMDD.parse(expDateString); + } catch (ParseException e) { + e.printStackTrace(); + } + if(goodsExpDate != null && goodsExpDate.before(date)){ + return Constants.STR_YES; + } + } + return ""; + } + + public HSSFCellStyle buildExcelStyle(HSSFWorkbook wb){ + if(wb != null){ HSSFCellStyle cellStyle = wb.createCellStyle(); // 数据单元格格式 cellStyle.setWrapText(true); cellStyle.setBorderBottom(HSSFCellStyle.BORDER_THIN); @@ -775,66 +976,26 @@ font.setFontHeightInPoints((short) 10); // 设置字体大小为10 font.setFontName("宋体"); cellStyle.setFont(font); - - HSSFRow operatingRow1 = sheet.createRow(0); - if(InventoryRecord.TYPE_DISPOSABLEGOOD.equals(record.getType())){ - ExcelUtils.createStringCell(operatingRow1, cellStyle, 0, "序号"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 1, "外部编码"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 2, "名称"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 3, "规格"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 4, "批次"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 5, "账面数量"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 6, "盘点数量"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 7, "单价"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 8, "供应商"); - }else{ - ExcelUtils.createStringCell(operatingRow1, cellStyle, 0, "序号"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 1, "名称"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 2, "规格"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 3, "账面数量"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 4, "盘点数量"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 5, "单价"); - ExcelUtils.createStringCell(operatingRow1, cellStyle, 6, "供应商"); - } - - int row = 1; - if(record.getItems() != null){ - for (InventoryItem item : record.getItems()) { - HSSFRow operatingRow = sheet.createRow(row); - ExcelUtils.createIntCell(operatingRow, cellStyle, 0, row); - if(InventoryRecord.TYPE_DISPOSABLEGOOD.equals(record.getType())){ - ExcelUtils.createStringCell(operatingRow, cellStyle, 1, item.getExternalCode()); - ExcelUtils.createStringCell(operatingRow, cellStyle, 2,item.getMaterialName()); - ExcelUtils.createStringCell(operatingRow, cellStyle, 3, item.getSpecification()); - ExcelUtils.createStringCell(operatingRow, cellStyle, 4, item.getBatchNumber()); - ExcelUtils.createIntCell(operatingRow, cellStyle, 5, item.getStorage()); - ExcelUtils.createIntCell(operatingRow, cellStyle, 6, item.getAmount()); - ExcelUtils.createDoubleCell(operatingRow, cellStyle, 7, item.getPrice()); - ExcelUtils.createStringCell(operatingRow, cellStyle, 8, item.getSupplierName()); - }else{ - ExcelUtils.createStringCell(operatingRow, cellStyle, 1,item.getMaterialName()); - ExcelUtils.createStringCell(operatingRow, cellStyle, 2, item.getSpecification()); - ExcelUtils.createIntCell(operatingRow, cellStyle, 3, item.getStorage()); - ExcelUtils.createIntCell(operatingRow, cellStyle, 4, item.getAmount()); - ExcelUtils.createDoubleCell(operatingRow, cellStyle, 5, item.getPrice()); - ExcelUtils.createStringCell(operatingRow, cellStyle, 6, item.getSupplierName()); - } - - row++; - } - } - wb.write(ops); - } catch (Exception e) { - e.printStackTrace(); - } finally { - try { - ops.close(); - fos.close(); - } catch (IOException e) { - e.printStackTrace(); - } + return cellStyle; } + return null; } - + public HSSFWorkbook buildExcelFile(OutputStream ops){ + String inputFile = Path.getWebAppRoot() + + "/disinfectsystem/reportforms/emptyExcelDemo.xls"; + FileInputStream fos = null; + POIFSFileSystem fs = null; + HSSFWorkbook wb = null; + try { + fos = new FileInputStream(inputFile); + fs = new POIFSFileSystem(fos); + wb = new HSSFWorkbook(fs); + ExcelHelper.setWorkbook(wb); + ExcelCellStyle.iniAllStyles(); + }catch (Exception e) { + e.printStackTrace(); + } + return wb; + } } Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/stocktakemanager/InventoryItem.java =================================================================== diff -u -r13948 -r15651 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/stocktakemanager/InventoryItem.java (.../InventoryItem.java) (revision 13948) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/stocktakemanager/InventoryItem.java (.../InventoryItem.java) (revision 15651) @@ -16,12 +16,13 @@ import javax.persistence.OneToMany; import javax.persistence.Transient; +import net.sf.json.JSONArray; + import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; import org.hibernate.annotations.Cascade; -import com.forgon.disinfectsystem.entity.assestmanagement.DisposableGoods; -import com.forgon.tools.hibernate.ObjectDao; +import com.forgon.Constants; /** * 盘点物品明细 @@ -75,6 +76,34 @@ private Date expDate;//失效期 + private String unit;//单位 + + //导出使用临时变量 + private Integer rowIndex; + + public static JSONArray disposableGoodsColumnNameAndPoPropertyNameArrray = new JSONArray(); + public static JSONArray materialColumnNameAndPoPropertyNameArrray = new JSONArray(); + static { + disposableGoodsColumnNameAndPoPropertyNameArrray.add("{header:'序号',dataIndex:'rowIndex',type:'int'}"); + disposableGoodsColumnNameAndPoPropertyNameArrray.add("{header:'外部编码',dataIndex:'externalCode',type:'string'}"); + disposableGoodsColumnNameAndPoPropertyNameArrray.add("{header:'名称',dataIndex:'materialName',type:'string'}"); + disposableGoodsColumnNameAndPoPropertyNameArrray.add("{header:'规格',dataIndex:'specification',type:'string'}"); + disposableGoodsColumnNameAndPoPropertyNameArrray.add("{header:'批次',dataIndex:'batchNumber',type:'string'}"); + disposableGoodsColumnNameAndPoPropertyNameArrray.add("{header:'账面数量',dataIndex:'storage',type:'int'}"); + disposableGoodsColumnNameAndPoPropertyNameArrray.add("{header:'盘点数量',dataIndex:'amount',type:'int'}"); + disposableGoodsColumnNameAndPoPropertyNameArrray.add("{header:'单价',dataIndex:'price',type:'double'}"); + disposableGoodsColumnNameAndPoPropertyNameArrray.add("{header:'供应商',dataIndex:'supplierName',type:'string'}"); + + materialColumnNameAndPoPropertyNameArrray.add("{header:'序号',dataIndex:'rowIndex',type:'int'}"); + materialColumnNameAndPoPropertyNameArrray.add("{header:'名称',dataIndex:'materialName',type:'string'}"); + materialColumnNameAndPoPropertyNameArrray.add("{header:'规格',dataIndex:'specification',type:'string'}"); + materialColumnNameAndPoPropertyNameArrray.add("{header:'账面数量',dataIndex:'storage',type:'int'}"); + materialColumnNameAndPoPropertyNameArrray.add("{header:'盘点数量',dataIndex:'amount',type:'int'}"); + materialColumnNameAndPoPropertyNameArrray.add("{header:'单价',dataIndex:'price',type:'double'}"); + materialColumnNameAndPoPropertyNameArrray.add("{header:'供应商',dataIndex:'supplierName',type:'string'}"); + } + + /** * 仓库ID */ @@ -293,7 +322,31 @@ public void setItems(List items) { this.items = items; } + + @Transient + public Integer getRowIndex() { + return rowIndex; + } + + public void setRowIndex(Integer rowIndex) { + this.rowIndex = rowIndex; + } - - + @Transient + public String getExpDateString(){ + if(expDate != null){ + String str = Constants.SIMPLEDATEFORMAT_YYYYMMDD.format(expDate); + return str; + } + return ""; + } + + public String getUnit() { + return unit; + } + + public void setUnit(String unit) { + this.unit = unit; + } + } Index: ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/exportInventoryRecord.jsp =================================================================== diff -u -r13916 -r15651 --- ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/exportInventoryRecord.jsp (.../exportInventoryRecord.jsp) (revision 13916) +++ ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/exportInventoryRecord.jsp (.../exportInventoryRecord.jsp) (revision 15651) @@ -8,10 +8,12 @@ } String fileName="盘点记录" + time + ".xls"; String id = request.getParameter("id"); +String excelConfig = request.getParameter("excelConfig"); ServletOutputStream servletOutputStream = response.getOutputStream(); response.setContentType("application/octet-stream"); response.addHeader("Content-Disposition","attachment;filename=" + new String(fileName.getBytes("GBK"), "ISO8859_1")); InventoryRecordManager inventoryRecordManager = (InventoryRecordManager)SpringBeanManger.getBean("inventoryRecordManager"); -inventoryRecordManager.exportInventoryReocrd(response.getOutputStream(),id); -servletOutputStream.flush(); +inventoryRecordManager.exportInventoryReocrd(response.getOutputStream(),id,excelConfig); +out.clear(); +out = pageContext.pushBody(); %> \ No newline at end of file Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/stocktakemanager/InventoryRecord.java =================================================================== diff -u -r14168 -r15651 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/stocktakemanager/InventoryRecord.java (.../InventoryRecord.java) (revision 14168) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/entity/stocktakemanager/InventoryRecord.java (.../InventoryRecord.java) (revision 15651) @@ -15,10 +15,13 @@ import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.OneToMany; +import javax.persistence.Transient; import org.hibernate.annotations.Cache; import org.hibernate.annotations.CacheConcurrencyStrategy; +import com.forgon.Constants; + /** * 盘点信息 * @author wangyi @@ -157,4 +160,13 @@ this.orgUnitName = orgUnitName; } + @Transient + public String getTimeString(){ + if(time != null){ + String str = Constants.SIMPLEDATEFORMAT_YYYYMMDD.format(time); + return str; + } + return ""; + } + } Index: ssts-web/src/main/webapp/disinfectsystem/config/dgsdhyy/print/printConfig.js =================================================================== diff -u -r15039 -r15651 --- ssts-web/src/main/webapp/disinfectsystem/config/dgsdhyy/print/printConfig.js (.../printConfig.js) (revision 15039) +++ ssts-web/src/main/webapp/disinfectsystem/config/dgsdhyy/print/printConfig.js (.../printConfig.js) (revision 15651) @@ -1,3 +1,35 @@ +//盘点导出Excel配置 +var inventoryExportExcelConfig = { + title : "供应室物资盘点表", + headerFooter : [ + { + items:[ + {header : "盘点日期", dataIndex : 'timeString',columnIndex:6}//columnIndex 第几列显示 + ] + } + ], + columns : [ + {header : "物品名称", dataIndex : 'materialName', type:'string'}, + {header : "规格型号", dataIndex : 'specification', type:'string'}, + {header : "单位", dataIndex : 'unit', type:'string'}, + {header : "账面数量", dataIndex : 'storage', type:'int'}, + {header : "盘点数量", dataIndex : 'amount', type:'int'}, + {header : "单价", dataIndex : 'price', type:'double'}, + {header : "总价", dataIndex : 'totalPrice', type:'double',columnValueSum:true},//columnValueSum列值合计 + {header : "有效期(六个月以内)", dataIndex : 'inSixMonth', type:'string'} + ], + //columnFooter可能会有多行 + columnFooter : [ + { + items:[ + {header : "负责人", dataIndex : '',columnIndex:1},//columnIndex 第几列显示 + {header : "核对人", dataIndex : '',columnIndex:2}, + {header : "盘点人", dataIndex : 'operator',columnIndex:5} + ] + } + ] +}; + var appropriationInListConfig = { headerFooter : [ // 页眉名称 @@ -1600,5 +1632,8 @@ //调拨出库单 appropriationOutList : appropriationOutListConfig, //借还记录 - borrowRecord:borrowRecordConfig + borrowRecord:borrowRecordConfig, + //盘点导出配置 + disposableGoodsInventoryExportExcel : inventoryExportExcelConfig, + materialInventoryExportExcel : inventoryExportExcelConfig }; Index: ssts-web/src/main/java/com/forgon/disinfectsystem/inventoryrecord/service/InventoryRecordManager.java =================================================================== diff -u -r13916 -r15651 --- ssts-web/src/main/java/com/forgon/disinfectsystem/inventoryrecord/service/InventoryRecordManager.java (.../InventoryRecordManager.java) (revision 13916) +++ ssts-web/src/main/java/com/forgon/disinfectsystem/inventoryrecord/service/InventoryRecordManager.java (.../InventoryRecordManager.java) (revision 15651) @@ -26,6 +26,6 @@ public void deleteInventoryRecords(String ids); - public void exportInventoryReocrd(OutputStream ops,String id); + public void exportInventoryReocrd(OutputStream ops, String id ,String params); } Index: ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryMaterialForm.js =================================================================== diff -u -r13916 -r15651 --- ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryMaterialForm.js (.../inventoryMaterialForm.js) (revision 13916) +++ ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryMaterialForm.js (.../inventoryMaterialForm.js) (revision 15651) @@ -113,7 +113,11 @@ text : '导出', hidden:(recordId == ""), handler : function() { - location.href = WWWROOT + "/disinfectsystem/stocktakerecordmanager/exportInventoryRecord.jsp?id=" + recordId + "&time=" + time; + var inventoryExportExcelConfig = ""; + if(!isUndefinedOrNullOrEmpty(printConfig.materialInventoryExportExcel)){ + inventoryExportExcelConfig = JSON.stringify(printConfig.materialInventoryExportExcel); + } + location.href = WWWROOT + "/disinfectsystem/stocktakerecordmanager/exportInventoryRecord.jsp?id=" + recordId + "&excelConfig=" + encodeURI(inventoryExportExcelConfig) + "&time=" + time; } },{ text : '暂存', Index: ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryrecordView.js =================================================================== diff -u -r14590 -r15651 --- ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryrecordView.js (.../inventoryrecordView.js) (revision 14590) +++ ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryrecordView.js (.../inventoryrecordView.js) (revision 15651) @@ -547,8 +547,18 @@ return false; } var recordId = records[0].data['id']; - var time = records[0].data['time'];; - location.href = WWWROOT + "/disinfectsystem/stocktakerecordmanager/exportInventoryRecord.jsp?id=" + recordId + "&time=" + time; + var time = records[0].data['time']; + var inventoryExportExcelConfig = ""; + if("material" == type){ + if(!isUndefinedOrNullOrEmpty(printConfig.materialInventoryExportExcel)){ + inventoryExportExcelConfig = JSON.stringify(printConfig.materialInventoryExportExcel); + } + }else{ + if(!isUndefinedOrNullOrEmpty(printConfig.disposableGoodsInventoryExportExcel)){ + inventoryExportExcelConfig = JSON.stringify(printConfig.disposableGoodsInventoryExportExcel); + } + } + location.href = WWWROOT + "/disinfectsystem/stocktakerecordmanager/exportInventoryRecord.jsp?id=" + recordId + "&excelConfig=" + encodeURI(inventoryExportExcelConfig) + "&time=" + time; } }]; Index: ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryDisposableGoodsForm.js =================================================================== diff -u -r14082 -r15651 --- ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryDisposableGoodsForm.js (.../inventoryDisposableGoodsForm.js) (revision 14082) +++ ssts-web/src/main/webapp/disinfectsystem/stocktakerecordmanager/inventoryDisposableGoodsForm.js (.../inventoryDisposableGoodsForm.js) (revision 15651) @@ -318,7 +318,11 @@ text : '导出', hidden:(recordId == ""), handler : function() { - location.href = WWWROOT + "/disinfectsystem/stocktakerecordmanager/exportInventoryRecord.jsp?id=" + recordId + "&time=" + time; + var inventoryExportExcelConfig = ""; + if(!isUndefinedOrNullOrEmpty(printConfig.disposableGoodsInventoryExportExcel)){ + inventoryExportExcelConfig = JSON.stringify(printConfig.disposableGoodsInventoryExportExcel); + } + location.href = WWWROOT + "/disinfectsystem/stocktakerecordmanager/exportInventoryRecord.jsp?id=" + recordId + "&excelConfig=" + encodeURI(inventoryExportExcelConfig) + "&time=" + time; } },{ text : '暂存', Index: ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/sterilizationrecord/action/SterilizationRecordAction.java =================================================================== diff -u -r15591 -r15651 --- ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/sterilizationrecord/action/SterilizationRecordAction.java (.../SterilizationRecordAction.java) (revision 15591) +++ ssts-sterile/src/main/java/com/forgon/disinfectsystem/sterilizationmanager/sterilizationrecord/action/SterilizationRecordAction.java (.../SterilizationRecordAction.java) (revision 15651) @@ -88,8 +88,6 @@ private SterilizationRecordManager sterilizationRecordManager; - private SterilizerRecordManager sterilizerRecordManager; - private BarcodeManager barcodeManager; private TousseInstanceManager tousseInstanceManager; @@ -142,11 +140,6 @@ this.sterilizationRecordManager = sterilizationRecordManager; } - public void setSterilizerRecordManager( - SterilizerRecordManager sterilizerRecordManager) { - this.sterilizerRecordManager = sterilizerRecordManager; - } - public void setHttpOptionManager(HttpOptionManager httpOptionManager) { this.httpOptionManager = httpOptionManager; }