瀏覽代碼

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

trick9191 7 年之前
父節點
當前提交
423bfab6f9

+ 19 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/controller/manager/device/WlyyDeviceController.java

@ -3,6 +3,8 @@ package com.yihu.wlyy.controller.manager.device;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.wlyy.controller.BaseController;
import com.yihu.wlyy.device.entity.WlyyDevice;
import com.yihu.wlyy.entity.DmDevice;
import com.yihu.wlyy.service.manager.device.DmDeviceService;
import com.yihu.wlyy.service.manager.device.WlyyDeviceService;
import jxl.Workbook;
import jxl.read.biff.BiffException;
@ -29,9 +31,11 @@ import java.util.List;
@Controller
@RequestMapping("admin/device")
public class WlyyDeviceController extends BaseController {
    @Autowired
    private WlyyDeviceService deviceService;
    @Autowired
    private DmDeviceService dmDeviceService;
    @Autowired
    private ObjectMapper objectMapper;
@ -72,6 +76,20 @@ public class WlyyDeviceController extends BaseController {
        }
    }
    //设备型号列表
    @RequestMapping(value = "modelList",method = RequestMethod.POST)
    @ResponseBody
    public String findAll(){
        try{
            List<DmDevice> list = dmDeviceService.findAll();
            return  write(200,"操作成功","data",list);
        }catch (Exception ex){
            error(ex);
            return error(-1, "操作失败!");
        }
    }
    @RequestMapping(value = "device")
    @ResponseBody
    public String getDevice(@RequestParam(value = "id") Long id){
@ -142,7 +160,6 @@ public class WlyyDeviceController extends BaseController {
        return deviceService.existDeviceCode(deviceCode);
    }
    
    
    //导出设备报表
    @RequestMapping(value="toExcel",method = RequestMethod.POST,produces = "application/json;charset=UTF-8" )
    public void exportList(

+ 14 - 2
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DmDeviceService.java

@ -1,9 +1,21 @@
package com.yihu.wlyy.service.manager.device;
import com.yihu.wlyy.entity.DmDevice;
import com.yihu.wlyy.repository.DmDeviceDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
 * Created by Administrator on 2017/1/18.
 * Created by humingfen on 2018/8/17.
 */
@Service
public class DmDeviceService {
    @Autowired
    private DmDeviceDao dmDeviceDao;
    public List<DmDevice> findAll() {
        return (List<DmDevice>)dmDeviceDao.findAll();
    }
}

+ 19 - 2
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/device_create_js.jsp

@ -19,7 +19,8 @@
				    /*
				     *设备厂商列表
				     */
				    manufacturerList: '/admin/manufacturer/findAll'
				    manufacturerList: '/admin/manufacturer/findAll',
                    deviceModelList: '/admin/device/modelList'
                },
				init: function () {
                    this.initComboBox();
@ -31,7 +32,7 @@
					$("#inp_tel").ligerTextBox({width: 240})//联系电话
					$("#inp_serverIp").ligerTextBox({width: 240})//服务IP地址
					$("#inp_deviceName").ligerTextBox({width: 240})//设备名称
					$("#inp_deviceModel").ligerTextBox({width: 240})//设备型号
					// $("#inp_deviceModel").ligerTextBox({width: 240})//设备型号
					$("#inp_deviceCode").ligerTextBox({width: 240})//设备唯一标识
					$("#inp_sim").ligerTextBox({width: 240})//设备sim码
					//$("#inp_manufacturer").ligerTextBox({width: 240})//厂家名称
@ -56,6 +57,16 @@
                            });
                        }
                        that.initInpCat( d, that);
                    });
                    this.rAjax( this.url.deviceModelList,{} ,function (data) {
                        var d = [];
                        for (var i = 0; i < data.data.length; i++) {
                            d.push({
                                text: data.data[i].name,
                                id: data.data[i].model
                            });
                        }
                        that.initModel( d, that);
                    })
                },
                //设备厂商下拉框
@ -64,6 +75,12 @@
                        data: d,
                    });
                },
                //设备型号下拉框
                initModel: function(d, me) {
				    $("#inp_deviceModel").ligerComboBox({
                        data: d
                    })
                },
				//绑定事件
				bindEvents: function () {

+ 22 - 4
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/device_modify_js.jsp

@ -19,6 +19,7 @@
				//变量
				$form: $("#div_patient_info_form"),
                $manufacturer: $("#sel_manufacturer"),
                $deviceModel: $("#inp_deviceModel"),
				init: function () {
                    _this = this;
                    this.$form.attrScan();
@ -29,7 +30,7 @@
					$("#inp_tel").ligerTextBox({width: 240})//联系电话
					$("#inp_serverIp").ligerTextBox({width: 240})//服务IP地址
					$("#inp_deviceName").ligerTextBox({width: 240})//设备名称
					$("#inp_deviceModel").ligerTextBox({width: 240})//设备型号
					// $("#inp_deviceModel").ligerTextBox({width: 240})//设备型号
					$("#inp_deviceCode").ligerTextBox({width: 240})//设备唯一标识
					$("#inp_sim").ligerTextBox({width: 240})//设备sim
					// $("#inp_manufacturer").ligerTextBox({width: 240})//厂家名称
@ -52,11 +53,27 @@
                            if (ajaxHeaderName) {
                                xhr.setRequestHeader(ajaxHeaderName, ajaxHeaderValue);
                            }
                        },
                        }
                    });
                    //厂商下拉框刷新
                    //设备型号下拉框
                    _this.deviceModelBox = _this.$deviceModel.ligerComboBox({
                        url: ctx + "/admin/device/modelList",
                        parms: {},
                        dataParmName: "data",
                        textField: "name",
                        valueField: "model",
                        isMultiSelect: false,
                        ajaxBeforeSend: function (xhr) {
                            if (ajaxHeaderName) {
                                xhr.setRequestHeader(ajaxHeaderName, ajaxHeaderValue);
                            }
                        }
                    });
                    //下拉框刷新
                    _this.reloadManufacturerBox = function () {
                        deviceInfo.manufacturerBox.reload();
                        deviceInfo.deviceModelBox.reload();
                    };
                },
@ -83,7 +100,6 @@
									serverIp: data.serverIp,
									deviceName: data.deviceName,
									sim: data.sim,
									deviceModel: data.deviceModel,
									deviceCode: data.deviceCode,
									address: data.address,
									representative: data.representative,
@ -94,6 +110,7 @@
								});
								//填值
								_this.manufacturerBox.selectValue(data.manufacturerId);
								_this.deviceModelBox.selectValue(data.deviceModel)
							} else {
								$.Notice.error(result.msg);
							}
@ -160,6 +177,7 @@
						//厂家名称
						values.manufacturerId = self.manufacturerBox.getValue();
                        values.manufacturer = self.manufacturerBox.getText();
                        values.deviceModel = self.deviceModelBox.getValue();
						if (!validator.validate()) {
							return;
						}