|
@ -1,8 +1,11 @@
|
|
package com.yihu.wlyy.controller.manager.device;
|
|
package com.yihu.wlyy.controller.manager.device;
|
|
|
|
|
|
import com.yihu.wlyy.controller.BaseController;
|
|
import com.yihu.wlyy.controller.BaseController;
|
|
import com.yihu.wlyy.device.entity.PatientDeviceVO;
|
|
|
|
|
|
import com.yihu.wlyy.device.entity.PatientDeviceExportVO;
|
|
|
|
import com.yihu.wlyy.device.entity.WlyyPatientDeviceVO;
|
|
|
|
import com.yihu.wlyy.entity.Doctor;
|
|
import com.yihu.wlyy.entity.WlyyPatientDevice;
|
|
import com.yihu.wlyy.entity.WlyyPatientDevice;
|
|
|
|
import com.yihu.wlyy.service.doctor.DoctorService;
|
|
import com.yihu.wlyy.service.manager.device.WlyyPatientDeviceService;
|
|
import com.yihu.wlyy.service.manager.device.WlyyPatientDeviceService;
|
|
import jxl.Workbook;
|
|
import jxl.Workbook;
|
|
import jxl.write.*;
|
|
import jxl.write.*;
|
|
@ -27,9 +30,24 @@ import java.util.List;
|
|
public class WlyyPatientDeviceController extends BaseController {
|
|
public class WlyyPatientDeviceController extends BaseController {
|
|
@Autowired
|
|
@Autowired
|
|
private WlyyPatientDeviceService patientDeviceService;
|
|
private WlyyPatientDeviceService patientDeviceService;
|
|
|
|
@Autowired
|
|
|
|
private DoctorService doctorService;
|
|
|
|
|
|
@RequestMapping(value = "initial", method = RequestMethod.GET)
|
|
@RequestMapping(value = "initial", method = RequestMethod.GET)
|
|
public String listPageInit(){
|
|
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";
|
|
return "device/patientDevice_list";
|
|
}
|
|
}
|
|
|
|
|
|
@ -40,6 +58,34 @@ public class WlyyPatientDeviceController extends BaseController {
|
|
@RequestParam(value = "categoryCode",required = false) String categoryCode,
|
|
@RequestParam(value = "categoryCode",required = false) String categoryCode,
|
|
@RequestParam(value = "deviceSn",required = false) String deviceSn,
|
|
@RequestParam(value = "deviceSn",required = false) String deviceSn,
|
|
@RequestParam(value = "userName",required = false) String userName,
|
|
@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){
|
|
|
|
try {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
return write(200,"操作成功",page,pageSize,totalcount,patientDevices);
|
|
|
|
}catch (Exception ex){
|
|
|
|
error(ex);
|
|
|
|
return error(-1,"操作失败!");
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@RequestMapping(value = "listbak",method = RequestMethod.POST)
|
|
|
|
@ResponseBody
|
|
|
|
public String searchListbak(
|
|
|
|
@RequestParam(value = "deviceName",required = false) String deviceName,
|
|
|
|
@RequestParam(value = "categoryCode",required = false) String categoryCode,
|
|
|
|
@RequestParam(value = "deviceSn",required = false) String deviceSn,
|
|
|
|
@RequestParam(value = "userName",required = false) String userName,
|
|
|
|
@RequestParam(value = "doctorName",required = false) String doctorName,
|
|
|
|
@RequestParam(value = "hospital",required = false) String hospital,
|
|
@RequestParam(value = "page") Integer page,
|
|
@RequestParam(value = "page") Integer page,
|
|
@RequestParam(value = "rows") Integer pageSize){
|
|
@RequestParam(value = "rows") Integer pageSize){
|
|
try {
|
|
try {
|
|
@ -49,7 +95,7 @@ public class WlyyPatientDeviceController extends BaseController {
|
|
error(ex);
|
|
error(ex);
|
|
return error(-1,"操作失败!");
|
|
return error(-1,"操作失败!");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//设备解绑(记录删除)
|
|
//设备解绑(记录删除)
|
|
@ -76,7 +122,7 @@ public class WlyyPatientDeviceController extends BaseController {
|
|
@RequestParam(value = "hospital",required = false)String hospital,
|
|
@RequestParam(value = "hospital",required = false)String hospital,
|
|
HttpServletResponse response){
|
|
HttpServletResponse response){
|
|
try {
|
|
try {
|
|
List<PatientDeviceVO> wlyyDevices = patientDeviceService.exportPatientDeviceList(town,hospital);
|
|
|
|
|
|
List<PatientDeviceExportVO> wlyyDevices = patientDeviceService.exportPatientDeviceList(town,hospital);
|
|
response.setContentType("octets/stream");
|
|
response.setContentType("octets/stream");
|
|
response.setHeader("Content-Disposition", "attachment; filename="+ new String( "patientDeviceDataList.xls"));
|
|
response.setHeader("Content-Disposition", "attachment; filename="+ new String( "patientDeviceDataList.xls"));
|
|
OutputStream os = response.getOutputStream();
|
|
OutputStream os = response.getOutputStream();
|
|
@ -103,7 +149,7 @@ public class WlyyPatientDeviceController extends BaseController {
|
|
ws = wwb.createSheet("sheet",1);
|
|
ws = wwb.createSheet("sheet",1);
|
|
addHeader(ws);
|
|
addHeader(ws);
|
|
int i = 1;
|
|
int i = 1;
|
|
for (PatientDeviceVO m : (List<PatientDeviceVO>) ls) {
|
|
|
|
|
|
for (PatientDeviceExportVO m : (List<PatientDeviceExportVO>) ls) {
|
|
addCell(ws, i, 0, m.getName(),"");
|
|
addCell(ws, i, 0, m.getName(),"");
|
|
addCell(ws, i, 1, m.getMobile(),"");
|
|
addCell(ws, i, 1, m.getMobile(),"");
|
|
addCell(ws, i, 2, m.getIdcard(),"");
|
|
addCell(ws, i, 2, m.getIdcard(),"");
|