|  | @ -1631,6 +1631,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                         "\ta.req_fee as \"spfzFee\",\n" +
 |  |                         "\ta.req_fee as \"spfzFee\",\n" +
 | 
												
													
														
															|  |                         "\tb.req_fee as \"spzxFee\",\n" +
 |  |                         "\tb.req_fee as \"spzxFee\",\n" +
 | 
												
													
														
															|  |                         "\tv.req_fee as \"twzxFee\",\n" +
 |  |                         "\tv.req_fee as \"twzxFee\",\n" +
 | 
												
													
														
															|  | 
 |  |                         "\tg.req_fee as \"jyzxFee\",\n" +
 | 
												
													
														
															|  |                         "\td.req_fee as \"xtzxFee\"\n" +
 |  |                         "\td.req_fee as \"xtzxFee\"\n" +
 | 
												
													
														
															|  |                         "FROM\n" +
 |  |                         "FROM\n" +
 | 
												
													
														
															|  |                         "\tbase_doctor t\n" +
 |  |                         "\tbase_doctor t\n" +
 | 
												
											
												
													
														
															|  | @ -1638,7 +1639,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                         "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
 |  |                         "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
 | 
												
													
														
															|  |                         "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
 |  |                         "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
 | 
												
													
														
															|  |                         "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
 |  |                         "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
 | 
												
													
														
															|  |                         "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
 |  | 
 | 
												
													
														
															|  | 
 |  |                         " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
 | 
												
													
														
															|  |                         "WHERE t.id = '"+doctor.get("id")+"' ";
 |  |                         "WHERE t.id = '"+doctor.get("id")+"' ";
 | 
												
													
														
															|  |                 chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
 |  |                 chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
 | 
												
													
														
															|  |                 /*if (null!=doctor.get("chargeType")){
 |  |                 /*if (null!=doctor.get("chargeType")){
 | 
												
											
												
													
														
															|  | @ -3577,6 +3578,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                     "\ta.req_fee as \"spfzFee\",\n" +
 |  |                     "\ta.req_fee as \"spfzFee\",\n" +
 | 
												
													
														
															|  |                     "\tb.req_fee as \"spzxFee\",\n" +
 |  |                     "\tb.req_fee as \"spzxFee\",\n" +
 | 
												
													
														
															|  |                     "\tv.req_fee as \"twzxFee\",\n" +
 |  |                     "\tv.req_fee as \"twzxFee\",\n" +
 | 
												
													
														
															|  | 
 |  |                     "\tg.req_fee as \"jyzxFee\",\n" +
 | 
												
													
														
															|  |                     "\td.req_fee as \"xtzxFee\"\n" +
 |  |                     "\td.req_fee as \"xtzxFee\"\n" +
 | 
												
													
														
															|  |                     "FROM\n" +
 |  |                     "FROM\n" +
 | 
												
													
														
															|  |                     "\tbase_doctor t\n" +
 |  |                     "\tbase_doctor t\n" +
 | 
												
											
												
													
														
															|  | @ -3585,6 +3587,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                     "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
 |  |                     "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
 | 
												
													
														
															|  |                     "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
 |  |                     "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
 | 
												
													
														
															|  |                     "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
 |  |                     "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
 | 
												
													
														
															|  | 
 |  |                     " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
 | 
												
													
														
															|  |                     "WHERE t.id = '"+doctorDO.getId()+"' ";
 |  |                     "WHERE t.id = '"+doctorDO.getId()+"' ";
 | 
												
													
														
															|  |             chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
 |  |             chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
 | 
												
													
														
															|  |             rs.put("chargeTypeList",chargeDictDOLists);
 |  |             rs.put("chargeTypeList",chargeDictDOLists);
 | 
												
											
												
													
														
															|  | @ -3861,6 +3864,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                     "\ta.req_fee as \"spfzFee\",\n" +
 |  |                     "\ta.req_fee as \"spfzFee\",\n" +
 | 
												
													
														
															|  |                     "\tb.req_fee as \"spzxFee\",\n" +
 |  |                     "\tb.req_fee as \"spzxFee\",\n" +
 | 
												
													
														
															|  |                     "\tv.req_fee as \"twzxFee\",\n" +
 |  |                     "\tv.req_fee as \"twzxFee\",\n" +
 | 
												
													
														
															|  | 
 |  |                     "\tg.req_fee as \"jyzxFee\",\n" +
 | 
												
													
														
															|  |                     "\td.req_fee as \"xtzxFee\"\n" +
 |  |                     "\td.req_fee as \"xtzxFee\"\n" +
 | 
												
													
														
															|  |                     "FROM\n" +
 |  |                     "FROM\n" +
 | 
												
													
														
															|  |                     "\tbase_doctor t\n" +
 |  |                     "\tbase_doctor t\n" +
 | 
												
											
												
													
														
															|  | @ -3869,6 +3873,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                     "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
 |  |                     "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
 | 
												
													
														
															|  |                     "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
 |  |                     "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
 | 
												
													
														
															|  |                     "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
 |  |                     "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
 | 
												
													
														
															|  | 
 |  |                     " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
 | 
												
													
														
															|  |                     "WHERE t.id = '"+doctorDO.getId()+"' ";
 |  |                     "WHERE t.id = '"+doctorDO.getId()+"' ";
 | 
												
													
														
															|  |             chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
 |  |             chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
 | 
												
													
														
															|  |             rs.put("chargeTypeList",chargeDictDOLists);
 |  |             rs.put("chargeTypeList",chargeDictDOLists);
 | 
												
											
												
													
														
															|  | @ -4676,7 +4681,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |         } else {
 |  |         } else {
 | 
												
													
														
															|  |             sql += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format,";
 |  |             sql += "date_format(room.reservation_time ,'%Y-%m-%d %H:%i:%S' ) AS timedate_format,";
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  |         sql += "outpatient.disease_img AS \"disease_img\"," +
 |  | 
 | 
												
													
														
															|  | 
 |  |         sql += " outpatient.disease_img AS \"disease_img\"," +
 | 
												
													
														
															|  |                 "outpatient.description AS \"description\"," +
 |  |                 "outpatient.description AS \"description\"," +
 | 
												
													
														
															|  |                 "room.reservation_type AS \"reservation_type\"," +
 |  |                 "room.reservation_type AS \"reservation_type\"," +
 | 
												
													
														
															|  |                 "outpatient.origin_con_no AS \"origin_con_no\" " +
 |  |                 "outpatient.origin_con_no AS \"origin_con_no\" " +
 | 
												
											
												
													
														
															|  | @ -4716,7 +4721,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |             //在线复诊
 |  |             //在线复诊
 | 
												
													
														
															|  |             sql += " AND room.reservation_type !=3 AND room.consult_type =2";
 |  |             sql += " AND room.reservation_type !=3 AND room.consult_type =2";
 | 
												
													
														
															|  |         } else {
 |  |         } else {
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |             sql += " AND room.reservation_type !=2";
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         if (StringUtils.isNoneBlank(dept)) {
 |  |         if (StringUtils.isNoneBlank(dept)) {
 | 
												
											
												
													
														
															|  | @ -5442,6 +5447,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                     "\ta.req_fee as \"spfzFee\",\n" +
 |  |                     "\ta.req_fee as \"spfzFee\",\n" +
 | 
												
													
														
															|  |                     "\tb.req_fee as \"spzxFee\",\n" +
 |  |                     "\tb.req_fee as \"spzxFee\",\n" +
 | 
												
													
														
															|  |                     "\tv.req_fee as \"twzxFee\",\n" +
 |  |                     "\tv.req_fee as \"twzxFee\",\n" +
 | 
												
													
														
															|  | 
 |  |                     "\tg.req_fee as \"jyzxFee\",\n" +
 | 
												
													
														
															|  |                     "\td.req_fee as \"xtzxFee\"\n" +
 |  |                     "\td.req_fee as \"xtzxFee\"\n" +
 | 
												
													
														
															|  |                     "FROM\n" +
 |  |                     "FROM\n" +
 | 
												
													
														
															|  |                     "\tbase_doctor t\n" +
 |  |                     "\tbase_doctor t\n" +
 | 
												
											
												
													
														
															|  | @ -5450,6 +5456,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                     "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
 |  |                     "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
 | 
												
													
														
															|  |                     "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
 |  |                     "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
 | 
												
													
														
															|  |                     "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
 |  |                     "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
 | 
												
													
														
															|  | 
 |  |                     " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" +
 | 
												
													
														
															|  |                     "WHERE t.id = '"+map.get("id")+"' ";
 |  |                     "WHERE t.id = '"+map.get("id")+"' ";
 | 
												
													
														
															|  |             chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
 |  |             chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge);
 | 
												
													
														
															|  |             map.put("chargeTypeList",chargeDictDOLists);
 |  |             map.put("chargeTypeList",chargeDictDOLists);
 | 
												
											
												
													
														
															|  | @ -9656,19 +9663,19 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                                 }
 |  |                                 }
 | 
												
													
														
															|  |                                 doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
 |  |                                 doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
 | 
												
													
														
															|  |                                 if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
 |  |                                 if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
 | 
												
													
														
															|  |                                     if (!doctorDO.getOutpatientType().contains("zj")){
 |  | 
 | 
												
													
														
															|  |                                         doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
 |  | 
 | 
												
													
														
															|  | 
 |  |                                     if (!doctorDO.getOutpatientType().contains("zjsp")){
 | 
												
													
														
															|  | 
 |  |                                         doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zjsp");
 | 
												
													
														
															|  |                                     }
 |  |                                     }
 | 
												
													
														
															|  |                                 }else {
 |  |                                 }else {
 | 
												
													
														
															|  |                                     doctorDO.setOutpatientType("zj");
 |  | 
 | 
												
													
														
															|  | 
 |  |                                     doctorDO.setOutpatientType("zjsp");
 | 
												
													
														
															|  |                                 }
 |  |                                 }
 | 
												
													
														
															|  |                             }else {
 |  |                             }else {
 | 
												
													
														
															|  |                                 if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
 |  |                                 if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
 | 
												
													
														
															|  |                                     if (doctorDO.getOutpatientType().contains("zj")){
 |  | 
 | 
												
													
														
															|  |                                         doctorDO.getOutpatientType().replace(",zj","");
 |  | 
 | 
												
													
														
															|  | 
 |  |                                     if (doctorDO.getOutpatientType().contains("zjsp")){
 | 
												
													
														
															|  | 
 |  |                                         doctorDO.getOutpatientType().replace(",zjsp","");
 | 
												
													
														
															|  |                                     }
 |  |                                     }
 | 
												
													
														
															|  |                                 }else{
 |  |                                 }else{
 | 
												
													
														
															|  |                                     doctorDO.setOutpatientType("zj");
 |  | 
 | 
												
													
														
															|  | 
 |  |                                     doctorDO.setOutpatientType("zjsp");
 | 
												
													
														
															|  |                                 }
 |  |                                 }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |                             }
 |  |                             }
 | 
												
											
												
													
														
															|  | @ -9754,11 +9761,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                         }
 |  |                         }
 | 
												
													
														
															|  |                         doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
 |  |                         doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
 | 
												
													
														
															|  |                         if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
 |  |                         if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
 | 
												
													
														
															|  |                             if (!doctorDO.getOutpatientType().contains("zj")) {
 |  | 
 | 
												
													
														
															|  |                                 doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
 |  | 
 | 
												
													
														
															|  | 
 |  |                             if (!doctorDO.getOutpatientType().contains("zjsp")) {
 | 
												
													
														
															|  | 
 |  |                                 doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zjsp");
 | 
												
													
														
															|  |                             }
 |  |                             }
 | 
												
													
														
															|  |                         }else {
 |  |                         }else {
 | 
												
													
														
															|  |                             doctorDO.setOutpatientType("zj");
 |  | 
 | 
												
													
														
															|  | 
 |  |                             doctorDO.setOutpatientType("zjsp");
 | 
												
													
														
															|  |                         }
 |  |                         }
 | 
												
													
														
															|  |                     }
 |  |                     }
 | 
												
													
														
															|  |                     baseDoctorDao.save(doctorDO);
 |  |                     baseDoctorDao.save(doctorDO);
 | 
												
											
												
													
														
															|  | @ -9776,10 +9783,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |                 "\tt.source as \"source\",\n" +
 |  |                 "\tt.source as \"source\",\n" +
 | 
												
													
														
															|  |                 "\tt.outpatient_type as \"outpatientType\",\n" +
 |  |                 "\tt.outpatient_type as \"outpatientType\",\n" +
 | 
												
													
														
															|  |                 "\tt.create_time as \"createTime\",\n" +
 |  |                 "\tt.create_time as \"createTime\",\n" +
 | 
												
													
														
															|  | 
 |  |                 "\th.org_code as \"orgCode\",\n" +
 | 
												
													
														
															|  |                 "\tb.idcard as \"idCard\" \n" +
 |  |                 "\tb.idcard as \"idCard\" \n" +
 | 
												
													
														
															|  |                 "FROM\n" +
 |  |                 "FROM\n" +
 | 
												
													
														
															|  |                 "\twlyy_outpatient t\n" +
 |  |                 "\twlyy_outpatient t\n" +
 | 
												
													
														
															|  |                 "\tLEFT JOIN base_patient b ON t.patient = b.id where 1=1 ";
 |  | 
 | 
												
													
														
															|  | 
 |  |                 "\tLEFT JOIN base_patient b ON t.patient = b.id " +
 | 
												
													
														
															|  | 
 |  |                 " left join base_doctor_hospital h on t.doctor = h.doctor_code where 1=1 ";
 | 
												
													
														
															|  |         if (StringUtils.isNoneBlank(startTime)){
 |  |         if (StringUtils.isNoneBlank(startTime)){
 | 
												
													
														
															|  |             if("xm_ykyy_wx".equals(wechatId)){
 |  |             if("xm_ykyy_wx".equals(wechatId)){
 | 
												
													
														
															|  |                 if (flag){
 |  |                 if (flag){
 | 
												
											
												
													
														
															|  | @ -9806,11 +9815,37 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
												
													
														
															|  |         for (Map<String,Object> map:list){
 |  |         for (Map<String,Object> map:list){
 | 
												
													
														
															|  |             if (map.get("createTime")!=null){
 |  |             if (map.get("createTime")!=null){
 | 
												
													
														
															|  |                 map.put("createTime",DateUtil.dateToStrLong(DateUtil.strToDateLong(map.get("createTime").toString())));
 |  |                 map.put("createTime",DateUtil.dateToStrLong(DateUtil.strToDateLong(map.get("createTime").toString())));
 | 
												
													
														
															|  |                 map.put("orgCode",wechatId);
 |  | 
 | 
												
													
														
															|  |             }
 |  |             }
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |         return list;
 |  |         return list;
 | 
												
													
														
															|  |     }
 |  |     }
 | 
												
													
														
															|  | 
 |  |     public com.alibaba.fastjson.JSONObject getWorkDoctorCount(String nowTime,String orgCode){
 | 
												
													
														
															|  | 
 |  |         String sql = "select count(*) as \"total\",t.doctor as \"doctor\" from wlyy_doctor_work_time t " +
 | 
												
													
														
															|  | 
 |  |                 " left join base_doctor_hospital b on t.doctor = b.doctor_code where 1=1 ";
 | 
												
													
														
															|  | 
 |  |         if(StringUtils.isNoneBlank(nowTime)){
 | 
												
													
														
															|  | 
 |  |             if("xm_ykyy_wx".equals(wechatId)){
 | 
												
													
														
															|  | 
 |  |                 if (flag){
 | 
												
													
														
															|  | 
 |  |                     sql+=" and t.start_time >= '" + nowTime + " 00:00:00' and t.end_time <='"+nowTime+" 23:59:59' ";
 | 
												
													
														
															|  | 
 |  |                 }else {
 | 
												
													
														
															|  | 
 |  |                     sql+=" and t.start_time >= to_date('" + nowTime + " 00:00:00', 'yyyy-mm-dd hh24:mi:ss') and t.end_time <=to_date('"+nowTime+" 23:59:59', 'yyyy-mm-dd hh24:mi:ss') ";
 | 
												
													
														
															|  | 
 |  |                 }
 | 
												
													
														
															|  | 
 |  |             }else{
 | 
												
													
														
															|  | 
 |  |                 sql+=" and t.start_time >= '" + nowTime + " 00:00:00' and t.end_time <='"+nowTime+" 23:59:59' ";
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         if(StringUtils.isNoneBlank(orgCode)){
 | 
												
													
														
															|  | 
 |  |             sql+=" and b.org_code ='"+orgCode+"'";
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         sql+=" group by t.doctor";
 | 
												
													
														
															|  | 
 |  |         List<Map<String,Object>> list = hibenateUtils.createSQLQuery(sql);
 | 
												
													
														
															|  | 
 |  |         long count =0;
 | 
												
													
														
															|  | 
 |  |         if(list!=null){
 | 
												
													
														
															|  | 
 |  |             count = list.size();
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  | 
 |  |         com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
 | 
												
													
														
															|  | 
 |  |         jsonObject.put("workDoctorCount",count);
 | 
												
													
														
															|  | 
 |  |         return  jsonObject;
 | 
												
													
														
															|  | 
 |  |     }
 | 
												
													
														
															|  | }
 |  | }
 |