Browse Source

长处方优化

zd_123 7 years ago
parent
commit
a85e24cdc6

+ 6 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionService.java

@ -426,14 +426,14 @@ public class PrescriptionService extends BaseService {
                " p.create_time," +
                " GROUP_CONCAT(d.health_problem) AS health_problem," +
                " GROUP_CONCAT(d.health_problem_name) AS health_problem_name," +
                " a.total_amount" +
                " FORMAT(a.total_amount/100,1) AS total_amount" +
                " FROM" +
                " wlyy_prescription p" +
                " LEFT JOIN wlyy_prescription_diagnosis d ON p. CODE = d.prescription_code" +
                " LEFT JOIN wlyy_prescription_pay a ON p. CODE = a.prescription_code" +
                " WHERE" +
                " IF (" +
                " p. STATUS > 50," +
                " p. STATUS > 50 AND a.trade_status IS NOT NULL, " +
                " a.trade_status = 1," +
                " 1 = 1" +
                ")";
@ -500,7 +500,7 @@ public class PrescriptionService extends BaseService {
            }
        }
        DecimalFormat df = new DecimalFormat("#.0");
        jsonObject.put("totalAmount",totalAmount>0?df.format(totalAmount/100.0):0.0);
        jsonObject.put("totalAmount",totalAmount>0?df.format(totalAmount):0.0);
        sql += " limit ?,?";
        resultList = jdbcTemplate.queryForList(sql,new Object[]{start,pageSize});
        jsonObject.put("list",resultList);
@ -524,13 +524,13 @@ public class PrescriptionService extends BaseService {
                " p.create_time," +
                " GROUP_CONCAT(d.health_problem) AS health_problem," +
                " GROUP_CONCAT(d.health_problem_name) AS health_problem_name,"+
                " a.total_amount"+
                " FORMAT(a.total_amount/100,1) AS total_amount"+
                " FROM" +
                " wlyy_prescription p" +
                " LEFT JOIN wlyy_prescription_diagnosis d ON p. CODE = d.prescription_code" +
                " LEFT JOIN wlyy_prescription_pay a ON p.code = a.prescription_code" +
                " WHERE" +
                " IF(p.status>50,a.trade_status=1,1=1) " ;
                " IF(p.status>50 AND a.trade_status IS NOT NULL,a.trade_status=1,1=1) " ;
        //判断关键字
        if (StringUtils.isNotBlank(keyWord)){
            sql += " AND (p.patient_name like '%"+keyWord+"%' or p.doctor_name like '%"+keyWord+"%')";
@ -545,7 +545,7 @@ public class PrescriptionService extends BaseService {
            }
        }
        DecimalFormat df = new DecimalFormat("#.0");
        jsonObject.put("totalAmount",totalAmount>0?df.format(totalAmount/100.0):0.0);
        jsonObject.put("totalAmount",totalAmount>0?df.format(totalAmount):0.0);
        sql+=" limit ?,?";
        int start = (pageNo-1)*pageSize;
        resultList = jdbcTemplate.queryForList(sql,new Object[]{start,pageSize});

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/prescription/PrescriptionInfoController.java

@ -661,6 +661,8 @@ public class PrescriptionInfoController extends BaseController {
            return write(200, "查询成功", "data", prescriptionService.getPrescriptionByCondition(level,area,disease,status,type,startTime,endTime,Integer.valueOf(pageNo),Integer.valueOf(pageSize)));
        } catch (Exception e) {
            error(e);
            e.printStackTrace();
            System.out.print("错误信息"+e.getMessage());
            return error(-1, "查询失败");
        }
    }