|
|
@@ -123,7 +123,7 @@ public class ExcelUtil {
|
|
|
*/
|
|
|
public static byte[] exportExcelForThmzmxsrs(List<Mzmxsr> thmzmxsrs) {
|
|
|
Map<String, Object> data = fomartThmzmxsr(thmzmxsrs);
|
|
|
- return exportExcel(null, null, data, YP_REPORT_COLUMNS_LENGTH, VERSION_2007);
|
|
|
+ return exportExcel(null, null, data, YP_REPORT_COLUMNS_LENGTH, VERSION_2007);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -157,12 +157,12 @@ public class ExcelUtil {
|
|
|
//设置单元格并赋值
|
|
|
setData(sheet, (List<String[]>) data.get(DATA_KEY), ((List<Map<String, Object>>) data.get(HEAD_KEY)).size());
|
|
|
log.info("导出解析成功!");
|
|
|
- if(request!=null && response!=null){
|
|
|
+ if (request != null && response != null) {
|
|
|
//设置浏览器下载
|
|
|
setBrowser(request, response, workbook, (String) data.get(FILE_NAME_KEY));
|
|
|
return null;
|
|
|
- }else {
|
|
|
- // return createFile(workbook,(String) data.get(FILE_NAME_KEY));
|
|
|
+ } else {
|
|
|
+ // return createFile(workbook,(String) data.get(FILE_NAME_KEY));
|
|
|
return createFile(workbook);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
@@ -194,14 +194,14 @@ public class ExcelUtil {
|
|
|
//设置表头
|
|
|
setYfInventoryListTitle(workbook, sheet, (List<Map<String, Object>>) data.get(HEAD_KEY), columns);
|
|
|
//设置单元格并赋值
|
|
|
- setYfInventoryListData(workbook,sheet, (List<String[]>) data.get(DATA_KEY), ((List<Map<String, Object>>) data.get(HEAD_KEY)).size());
|
|
|
+ setYfInventoryListData(workbook, sheet, (List<String[]>) data.get(DATA_KEY), ((List<Map<String, Object>>) data.get(HEAD_KEY)).size());
|
|
|
log.info("导出解析成功!");
|
|
|
- if(request!=null && response!=null){
|
|
|
+ if (request != null && response != null) {
|
|
|
//设置浏览器下载
|
|
|
setBrowser(request, response, workbook, (String) data.get(FILE_NAME_KEY));
|
|
|
return null;
|
|
|
- }else {
|
|
|
- // return createFile(workbook,(String) data.get(FILE_NAME_KEY));
|
|
|
+ } else {
|
|
|
+ // return createFile(workbook,(String) data.get(FILE_NAME_KEY));
|
|
|
return createFile(workbook);
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
@@ -354,7 +354,7 @@ public class ExcelUtil {
|
|
|
* 方法名:setYfInventoryListData
|
|
|
* 功能:药房库存清单表格赋值
|
|
|
*/
|
|
|
- private static void setYfInventoryListData(Workbook workbook,Sheet sheet, List<String[]> data, Integer rowNum) {
|
|
|
+ private static void setYfInventoryListData(Workbook workbook, Sheet sheet, List<String[]> data, Integer rowNum) {
|
|
|
try {
|
|
|
for (int i = 0; i < data.size(); i++) {
|
|
|
Row row = sheet.createRow(rowNum);
|
|
|
@@ -362,8 +362,8 @@ public class ExcelUtil {
|
|
|
for (int j = 0; j < data.get(i).length; j++) {
|
|
|
Cell cell = row.createCell(j);
|
|
|
cell.setCellValue(data.get(i)[j]);
|
|
|
- if(j==4 || j==5 || j==6 || j==7){
|
|
|
- CellStyle cellStyle=workbook.createCellStyle(); //设置样式
|
|
|
+ if (j == 4 || j == 5 || j == 6 || j == 7) {
|
|
|
+ CellStyle cellStyle = workbook.createCellStyle(); //设置样式
|
|
|
Font font = workbook.createFont();
|
|
|
font.setFontName("宋体");
|
|
|
font.setFontHeightInPoints((short) 10);// 字体大小
|
|
|
@@ -417,9 +417,9 @@ public class ExcelUtil {
|
|
|
* @param workbook
|
|
|
*/
|
|
|
private static byte[] createFile(Workbook workbook) {
|
|
|
- // private static byte[] createFile(Workbook workbook,String fieName) {
|
|
|
+ // private static byte[] createFile(Workbook workbook,String fieName) {
|
|
|
ByteArrayOutputStream os = null;
|
|
|
- // OutputStream fos = null;
|
|
|
+ // OutputStream fos = null;
|
|
|
try {
|
|
|
os = new ByteArrayOutputStream();
|
|
|
//将excel写入到输出流中
|
|
|
@@ -449,11 +449,6 @@ public class ExcelUtil {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 方法名:importExcel
|
|
|
* 功能:导入
|
|
|
@@ -569,7 +564,7 @@ public class ExcelUtil {
|
|
|
data.put(FILE_NAME_KEY, "收费清单.xls");
|
|
|
List<Map<String, Object>> heads = new ArrayList<>();
|
|
|
Map<String, Object> map0 = new HashMap<>();
|
|
|
- String[] head0 = {"病人ID", "机制号", "退欠标识", "金额", "发票号", "付款方式", "收费日期", "项目名称", "合同编号"};
|
|
|
+ String[] head0 = {"病人ID", "机制号", "退欠标识", "金额", "发票号", "付款方式", "收费日期", "项目名称", "合同编号", "患者地址"};
|
|
|
String[] headNum0 = {"0,0,0,0"};
|
|
|
map0.put(HEAD_ARR_KEY, head0);
|
|
|
map0.put(HEAD_NUM_KEY, headNum0);
|
|
|
@@ -584,9 +579,10 @@ public class ExcelUtil {
|
|
|
chargeFeeVo.getTotalCharge().setScale(2, BigDecimal.ROUND_HALF_UP).toString(),
|
|
|
chargeFeeVo.getReceiptBill(),
|
|
|
chargeFeeVo.getChequeType(),
|
|
|
- chargeFeeVo.getChargeDate()!=null?DateFormatUtils.format(chargeFeeVo.getChargeDate(), "yyyy-MM-dd HH:mm:ss"):"",
|
|
|
+ chargeFeeVo.getChargeDate() != null ? DateFormatUtils.format(chargeFeeVo.getChargeDate(), "yyyy-MM-dd HH:mm:ss") : "",
|
|
|
chargeFeeVo.getContractName(),
|
|
|
- chargeFeeVo.getContractNo()
|
|
|
+ chargeFeeVo.getContractNo(),
|
|
|
+ chargeFeeVo.getAddress() == null ? "" : chargeFeeVo.getAddress()
|
|
|
};
|
|
|
arr.add(temp);
|
|
|
}
|
|
|
@@ -700,7 +696,7 @@ public class ExcelUtil {
|
|
|
data.put(FILE_NAME_KEY, "门诊挂号统计.xls");
|
|
|
List<Map<String, Object>> heads = new ArrayList<>();
|
|
|
Map<String, Object> map0 = new HashMap<>();
|
|
|
- String[] head0 = {"病人姓名", "诊疗卡号", "病人ID", "号源日期","号段","挂号科室", "挂号医生", "挂号时间", "挂号费", "诊查费", "其他收费", "就诊状态","病人地址"};
|
|
|
+ String[] head0 = {"病人姓名", "诊疗卡号", "病人ID", "号源日期", "号段", "挂号科室", "挂号医生", "挂号时间", "挂号费", "诊查费", "其他收费", "就诊状态", "病人地址"};
|
|
|
String[] headNum0 = {"0,0,0,0"};
|
|
|
map0.put(HEAD_ARR_KEY, head0);
|
|
|
map0.put(HEAD_NUM_KEY, headNum0);
|
|
|
@@ -729,7 +725,7 @@ public class ExcelUtil {
|
|
|
mzyReqrec.getReqFee() == null ? "0" : mzyReqrec.getReqFee().toString(),
|
|
|
mzyReqrec.getClinicFee() == null ? "0" : mzyReqrec.getClinicFee().toString(),
|
|
|
mzyReqrec.getOthFee() == null ? "0" : mzyReqrec.getOthFee().toString(), status,
|
|
|
- mzyReqrecVo.getMzPatientMi().getAddress()==null?"":mzyReqrecVo.getMzPatientMi().getAddress()
|
|
|
+ mzyReqrecVo.getMzPatientMi().getAddress() == null ? "" : mzyReqrecVo.getMzPatientMi().getAddress()
|
|
|
};
|
|
|
arr.add(temp);
|
|
|
}
|
|
|
@@ -751,7 +747,7 @@ public class ExcelUtil {
|
|
|
}
|
|
|
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
|
|
|
Map<String, Object> data = new HashMap<>();
|
|
|
- data.put(FILE_NAME_KEY, "库存清单"+simpleDateFormat.format(new Date())+".xls");
|
|
|
+ data.put(FILE_NAME_KEY, "库存清单" + simpleDateFormat.format(new Date()) + ".xls");
|
|
|
List<Map<String, Object>> heads = new ArrayList<>();
|
|
|
Map<String, Object> map0 = new HashMap<>();
|
|
|
String[] head0 = {"货位号", "药品编码", "药品名称", "规格", "零售价", "库存量", "库存金额", "当前虚存", "生产厂家"};
|
|
|
@@ -770,7 +766,7 @@ public class ExcelUtil {
|
|
|
String.format("%.3f", YpZdBaseVo.getPackRetprice()),
|
|
|
String.format("%.2f", YpZdBaseVo.getStockAmount()),
|
|
|
String.format("%.2f", YpZdBaseVo.getStockValue()),
|
|
|
- YpZdBaseVo.getStockAmountVirtual()==null?"":YpZdBaseVo.getStockAmountVirtual().toString(),
|
|
|
+ YpZdBaseVo.getStockAmountVirtual() == null ? "" : YpZdBaseVo.getStockAmountVirtual().toString(),
|
|
|
YpZdBaseVo.getManufactoryName()
|
|
|
};
|
|
|
arr.add(temp);
|