Parcourir la source

Merge branch 'dev' of trick9191/patient-co-management into dev

trick9191 il y a 7 ans
Parent
commit
4df694df4a

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/aop/ObserverRequiredAOP.java

@ -21,7 +21,7 @@ import java.io.PrintWriter;
@Aspect
@Component
public class ObserverRequiredAOP {
    //Controller层切点
    //Controller层切点路径
    @Pointcut("execution(* com.yihu.wlyy.web..*.*(..))")
    public void controllerAspect() {
    }

+ 50 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionInfoService.java

@ -72,7 +72,7 @@ public class PrescriptionInfoService extends BaseService {
     * @param type
     * @return
     */
    public JSONArray getPrescriptionInfos(String type,String state,String startDate,String endDate,String diagnosisCode,String patient){
    public JSONArray getPrescriptionInfos(String type,String state,String startDate,String endDate,String patient){
        if(StringUtils.isNotBlank(type)){
            if("1".equals(type)){
@ -166,4 +166,53 @@ public class PrescriptionInfoService extends BaseService {
    public void upLoadPrescriotionState(){
    }
    public JSONArray getDoctorPrescription(String doctor,String state,String diseases,String startDate,String endDate ){
        StringBuffer pre_sql = new StringBuffer("SELECT " +
                " p.`name`, " +
                " TIMESTAMPDIFF(YEAR,p.birthday,SYSDATE()) age, " +
                " p.sex, " +
                " pr.`status`, " +
                " pr.`code`, " +
                " pr.create_time AS createTime, " +
                " pr.doctor " +
                " FROM " +
                " wlyy_prescription pr " +
                " LEFT JOIN wlyy_patient p ON pr.patient = p.`code` " );
        List<Object> params = new ArrayList<>();
        //先判断疾病类型是否为空
        if(StringUtils.isNotBlank(diseases)){
            //疾病类型不为空,关联查询疾病类型表
            pre_sql.append(" ,wlyy_prescription_diagnosis s " +
                    " WHERE s.prescription_code = pr.code " +
                    " AND pr.doctor =? AND s.code = ?");
            params.add(doctor);
            params.add(diseases);
            setSQL(pre_sql,params,state,startDate,endDate);
        }else{
            //查询所有疾病类型表
            pre_sql.append(" WHERE pr.doctor =?");
            params.add(doctor);
            setSQL(pre_sql,params,state,startDate,endDate);
        }
        List<Map<String,Object>> rs = jdbcTemplate.queryForList(pre_sql.toString(),params.toArray());
        return new JSONArray(rs);
    }
    public void setSQL(StringBuffer pre_sql,List<Object> params,String state,String startDate,String endDate){
        if(StringUtils.isNotBlank(state)){
            pre_sql.append(" AND pr.status = ?");
            params.add(state);
        }
        if(StringUtils.isNotBlank(startDate)){
            pre_sql.append(" AND pr.create_time >= ?");
            params.add(startDate);
        }
        if(StringUtils.isNotBlank(endDate)){
            pre_sql.append(" AND pr.create_time <= ?");
            params.add(endDate);
        }
        pre_sql.append(" ORDER BY pr.create_time DESC");
    }
}

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

@ -57,5 +57,20 @@ public class PrescriptionInfoController extends BaseController{
        }
    }
    @RequestMapping(value = "/getDoctorPrescription", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation(value = "获取全科医生续方列表")
    public String getDoctorPrescription(@RequestParam(required = true) @ApiParam(value = "续方状态", name = "state") String state,
                                        @RequestParam(required = true) @ApiParam(value = "所有诊断:1 糖尿病 2高血压", name = "dispensary") String diseases,
                                        @RequestParam(required = true)@ApiParam(name="startDate",value="开始时间")String startDate,
                                        @RequestParam(required = true)@ApiParam(name="endDate",value="结束时间")String endDate){
        try {
            return write(200, "查询成功!", "data",prescriptionInfoService.getDoctorPrescription(getUID(),state,diseases,startDate,endDate));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");
        }
    }
}

+ 1 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionInfoController.java

@ -34,11 +34,10 @@ public class PatientPrescriptionInfoController extends BaseController {
    @ApiOperation(value = "获取长处方信息列表")
    public String getPrescriptionInfos(@RequestParam(required = true)@ApiParam(name="type",value="1:查询处方;2我的续方;3:续方记录")String type,
                                       @RequestParam(required = true)@ApiParam(name="state",value="状态")String state,
                                       @RequestParam(required = true)@ApiParam(name="diagnosisCode",value="诊断结果")String diagnosisCode,
                                       @RequestParam(required = true)@ApiParam(name="startDate",value="开始时间")String startDate,
                                       @RequestParam(required = true)@ApiParam(name="endDate",value="结束时间")String endDate){
        try {
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionInfos(type,state,startDate,endDate,diagnosisCode,getRepUID()));
            return write(200, "查询成功!", "data", prescriptionInfoService.getPrescriptionInfos(type,state,startDate,endDate,getRepUID()));
        } catch (Exception e) {
            error(e);
            return error(-1, "查询失败!");