|
@ -16154,6 +16154,36 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
return mapList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 药品明细表
|
|
|
*
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String, Object>> selectInspectTotal(String startTime,String endTime){
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
Date stateDate = DateUtil.strToDateLong(startTime);
|
|
|
Date endDate = DateUtil.strToDateLong(endTime);
|
|
|
List<WlyyPrescriptionDO> prescriptionDOList = prescriptionDao.findListInspectBySuccessStatus(stateDate,endDate);
|
|
|
for (WlyyPrescriptionDO prescriptionDO:prescriptionDOList){
|
|
|
com.alibaba.fastjson.JSONObject objectString = (com.alibaba.fastjson.JSONObject) com.alibaba.fastjson.JSONObject.toJSON(prescriptionDO);
|
|
|
List<WlyyInspectionDO> inspectionDOList = wlyyInspectionDao.findByPrescriptionId(prescriptionDO.getId(),1);
|
|
|
objectString.put("inspect",inspectionDOList);
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(prescriptionDO.getOutpatientId());
|
|
|
if (outpatientDO!=null){
|
|
|
objectString.put("consumerName",outpatientDO.getConsumerName());
|
|
|
}else {
|
|
|
objectString.put("consumerName","");
|
|
|
}
|
|
|
|
|
|
Map<String,Object> map = new HashedMap();
|
|
|
map.put("prescription",objectString);
|
|
|
mapList.add(map);
|
|
|
}
|
|
|
return mapList;
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 药品明细表导出
|
|
|
*
|
|
@ -16192,7 +16222,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
for (Map<String, Object> m : ls) {
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(m.get("prescription").toString());
|
|
|
com.alibaba.fastjson.JSONArray array = jsonObject.getJSONArray("info");
|
|
|
com.alibaba.fastjson.JSONArray array = jsonObject.getJSONArray("inspect");
|
|
|
int j = i;
|
|
|
addCell(ws, i, 0,jsonObject.get("patientName")!=null?jsonObject.get("patientName").toString():n);
|
|
|
addCell(ws, i, 1,jsonObject.get("consumerName")!=null?jsonObject.get("consumerName").toString():n);
|
|
@ -16248,7 +16278,79 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 检查明细表导出
|
|
|
*
|
|
|
* @param ls
|
|
|
* @param startTime
|
|
|
* @param endTime
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void pushListInspectDrugTotal(OutputStream os, List<Map<String, Object>> ls,String startTime,String endTime) throws Exception {
|
|
|
WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
|
|
|
try {
|
|
|
WritableSheet ws;
|
|
|
ws = wwb.createSheet("sheet", 1);
|
|
|
String[] header = {"互联网医院检查明细表","","","","","","","",""};//
|
|
|
int k = 0;
|
|
|
for (String h : header) {
|
|
|
addCell(ws, 0, k, h);//表名,行,列,header
|
|
|
k++;
|
|
|
}
|
|
|
|
|
|
String[] header1 = {"汇总日期:"+startTime+"至"+endTime,"","","","","","","",""};//
|
|
|
int k1 = 0;
|
|
|
for (String h : header1) {
|
|
|
addCell(ws, 1, k1, h);//表名,行,列,header
|
|
|
k1++;
|
|
|
}
|
|
|
String[] header2 = {"患者名称","代问诊人","检查项目","检查部位","执行院区","执行科室","总量","价格","开方时间","开方医生"};//
|
|
|
int k2 = 0;
|
|
|
for (String h : header2) {
|
|
|
addCell(ws, 2, k2, h);//表名,行,列,header
|
|
|
k2++;
|
|
|
}
|
|
|
|
|
|
int i = 3;
|
|
|
String n = " ";
|
|
|
|
|
|
for (Map<String, Object> m : ls) {
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(m.get("prescription").toString());
|
|
|
com.alibaba.fastjson.JSONArray array = jsonObject.getJSONArray("info");
|
|
|
int j = i;
|
|
|
addCell(ws, i, 0,jsonObject.get("patientName")!=null?jsonObject.get("patientName").toString():n);
|
|
|
addCell(ws, i, 1,jsonObject.get("consumerName")!=null?jsonObject.get("consumerName").toString():n);
|
|
|
DecimalFormat df = new DecimalFormat("#.00");
|
|
|
if(array!=null&&array.size()!=0){
|
|
|
for (int z=0;z<array.size();z++){
|
|
|
com.alibaba.fastjson.JSONObject object = array.getJSONObject(z);
|
|
|
addCell(ws, i, 2, object.get("name")!=null?object.get("name").toString():n);
|
|
|
addCell(ws, i, 3, object.get("checkPartName")!=null?object.get("checkPartName").toString():n);
|
|
|
addCell(ws, i, 4, object.get("orgName")!=null?object.get("orgName").toString():n);
|
|
|
addCell(ws, i, 5, object.get("deptName")!=null?object.get("deptName").toString():n);
|
|
|
addCell(ws, i, 6, object.get("quantity")!=null?object.get("quantity").toString():n);
|
|
|
addCell(ws, i, 7,object.get("chargeAmount")!=null?object.get("chargeAmount").toString():n);
|
|
|
addCell(ws, i, 8,jsonObject.get("createTime")!=null?DateUtil.stampToString(jsonObject.get("createTime").toString()):n);
|
|
|
addCell(ws, i, 9,jsonObject.get("doctorName")!=null?jsonObject.get("doctorName").toString():n);
|
|
|
i++;
|
|
|
}
|
|
|
|
|
|
ws.mergeCells(0,j,0,i-1);
|
|
|
ws.mergeCells(1,j,1,i-1);
|
|
|
}else {
|
|
|
i++;
|
|
|
}
|
|
|
}
|
|
|
ws.mergeCells(0,0,7,0);
|
|
|
ws.mergeCells(0,1,8,1);
|
|
|
wwb.write();
|
|
|
wwb.close();
|
|
|
} catch (IOException e) {
|
|
|
e.printStackTrace();
|
|
|
if (wwb != null) wwb.close();
|
|
|
throw e;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|