소스 검색

管理后台BUG修复

huangwenjie 7 년 전
부모
커밋
adc11ebf42

+ 15 - 15
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/WlyyPatientDeviceController.java

@ -17,6 +17,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.OutputStream;
@ -35,18 +36,6 @@ public class WlyyPatientDeviceController extends BaseController {
    @RequestMapping(value = "initial", method = RequestMethod.GET)
    public String listPageInit(){
    
        String currentid = getUID();
    
        Doctor doctor = doctorService.findDoctorByCode(currentid);
    
        String hospitalCode = "";
        
        if(doctor != null){
            hospitalCode = doctor.getHospital();
        }
        
        request.setAttribute("hospitalCode",hospitalCode);
        
        return "device/patientDevice_list";
    }
@ -59,13 +48,24 @@ public class WlyyPatientDeviceController extends BaseController {
            @RequestParam(value = "deviceSn",required = false) String deviceSn,
            @RequestParam(value = "userName",required = false) String userName,
            @RequestParam(value = "doctorName",required = false) String doctorName,
            @RequestParam(value = "hospitalCode",required = false) String hospitalCode,
            @RequestParam(value = "hospitalName",required = false) String hospitalName,
            @RequestParam(value = "page") Integer page,
            @RequestParam(value = "rows") Integer pageSize){
            @RequestParam(value = "rows") Integer pageSize,
            HttpServletRequest req, HttpServletResponse resp){
        try {
    
            String currentid = req.getSession().getAttribute("code").toString();
    
            System.out.println("doctorid:"+currentid);
            
            
            Doctor doctor = doctorService.findDoctorByCode(currentid);
    
            String hospitalCode = "";
    
            if(doctor != null){
                System.out.println("doctor-hospitalCode:"+doctor.getHospital());
                hospitalCode = doctor.getHospital();
            }
            
            List<WlyyPatientDeviceVO> patientDevices = patientDeviceService.searchListNew(deviceName,categoryCode, deviceSn, userName, doctorName,hospitalName,hospitalCode,page, pageSize);
            Long totalcount = patientDeviceService.getCountSearchListNew(deviceName,categoryCode, deviceSn, userName, doctorName,hospitalName,hospitalCode);

+ 10 - 6
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/WlyyPatientDeviceService.java

@ -183,20 +183,22 @@ public class WlyyPatientDeviceService extends BaseJpaService<WlyyPatientDevice,W
                "ORDER BY czrq DESC ";
        
        sql = sql+" limit " + (page-1)*pageSize+", "+pageSize;
        System.out.println("list:"+sql);
        list =  jdbcTemplate.query(sql,new BeanPropertyRowMapper(WlyyPatientDeviceVO.class));
        return list ;
	}
    
    public Long getCountSearchListNew(String deviceName, String categoryCode, String deviceSn, String userName, String doctorName, String hospitalName,String hospitalCode) {
    
        String sql  = "SELECT count(d.id)" +
        String sql  = "SELECT count(d.id) " +
                "FROM " +
                "wlyy_sign_family s," +
                "wlyy_patient_device d," +
                "wlyy_patient p " +
                "WHERE s.patient=d.`user` ";
                " wlyy_sign_family s," +
                " wlyy_patient_device d," +
                " wlyy_patient p " +
                "WHERE " +
                " s.patient = d.`user` ";
        if(StringUtils.isNotBlank(hospitalName)){
            sql = sql + "AND s.hospital like '%"+hospitalName+"%' ";
            sql = sql + "AND s.hospital_name like '%"+hospitalName+"%' ";
        }
    
        if(StringUtils.isNotBlank(hospitalCode)){
@ -225,6 +227,8 @@ public class WlyyPatientDeviceService extends BaseJpaService<WlyyPatientDevice,W
    
        sql = sql +"AND s.`status`> 0 AND s.patient=p.CODE ";
    
        System.out.println("count:"+sql);
    
        Long total = jdbcTemplate.queryForObject(sql, Long.class);
    
        return total ;

+ 0 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/patientDevice_list.jsp

@ -18,7 +18,6 @@
	<div class="m-retrieve-area f-h50 f-dn f-pr m-form-inline" data-role-form style='display: block;'>
		<div class="m-form-group f-mt10">
			<div class="m-form-control f-ml15">
				<input type="hidden" id="inp_hospital_code"value='${hospitalCode}' data-attr-scan="hospitalCode">
				<input type="text" id="inp_hospital_name" placeholder="请输入机构名称" class="f-ml10" data-attr-scan="hospitalName"/>
			</div>
			<div class="m-form-control f-ml15">

+ 0 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/patientDevice_list_js.jsp

@ -36,7 +36,6 @@
				$userName: $("#inp_user_name"),//人员姓名
                $doctorName: $("#inp_doctor_name"),//医生姓名
                $hosiptalName: $("#inp_hospital_name"),//社区名称
                $hosiptalCode: $("#hospitalCode"),//社区CODE
				init: function () {
					this.$element.show();
					this.$element.attrScan();