|
@ -3914,7 +3914,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
WritableSheet ws;
|
|
|
ws = wwb.createSheet("sheet", 1);
|
|
|
|
|
|
String[] header = {"序号","充值时间","商户订单号","医院订单号","患者姓名","证件号码","就诊卡号","手机号码","金额","状态","业务类型","咨询方式","代问诊人","问诊医生"};
|
|
|
String[] header = {"序号","充值时间","商户订单号","医院订单号","患者姓名","证件号码","就诊卡号","手机号码","自费金额","医保金额","状态","业务类型","咨询方式","代问诊人","问诊医生"};
|
|
|
int k = 0;
|
|
|
for (String h : header) {
|
|
|
addCell(ws, 0, k, h);//表名,行,列,header
|
|
@ -3960,6 +3960,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}else if (orderCategory.equals("5")) {
|
|
|
odry += "就诊卡充值";
|
|
|
odte += "就诊卡充值";
|
|
|
}else if (orderCategory.equals("6")) {
|
|
|
odry += "处方";
|
|
|
odte += "处方";
|
|
|
}else {
|
|
|
odry += " ";
|
|
|
}
|
|
@ -4030,11 +4033,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
addCell(ws, i, 6, (String) m.get("medicard")!=null?(String) m.get("medicard"):n);
|
|
|
addCell(ws, i, 7, (String) m.get("mobile")!=null?(String) m.get("mobile"):n);
|
|
|
addCell(ws, i, 8, pay!=null?pay:n);
|
|
|
addCell(ws, i, 9, status!=null?status:n);
|
|
|
addCell(ws, i, 10, odry!=null?odry:n);
|
|
|
addCell(ws, i, 11, odte!=null?odte:n);
|
|
|
addCell(ws, i, 12, (String) m.get("patientName")!=null?(String) m.get("patientName"):n);
|
|
|
addCell(ws, i, 13, doctorName!=null?doctorName:n);
|
|
|
addCell(ws, i, 9, m.get("medicalPrice")!=null?m.get("medicalPrice").toString():n);
|
|
|
addCell(ws, i, 10, status!=null?status:n);
|
|
|
addCell(ws, i, 11, odry!=null?odry:n);
|
|
|
addCell(ws, i, 12, odte!=null?odte:n);
|
|
|
addCell(ws, i, 13, (String) m.get("patientName")!=null?(String) m.get("patientName"):n);
|
|
|
addCell(ws, i, 14, doctorName!=null?doctorName:n);
|
|
|
i++;
|
|
|
}
|
|
|
wwb.write();
|
|
@ -15053,6 +15057,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
}
|
|
|
object.put("getSettleInfo",ylzMedicalRelationDO);
|
|
|
businessOrderService.ylzRechargePreYk(outpatientId,"WX_MIN",wechatId,null);
|
|
|
return object;
|
|
|
}else {
|
|
|
BigDecimal b1 = new BigDecimal(ylzMedicalRelationDO.getPersonCash());//个人现金
|
|
@ -15582,19 +15587,25 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
public List<Map<String, Object>> selectPriceTotal(String startTime,String endTime){
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
Map<String, Object> params = new HashedMap();
|
|
|
String sql =" SELECT ORDER_CATEGORY as \"orderCategory\",\"SUM\"(PAY_PRICE)/100 as \"payPrice\" FROM BASE_BUSINESS_ORDER_PAY WHERE ORDER_CATEGORY IN(1,2,3,4) and STATUS=1 ";
|
|
|
String sql =" SELECT t.ORDER_CATEGORY as \"orderCategory\"," +
|
|
|
"SUM(t.PAY_PRICE)/100 as \"payPrice\"," +
|
|
|
"nvl(SUM(ymr.person_account),0) as \"personAccount\",\n" +
|
|
|
"nvl(SUM(ymr.medical_price),0) as \"medicalPrice\", " +
|
|
|
"nvl(SUM(ymr.medical_price),0)+nvl(SUM(ymr.person_account),0) as \"medicalPrice1\" "+
|
|
|
" FROM BASE_BUSINESS_ORDER_PAY t" +
|
|
|
" left join base_ylz_medical_relation ymr on ymr.id=t.relation_code WHERE t.ORDER_CATEGORY IN(1,2,3,4,6) and t.STATUS=1 ";
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
sql+=" and create_time <= to_date('" + endTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
|
|
|
sql+=" and t.create_time <= to_date('" + endTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
|
|
|
} else {
|
|
|
sql+=" and create_time <='"+endTime+"' ";
|
|
|
sql+=" and t.create_time <='"+endTime+"' ";
|
|
|
}
|
|
|
if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)) {
|
|
|
sql+=" and create_time >= to_date('" + startTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
|
|
|
sql+=" and t.create_time >= to_date('" + startTime + "', 'yyyy-mm-dd hh24:mi:ss') ";
|
|
|
} else {
|
|
|
sql+=" and create_time >='"+startTime+"' ";
|
|
|
sql+=" and t.create_time >='"+startTime+"' ";
|
|
|
}
|
|
|
|
|
|
sql+=" GROUP BY ORDER_CATEGORY ";
|
|
|
sql+=" GROUP BY t.ORDER_CATEGORY ";
|
|
|
logger.info("sql="+sql);
|
|
|
mapList = hibenateUtils.createSQLQuery(sql, params);
|
|
|
return mapList;
|
|
@ -15632,10 +15643,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
String j2="";
|
|
|
String j3 ="";
|
|
|
String j4="";
|
|
|
String price1 = "";
|
|
|
String price2 = "";
|
|
|
String price3 = "";
|
|
|
String price4 = "";
|
|
|
String price1 = "0";
|
|
|
String price2 = "0";
|
|
|
String price3 = "0";
|
|
|
String price4 = "0";
|
|
|
String price6 = "0";
|
|
|
String medicalPrice= "0";
|
|
|
String medicalPrice1= "0";
|
|
|
for (Map<String, Object> m : ls) {
|
|
|
if (m.get("orderCategory").toString().equalsIgnoreCase("1")){
|
|
|
j1 = m.get("orderCategory").toString();
|
|
@ -15649,11 +15663,18 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}else if (m.get("orderCategory").toString().equalsIgnoreCase("4")){
|
|
|
j4 = m.get("orderCategory").toString();
|
|
|
price4=m.get("payPrice").toString();
|
|
|
medicalPrice1 ="0";
|
|
|
}else if (m.get("orderCategory").toString().equalsIgnoreCase("6")){
|
|
|
j4 = m.get("orderCategory").toString();
|
|
|
price6=m.get("payPrice").toString();
|
|
|
medicalPrice = m.get("medicalPrice1").toString();
|
|
|
}
|
|
|
}
|
|
|
DecimalFormat df = new DecimalFormat("#.00");
|
|
|
Double price5 =Double.parseDouble(price2)+Double.parseDouble(price3);
|
|
|
String[] header2 = {"咨询费",df.format(Double.parseDouble(price1)),"复诊费",df.format(price5),"处方费",df.format(Double.parseDouble(price4))};//
|
|
|
Double price7= Double.parseDouble(price4)+Double.parseDouble(price6);
|
|
|
Double medicalPrices=Double.parseDouble(medicalPrice)+Double.parseDouble(medicalPrice1);
|
|
|
String[] header2 = {"咨询费",df.format(Double.parseDouble(price1)),"复诊费",df.format(price5),"处方费","自费:"+price7+"医保:"+medicalPrices};//
|
|
|
int k2 = 0;
|
|
|
for (String h : header2) {
|
|
|
addCell(ws, 2, k2, h);//表名,行,列,header
|
|
@ -15973,6 +15994,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}else {
|
|
|
objectString.put("consumerName","");
|
|
|
}
|
|
|
|
|
|
List<YlzMedicalRelationDO> medicalRelationDOList = ylzMedicailRelationDao.findByOutpatientNoStatus(prescriptionDO.getOutpatientId());
|
|
|
logger.info("prescriptionDO.getOutpatientId()"+prescriptionDO.getOutpatientId());
|
|
|
DecimalFormat df = new DecimalFormat("#.00");
|
|
|
if (medicalRelationDOList!=null&&medicalRelationDOList.size()!=0){
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(medicalRelationDOList.get(0).getId());
|
|
|
Double personAccount = Double.parseDouble(medicalRelationDOList.get(0).getPersonAccount());
|
|
|
Double medicalPrice = Double.parseDouble(medicalRelationDOList.get(0).getMedicalPrice());
|
|
|
objectString.put("medicalPrice",personAccount+medicalPrice);
|
|
|
objectString.put("price",businessOrderDO.getPayPrice()==0?businessOrderDO.getPayPrice():df.format(businessOrderDO.getPayPrice()/100));
|
|
|
}else {
|
|
|
BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(prescriptionDO.getId());
|
|
|
objectString.put("medicalPrice",0);
|
|
|
objectString.put("price",businessOrderDO.getPayPrice()==0?businessOrderDO.getPayPrice():df.format(businessOrderDO.getPayPrice()/100));
|
|
|
}
|
|
|
|
|
|
Map<String,Object> map = new HashedMap();
|
|
|
map.put("prescription",objectString);
|
|
|
mapList.add(map);
|
|
@ -16007,7 +16044,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
addCell(ws, 1, k1, h);//表名,行,列,header
|
|
|
k1++;
|
|
|
}
|
|
|
String[] header2 = {"患者名称","代问诊人","订单药品","规格","总量","单位","进价","零售价","进货金额","零售金额","发药时间","审方时间","开方时间","开方医生"};//
|
|
|
String[] header2 = {"患者名称","代问诊人","订单药品","规格","总量","单位","零售价","零售金额","医保金额","自费金额","发药时间","审方时间","开方时间","开方医生"};//
|
|
|
int k2 = 0;
|
|
|
for (String h : header2) {
|
|
|
addCell(ws, 2, k2, h);//表名,行,列,header
|
|
@ -16031,13 +16068,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
addCell(ws, i, 3, object.get("specification")!=null?object.get("specification").toString():n);
|
|
|
addCell(ws, i, 4, object.get("quantity")!=null?object.get("quantity").toString():n);
|
|
|
addCell(ws, i, 5, object.get("packUnitName")!=null?object.get("packUnitName").toString():n);
|
|
|
addCell(ws, i, 6, "无");
|
|
|
addCell(ws, i, 7, object.get("packRetprice")!=null?object.get("packRetprice").toString():n);
|
|
|
addCell(ws, i, 8, "无");
|
|
|
addCell(ws, i, 6, object.get("packRetprice")!=null?object.get("packRetprice").toString():n);
|
|
|
if (object.get("quantity")!=null){
|
|
|
Double quantity = Double.parseDouble(object.get("quantity").toString());
|
|
|
Double packRetprice = Double.parseDouble(object.get("packRetprice").toString());
|
|
|
addCell(ws, i, 9,df.format(packRetprice*quantity));
|
|
|
addCell(ws, i, 7,df.format(packRetprice*quantity));
|
|
|
}else {
|
|
|
addCell(ws, i, 7,"");
|
|
|
}
|
|
|
if (jsonObject.get("medicalPrice")!=null){
|
|
|
addCell(ws, i, 8,jsonObject.getString("medicalPrice"));
|
|
|
}else {
|
|
|
addCell(ws, i, 8,"");
|
|
|
}
|
|
|
if (jsonObject.get("price")!=null){
|
|
|
addCell(ws, i, 9,jsonObject.getString("price"));
|
|
|
}else {
|
|
|
addCell(ws, i, 9,"");
|
|
|
}
|
|
@ -16045,20 +16090,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
addCell(ws, i, 11,jsonObject.get("checkTime")!=null?DateUtil.stampToString(jsonObject.get("checkTime").toString()):n);
|
|
|
addCell(ws, i, 12,jsonObject.get("createTime")!=null?DateUtil.stampToString(jsonObject.get("createTime").toString()):n);
|
|
|
addCell(ws, i, 13,jsonObject.get("doctorName")!=null?jsonObject.get("doctorName").toString():n);
|
|
|
|
|
|
i++;
|
|
|
}
|
|
|
|
|
|
ws.mergeCells(0,j,0,i-1);
|
|
|
ws.mergeCells(1,j,1,i-1);
|
|
|
ws.mergeCells(8,j,8,i-1);
|
|
|
ws.mergeCells(9,j,9,i-1);
|
|
|
}else {
|
|
|
i++;
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
ws.mergeCells(0,0,13,0);
|
|
|
ws.mergeCells(0,1,13,1);
|
|
|
ws.mergeCells(0,0,14,0);
|
|
|
ws.mergeCells(0,1,14,1);
|
|
|
wwb.write();
|
|
|
wwb.close();
|
|
|
} catch (IOException e) {
|