|
@ -566,22 +566,22 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
|
|
|
try {
|
|
|
//更新二维码(isUse)
|
|
|
PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeDao.finByCode(prescriptionCode);
|
|
|
if(prescriptionDispensaryCode!=null){
|
|
|
List<PrescriptionDispensaryCode> list = prescriptionDispensaryCodeDao.findByPrescriptionCode(prescriptionCode);
|
|
|
if(list!=null&&list.size()>0){
|
|
|
//修改取药码code为已经使用
|
|
|
prescriptionDispensaryCode.setIsUse(1);
|
|
|
prescriptionDispensaryCodeDao.save(prescriptionDispensaryCode);
|
|
|
|
|
|
//更新配送信息
|
|
|
PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionCode(prescriptionDispensaryCode.getPrescriptionCode());
|
|
|
|
|
|
if(prescriptionExpressage!=null){
|
|
|
prescriptionExpressage.setHospitalDoctor(d.getName());
|
|
|
prescriptionExpressage.setHospitalDoctorCode(doctor);
|
|
|
prescriptionExpressage.setFetchingMedicineTime(new Date());
|
|
|
prescriptionExpressageDao.save(prescriptionExpressage);
|
|
|
for(PrescriptionDispensaryCode prescriptionDispensaryCode:list){
|
|
|
prescriptionDispensaryCode.setIsUse(1);
|
|
|
prescriptionDispensaryCodeDao.save(prescriptionDispensaryCode);
|
|
|
}
|
|
|
}
|
|
|
//更新配送信息
|
|
|
PrescriptionExpressage prescriptionExpressage = prescriptionExpressageDao.findByPrescriptionCode(prescriptionCode);
|
|
|
if(prescriptionExpressage!=null){
|
|
|
prescriptionExpressage.setHospitalDoctor(d.getName());
|
|
|
prescriptionExpressage.setHospitalDoctorCode(doctor);
|
|
|
prescriptionExpressage.setFetchingMedicineTime(new Date());
|
|
|
prescriptionExpressageDao.save(prescriptionExpressage);
|
|
|
}
|
|
|
}catch (Exception e){
|
|
|
logger.info("更新二维码(isUse),更新配送信息 异常:"+e.getMessage());
|
|
|
}
|
|
@ -665,7 +665,7 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
" p.hospital = '"+d.getHospital()+"' ";
|
|
|
sql = setSQL( sql,keyWord,state,type,startDate,endDate,operator,flag);
|
|
|
sql += " AND p.`status`>=50 " +
|
|
|
" ORDER BY py.create_time DESC " +
|
|
|
" ORDER BY py.charge_time DESC " +
|
|
|
" LIMIT " + start + "," + pageSize;
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
|
|
@ -702,14 +702,14 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(startDate)){
|
|
|
startDate +=" 00:00:00";
|
|
|
sql += " AND py.create_time >='"+startDate+"' ";
|
|
|
sql += " AND py.charge_time >='"+startDate+"' ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(endDate)){
|
|
|
endDate +=" 23:59:59";
|
|
|
sql += " AND py.create_time <='"+endDate+"' ";
|
|
|
sql += " AND py.charge_time <='"+endDate+"' ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(operator)){
|
|
|
sql += " AND p.drug_delivery_operator ='"+operator+"' ";
|
|
|
sql += " AND e.hospital_doctor_code ='"+operator+"' ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(flag)){
|
|
|
sql += " AND p.drug_delivery_flag ="+flag+" ";
|
|
@ -720,16 +720,16 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
public List<Map<String,Object>> getHospitalOperator(String doctor){
|
|
|
Doctor d = doctorDao.findByCode(doctor);
|
|
|
String sql = "SELECT " +
|
|
|
" p.drug_delivery_operator AS operator, " +
|
|
|
" p.drug_delivery_operator_name AS operatorName " +
|
|
|
" p.hospital_doctor_code AS operator, " +
|
|
|
" p.hospital_doctor AS operatorName " +
|
|
|
" FROM " +
|
|
|
" wlyy_prescription p " +
|
|
|
" wlyy_prescription_expressage p " +
|
|
|
" WHERE " +
|
|
|
" p.hospital = '"+d.getHospital()+"' " +
|
|
|
" AND p.drug_delivery_operator IS NOT NULL" +
|
|
|
" AND p.drug_delivery_operator <>'' " +
|
|
|
" p.hospital_code = '"+d.getHospital()+"' " +
|
|
|
" AND p.hospital_doctor_code IS NOT NULL" +
|
|
|
" AND p.hospital_doctor_code <>'' " +
|
|
|
" GROUP BY " +
|
|
|
" p.drug_delivery_operator ";
|
|
|
" p.hospital_doctor_code ";
|
|
|
List<Map<String,Object>> rs = jdbcTemplate.queryForList(sql);
|
|
|
return rs;
|
|
|
}
|
|
@ -822,7 +822,7 @@ public class PrescriptionExpressageService extends BaseService {
|
|
|
sql += " AND e.fetching_medicine_time <='"+endDate+"' ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(operator)){
|
|
|
sql += " AND p.drug_delivery_operator ='"+operator+"' ";
|
|
|
sql += " AND e.hospital_doctor_code ='"+operator+"' ";
|
|
|
}
|
|
|
if(StringUtils.isNotBlank(flag)){
|
|
|
sql += " AND p.drug_delivery_flag ="+flag+" ";
|