|
@ -12,7 +12,6 @@ import com.yihu.jw.entity.base.system.SystemDictDO;
|
|
|
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
|
|
|
import com.yihu.jw.entity.door.*;
|
|
|
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
|
|
|
import com.yihu.jw.entity.wechat.WechatTemplateConfig;
|
|
|
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
|
|
|
import com.yihu.jw.hospital.module.door.dao.*;
|
|
|
import com.yihu.jw.hospital.task.PushMsgTask;
|
|
@ -410,7 +409,7 @@ public class DoorOrderService {
|
|
|
Integer times = wlyyDoorServiceOrderService.countPatientDoorTimes(doorServiceOrder.getPatient());
|
|
|
//先注释-服务费用20231011
|
|
|
// List<WlyyDoorDoctorDO> djDetailList = this.djDetailList(id, level, times);
|
|
|
// doorServiceOrder.setDjDetailList(djDetailList);
|
|
|
// doorServiceOrder.setDjDetailList(djDetailList);//出诊费
|
|
|
List<Map<String, Object>> feeDetailDOS = this.getDoorFeeDetailGroupByStatus(id);
|
|
|
String jsonData = this.serverPackagePriceByOrderId(id);
|
|
|
if (null != feeDetailDOS && feeDetailDOS.size() > 0) {
|
|
@ -434,7 +433,6 @@ public class DoorOrderService {
|
|
|
doorServiceOrder.setDoctors(doorServiceDoctors);
|
|
|
}
|
|
|
|
|
|
|
|
|
//获取咨询
|
|
|
ConsultDo consult = consultDao.queryByRelationCode(id);
|
|
|
if (null != consult) {
|
|
@ -907,23 +905,24 @@ public class DoorOrderService {
|
|
|
public JSONObject getDoorOrderList(String orderId, String patientName, String patientPhone, String hospitalCode,
|
|
|
StringBuffer status, String createTimeStart, String createTimeEnd, String serverDoctorName,
|
|
|
String doctorCode, Integer examPaperStatus, Integer page, Integer pageSize, Integer type, String name, String serverType) throws Exception {
|
|
|
StringBuilder sqlList = new StringBuilder("select DISTINCT o.id as orderId,o.status,f.hospital,f.hospital_name as hospitalName1,o.is_trans_other_org,o.transed_org_code,h.name as hospitalName2,o.patient_name," +
|
|
|
" o.patient_phone,o.remark,o.serve_desc,dc.service_time,o.patient as patientCode ,o.exam_paper_status as examPaperStatus,o.number as serverCode,o.total_fee,h.hos_level as hosLevel, " +
|
|
|
"o.doctor, o.doctor_name as doctorName, o.doctor_type as doctorType ,(SELECT group_concat(DISTINCT dsv.type_value) FROM wlyy_door_service_voucher dsv WHERE dsv.patient_code = o.patient and dsv.status=1 ) AS serviceStatus ");
|
|
|
StringBuilder sqlList = new StringBuilder(
|
|
|
"select DISTINCT o.id as orderId,o.status,h.org_name AS hospitalName, h.org_code AS hospital," +
|
|
|
"o.is_trans_other_org,o.transed_org_code ,o.patient_name," +
|
|
|
" o.patient_phone,o.remark,o.serve_desc,dc.service_time,o.patient as patientCode ," +
|
|
|
"o.exam_paper_status as examPaperStatus,o.number as serverCode,o.total_fee, " +
|
|
|
" o.doctor, o.doctor_name as doctorName, o.doctor_type as doctorType ," +
|
|
|
"(SELECT group_concat(DISTINCT dsv.type_value) " +
|
|
|
" FROM wlyy_door_service_voucher dsv WHERE dsv.patient_code = o.patient and dsv.status=1 ) AS serviceStatus ");
|
|
|
|
|
|
StringBuilder sqlCount = new StringBuilder(" select count(DISTINCT o.id) as total ");
|
|
|
StringBuilder sql = new StringBuilder(" from wlyy_door_service_order o " +
|
|
|
" LEFT JOIN wlyy_sign_family f ON f.patient = o.patient AND f.STATUS = 1 AND f.expenses_status = 1 " +
|
|
|
" LEFT JOIN dm_hospital h on h.code=o.hospital and h.del=1 "
|
|
|
" LEFT JOIN base_doctor_hospital h ON o.hospital=h.org_code "
|
|
|
+ " LEFT JOIN wlyy_door_doctor d on d.order_id = o.id " +
|
|
|
" LEFT JOIN wlyy_patient p on p.code = o.patient " +
|
|
|
" LEFT JOIN base_patient p on p.id = o.patient " +
|
|
|
" LEFT JOIN wlyy_door_conclusion dc ON dc.order_id = o.id ");
|
|
|
if (StringUtils.isNotBlank(serverType)) {
|
|
|
sql.append(" INNER JOIN wlyy_door_service_voucher dsv on dsv.patient_code = o.patient and dsv.type='" + serverType + "' and dsv.status=1 ");
|
|
|
}
|
|
|
// if(!StringUtils.isEmpty(serverDoctorName)){
|
|
|
// sql+=" RIGHT JOIN wlyy_door_doctor d on d.order_id = o.id";
|
|
|
// }
|
|
|
sql.append(" where 1=1 ");
|
|
|
if (!StringUtils.isEmpty(orderId)) {
|
|
|
sql.append(" and o.number = '" + orderId + "'");
|
|
@ -943,9 +942,7 @@ public class DoorOrderService {
|
|
|
if (status != null) {
|
|
|
sql.append(" and o.status in (" + status + ")");
|
|
|
}
|
|
|
/*else {
|
|
|
sql += " and o.status != '-1' ";
|
|
|
}*/
|
|
|
|
|
|
if (!StringUtils.isEmpty(createTimeStart)) {
|
|
|
sql.append(" and dc.service_time >='" + createTimeStart + "'");
|
|
|
}
|
|
@ -964,8 +961,10 @@ public class DoorOrderService {
|
|
|
if (examPaperStatus != null) {
|
|
|
sql.append(" and o.conclusion_status='" + examPaperStatus + "' ");
|
|
|
}
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sqlCount.append(sql).toString());
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sqlList.append(sql).append(" order by o.create_time desc LIMIT " + (page - 1) * pageSize + "," + pageSize).toString());
|
|
|
String sql01 = sqlList.append(sql).append(" order by o.create_time desc LIMIT " + (page - 1) * pageSize + "," + pageSize).toString();
|
|
|
String sql02 = sqlCount.append(sql).toString();
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql01);
|
|
|
List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql02);
|
|
|
Long count = 0L;
|
|
|
if (rstotal != null && rstotal.size() > 0) {
|
|
|
count = (Long) rstotal.get(0).get("total");
|