摄像头激活码页面,设备信息列表页面
This commit is contained in:
@@ -100,6 +100,18 @@
|
||||
<artifactId>tiles-api</artifactId>
|
||||
<version>3.0.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.poi</groupId>
|
||||
<artifactId>poi</artifactId>
|
||||
<version>3.15</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.jexcelapi</groupId>
|
||||
<artifactId>jxl</artifactId>
|
||||
<version>2.6.12</version>
|
||||
<type>jar</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax</groupId>
|
||||
<artifactId>javaee-web-api</artifactId>
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.ifish.API;
|
||||
|
||||
import com.ifish.bean.Tbl_Activa_Code;
|
||||
import java.io.OutputStream;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.apache.poi.hssf.usermodel.HSSFCell;
|
||||
import org.apache.poi.hssf.usermodel.HSSFSheet;
|
||||
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
|
||||
import org.springframework.web.servlet.view.document.AbstractExcelView;
|
||||
|
||||
public class DownloadExcel extends AbstractExcelView {
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
protected void buildExcelDocument(Map<String, Object> model, HSSFWorkbook workbook, HttpServletRequest request, HttpServletResponse response) throws Exception {
|
||||
List<Tbl_Activa_Code> list = (List<Tbl_Activa_Code>) model.get("list");
|
||||
HSSFSheet sheet = workbook.createSheet("sheet");
|
||||
sheet.setColumnWidth(0, (int) ((35 + 0.72) * 256));
|
||||
HSSFCell cell0 = getCell(sheet, 0, 0);
|
||||
cell0.setCellValue("激活码");
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
HSSFCell cell = getCell(sheet, (i + 1), 0);
|
||||
cell.setCellValue("iFishCamera:" + list.get(i).getActiveCode());
|
||||
}
|
||||
//设置下载时客户端Excel的名称
|
||||
String filename = URLEncoder.encode("激活码.xls", "UTF-8");
|
||||
response.setContentType("application/vnd.ms-excel");
|
||||
response.setHeader("Content-disposition", "attachment;filename=" + filename);
|
||||
OutputStream ouputStream = response.getOutputStream();
|
||||
workbook.write(ouputStream);
|
||||
ouputStream.flush();
|
||||
ouputStream.close();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.ifish.API;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import jxl.Cell;
|
||||
import jxl.Sheet;
|
||||
import jxl.Workbook;
|
||||
|
||||
public class UploadExcel {
|
||||
|
||||
public boolean readExcel(String filePath){
|
||||
try {
|
||||
InputStream is = new FileInputStream(filePath);
|
||||
Workbook workbook = Workbook.getWorkbook(is);
|
||||
Sheet sheet = workbook.getSheet(0);
|
||||
//行
|
||||
int rows = sheet.getRows();
|
||||
List<String> macList = new ArrayList<String>();
|
||||
for(int i=1;i < rows;i++){
|
||||
Cell cell = sheet.getCell(0,i);
|
||||
String value = cell.getContents();
|
||||
macList.add(value);
|
||||
}
|
||||
List<String> hardTypeList = new ArrayList<String>();
|
||||
for(int i=1;i < rows;i++){
|
||||
Cell cell = sheet.getCell(1,i);
|
||||
String value = cell.getContents();
|
||||
hardTypeList.add(value);
|
||||
}
|
||||
workbook.close();
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static void main(String[] args) {
|
||||
new UploadExcel().readExcel("D:\\iFishDownload\\2016-06-29(1).xls");
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ package com.ifish.bean;
|
||||
import java.util.Date;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
|
||||
@@ -29,6 +30,7 @@ public class Tbl_Activa_Code implements java.io.Serializable {
|
||||
/**
|
||||
* 激活码
|
||||
*/
|
||||
@GeneratedValue(generator = "uuid")
|
||||
@Id
|
||||
@Column(name = "active_code", unique = true, nullable = false, length = 50)
|
||||
private String activeCode;
|
||||
|
||||
@@ -0,0 +1,276 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.ifish.bean;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
/**
|
||||
* 升级记录表(tbl_upgrade_notes)
|
||||
*
|
||||
* @author bianj
|
||||
* @version 1.0.0 2017-08-14
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "tbl_upgrade_notes")
|
||||
public class Tbl_Upgrade_Notes {
|
||||
|
||||
/**
|
||||
* 版本号
|
||||
*/
|
||||
private static final long serialVersionUID = -2952039380782651043L;
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@Id
|
||||
@Column(name = "notes_id", unique = true, nullable = false, length = 10)
|
||||
private Integer notesId;
|
||||
|
||||
/**
|
||||
* 升级版本
|
||||
*/
|
||||
@Column(name = "upgrade_version", nullable = true, length = 10)
|
||||
private Integer upgradeVersion;
|
||||
|
||||
/**
|
||||
* 电子厂代码
|
||||
*/
|
||||
@Column(name = "factory_code", nullable = true, length = 20)
|
||||
private String factoryCode;
|
||||
|
||||
/**
|
||||
* 鱼缸厂代码
|
||||
*/
|
||||
@Column(name = "brand_code", nullable = true, length = 20)
|
||||
private String brandCode;
|
||||
|
||||
/**
|
||||
* 硬件型号
|
||||
*/
|
||||
@Column(name = "hardware_type", nullable = true, length = 20)
|
||||
private String hardwareType;
|
||||
|
||||
/**
|
||||
* sdk版本
|
||||
*/
|
||||
@Column(name = "sdk_version", nullable = true, length = 10)
|
||||
private Integer sdkVersion;
|
||||
|
||||
/**
|
||||
* 升级数量
|
||||
*/
|
||||
@Column(name = "upgrade_number", nullable = true, length = 10)
|
||||
private Integer upgradeNumber;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Column(name = "remarks", nullable = true, length = 100)
|
||||
private String remarks;
|
||||
|
||||
/**
|
||||
* 分配日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Column(name = "create_date", nullable = true)
|
||||
private Date createDate;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@Column(name = "create_time", nullable = true)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 获取ID
|
||||
*
|
||||
* @return ID
|
||||
*/
|
||||
public Integer getNotesId() {
|
||||
return this.notesId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置ID
|
||||
*
|
||||
* @param notesId ID
|
||||
*/
|
||||
public void setNotesId(Integer notesId) {
|
||||
this.notesId = notesId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取升级版本
|
||||
*
|
||||
* @return 升级版本
|
||||
*/
|
||||
public Integer getUpgradeVersion() {
|
||||
return this.upgradeVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置升级版本
|
||||
*
|
||||
* @param upgradeVersion 升级版本
|
||||
*/
|
||||
public void setUpgradeVersion(Integer upgradeVersion) {
|
||||
this.upgradeVersion = upgradeVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子厂代码
|
||||
*
|
||||
* @return 电子厂代码
|
||||
*/
|
||||
public String getFactoryCode() {
|
||||
return this.factoryCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置电子厂代码
|
||||
*
|
||||
* @param factoryCode 电子厂代码
|
||||
*/
|
||||
public void setFactoryCode(String factoryCode) {
|
||||
this.factoryCode = factoryCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取鱼缸厂代码
|
||||
*
|
||||
* @return 鱼缸厂代码
|
||||
*/
|
||||
public String getBrandCode() {
|
||||
return this.brandCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置鱼缸厂代码
|
||||
*
|
||||
* @param brandCode 鱼缸厂代码
|
||||
*/
|
||||
public void setBrandCode(String brandCode) {
|
||||
this.brandCode = brandCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取硬件型号
|
||||
*
|
||||
* @return 硬件型号
|
||||
*/
|
||||
public String getHardwareType() {
|
||||
return this.hardwareType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置硬件型号
|
||||
*
|
||||
* @param hardwareType 硬件型号
|
||||
*/
|
||||
public void setHardwareType(String hardwareType) {
|
||||
this.hardwareType = hardwareType;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取sdk版本
|
||||
*
|
||||
* @return sdk版本
|
||||
*/
|
||||
public Integer getSdkVersion() {
|
||||
return this.sdkVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置sdk版本
|
||||
*
|
||||
* @param sdkVersion sdk版本
|
||||
*/
|
||||
public void setSdkVersion(Integer sdkVersion) {
|
||||
this.sdkVersion = sdkVersion;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取升级数量
|
||||
*
|
||||
* @return 升级数量
|
||||
*/
|
||||
public Integer getUpgradeNumber() {
|
||||
return this.upgradeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置升级数量
|
||||
*
|
||||
* @param upgradeNumber 升级数量
|
||||
*/
|
||||
public void setUpgradeNumber(Integer upgradeNumber) {
|
||||
this.upgradeNumber = upgradeNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取备注
|
||||
*
|
||||
* @return 备注
|
||||
*/
|
||||
public String getRemarks() {
|
||||
return this.remarks;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置备注
|
||||
*
|
||||
* @param remarks 备注
|
||||
*/
|
||||
public void setRemarks(String remarks) {
|
||||
this.remarks = remarks;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分配日期
|
||||
*
|
||||
* @return 分配日期
|
||||
*/
|
||||
public Date getCreateDate() {
|
||||
return this.createDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置分配日期
|
||||
*
|
||||
* @param createDate 分配日期
|
||||
*/
|
||||
public void setCreateDate(Date createDate) {
|
||||
this.createDate = createDate;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取创建时间
|
||||
*
|
||||
* @return 创建时间
|
||||
*/
|
||||
public Date getCreateTime() {
|
||||
return this.createTime;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置创建时间
|
||||
*
|
||||
* @param createTime 创建时间
|
||||
*/
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
}
|
||||
@@ -8,6 +8,7 @@ package com.ifish.controller;
|
||||
import com.ifish.helper.CameraHelperI;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
@@ -95,4 +96,60 @@ public class Camera {
|
||||
return cameraHelperI.camerauserlistData(cameraId, userId, phoneNumber, showName, isMaster, isActiva, isLive, draw, start, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活码列表页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/activeCodeList"}, method = RequestMethod.GET)
|
||||
public ModelAndView getActiveCodeList() {
|
||||
return cameraHelperI.getActiveCodeList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活码列表页面数据
|
||||
*
|
||||
* @param draw
|
||||
* @param start
|
||||
* @param length
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/activeCodeListData"}, method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object activeCodeListData(String draw, Integer start, Integer length, String activateCode, String pici, String createTime, String isUsed) {
|
||||
return cameraHelperI.activeCodeListData(draw, start, length, activateCode, pici, createTime, isUsed);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成摄像头激活码
|
||||
*
|
||||
* @param batchCode
|
||||
* @param batchNumber
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/createActivaCode"}, method = RequestMethod.POST, produces = " text/html;charset=utf-8")
|
||||
@ResponseBody
|
||||
public Object createActivaCode(String batchCode, Integer batchNumber) {
|
||||
return cameraHelperI.createActivaCode(batchCode, batchNumber);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载摄像头激活码Excel
|
||||
*
|
||||
* @param model
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/downloadActivaCodeExcel", method = RequestMethod.POST)
|
||||
public ModelAndView downloadActivaCodeExcel(ModelMap model, String code, String pici, String createTime, String isUsed) {
|
||||
return cameraHelperI.downloadActivaCodeExcel(model, code, pici, createTime, isUsed);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,12 +6,14 @@
|
||||
package com.ifish.controller;
|
||||
|
||||
import com.ifish.bean.Tbl_Device_User;
|
||||
import com.ifish.bean.Tbl_Upgrade_Notes;
|
||||
import com.ifish.helper.DeviceHelper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -73,4 +75,85 @@ public class Device {
|
||||
public Object deleteCameraUser(Integer userId, String cameraId) {
|
||||
return deviceHelper.bindDevice(userId, cameraId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息列表页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/devicelist"}, method = RequestMethod.GET)
|
||||
public ModelAndView getDevicelist() {
|
||||
return deviceHelper.getDevicelist();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息列表页面数据
|
||||
*
|
||||
* @param draw
|
||||
* @param start
|
||||
* @param length
|
||||
* @param macAddress
|
||||
* @param deviceId
|
||||
* @param sdkVersion
|
||||
* @param upgradeVersion
|
||||
* @param createDate
|
||||
* @param createCode
|
||||
* @param loginTime
|
||||
* @param factoryCode
|
||||
* @param brandCode
|
||||
* @param hardwareType
|
||||
* @param isCharge
|
||||
* @param isBlacklist
|
||||
* @param isUpgrade
|
||||
* @param sortField
|
||||
* @param sortModel
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/devicelistData"}, method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object getDevicelistData(String draw, Integer start, Integer length, String macAddress, String deviceId, String sdkVersion, String upgradeVersion, String createDate, String createCode, String loginTime,
|
||||
String factoryCode, String brandCode, String hardwareType, String isCharge, String isBlacklist, String isUpgrade, String sortField, String sortModel) {
|
||||
return deviceHelper.getDevicelistData(draw, start, length, macAddress, deviceId, sdkVersion, upgradeVersion, createDate, createCode, loginTime, factoryCode, brandCode, hardwareType, isCharge, isBlacklist, isUpgrade, sortField, sortModel);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据设备mac查询设备是否在线
|
||||
*
|
||||
* @param macAddress
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/selectDeviceOnline"}, method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object selectDeviceOnline(String macAddress) {
|
||||
return deviceHelper.selectDeviceOnline(macAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 在线升级SDK
|
||||
*
|
||||
* @param macAddress
|
||||
* @param sdkVersion
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/upgradeSDKOnline"}, method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object upgradeSDKOnline(String macAddress, Integer sdkVersion) {
|
||||
return deviceHelper.upgradeSDKOnline(macAddress, sdkVersion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量升级sdk
|
||||
*
|
||||
* @param factoryCode
|
||||
* @param brandCode
|
||||
* @param hardwareType
|
||||
* @param upgradeVersion
|
||||
* @param sdkVersion
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = {"/upgradeSDKWhenLogin"}, method = RequestMethod.POST)
|
||||
@ResponseBody
|
||||
public Object upgradeSDKWhenLogin(Tbl_Upgrade_Notes tbl_Upgrade_Notes) {
|
||||
return deviceHelper.upgradeSDKWhenLogin(tbl_Upgrade_Notes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,8 +5,11 @@
|
||||
*/
|
||||
package com.ifish.helper;
|
||||
|
||||
import com.ifish.API.DownloadExcel;
|
||||
import com.ifish.bean.Tbl_Activa_Code;
|
||||
import com.ifish.bean.Tbl_Device;
|
||||
import com.ifish.mapper.Tbl_Camera_List_Mapper;
|
||||
import com.ifish.mapper.Tbl_Device_Mapper;
|
||||
import com.ifish.util.IfishUtil;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
@@ -15,6 +18,7 @@ import java.util.Map;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
@@ -27,6 +31,9 @@ public class CameraHelper implements CameraHelperI {
|
||||
@Autowired
|
||||
private Tbl_Camera_List_Mapper tbl_Camera_List_Mapper;
|
||||
|
||||
@Autowired
|
||||
private Tbl_Device_Mapper tbl_Device_Mapper;
|
||||
|
||||
@Autowired
|
||||
private DeviceHelperI deviceHelperI;
|
||||
|
||||
@@ -111,6 +118,7 @@ public class CameraHelper implements CameraHelperI {
|
||||
if (i > 0) {
|
||||
int j = tbl_Camera_List_Mapper.activateCamera(activateCode, cameraId);
|
||||
if (j > 0) {
|
||||
tbl_Device_Mapper.updateTblActivaCodeIsUse(activateCode);
|
||||
return "成功";
|
||||
}
|
||||
}
|
||||
@@ -191,4 +199,112 @@ public class CameraHelper implements CameraHelperI {
|
||||
map.put("recordsFiltered", count);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活码列表页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ModelAndView getActiveCodeList() {
|
||||
ModelAndView mv = new ModelAndView();
|
||||
mv.setViewName("activaCode");
|
||||
mv.addObject("pagetitle", "激活码列表");
|
||||
mv.addObject("title", "激活码列表");
|
||||
mv.addObject("myjs", "<!-- Other plugins ( load only nessesary plugins for every page) -->\n"
|
||||
+ " <script src=\"static/assets/plugins/core/moment/moment.min.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/charts/sparklines/jquery.sparkline.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/charts/pie-chart/jquery.easy-pie-chart.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/forms/icheck/jquery.icheck.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/forms/tags/jquery.tagsinput.min.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/forms/tinymce/tinymce.min.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/tables/jquery.dataTables.js\"></script>\n"
|
||||
+ "<link href=\"static/assets/plugins/tables/jquery.dataTables.css\" rel=\"stylesheet\">"
|
||||
+ "<link href=\"static/assets/plugins/tables/dataTables.bootstrap.css\" rel=\"stylesheet\">"
|
||||
+ " <script src=\"static/assets/plugins/tables/dataTables.bootstrap.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/misc/highlight/highlight.pack.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/misc/countTo/jquery.countTo.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/js/jquery.sprFlat.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/js/app.js\"></script>");
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 激活码列表页面数据
|
||||
*
|
||||
* @param draw
|
||||
* @param start
|
||||
* @param length
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object activeCodeListData(String draw, Integer start, Integer length, String code, String pici, String createTime, String isUsed) {
|
||||
List<Map> list = tbl_Camera_List_Mapper.getActiveCodeListData(start, length, code, pici, createTime, isUsed);
|
||||
for (Map map : list) {
|
||||
String date2 = IfishUtil.format((Date) map.get("createTime"));
|
||||
map.put("createTime", date2);
|
||||
}
|
||||
Integer allCount = tbl_Camera_List_Mapper.getAllactivaCodeCount();
|
||||
Integer count = 0;
|
||||
if (StringUtils.isBlank(code) && StringUtils.isBlank(pici) && StringUtils.isBlank(createTime) && StringUtils.isBlank(isUsed)) {
|
||||
count = allCount;
|
||||
} else {
|
||||
count = tbl_Camera_List_Mapper.getActiveCodeListCountBySelect(code, pici, createTime, isUsed);
|
||||
}
|
||||
|
||||
Map map = new HashMap();
|
||||
map.put("data", list);
|
||||
map.put("draw", draw);
|
||||
map.put("recordsTotal", allCount);
|
||||
map.put("recordsFiltered", count);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量生成激活码
|
||||
*
|
||||
* @param batchCode
|
||||
* @param batchNumber
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object createActivaCode(String batchCode, Integer batchNumber) {
|
||||
try {
|
||||
if (batchNumber != null) {
|
||||
for (int i = 0; i < batchNumber; i++) {
|
||||
Tbl_Activa_Code tbl_Activa_Code = new Tbl_Activa_Code();
|
||||
tbl_Activa_Code.setBatchCode(batchCode);
|
||||
tbl_Camera_List_Mapper.insertActivaCode(tbl_Activa_Code);
|
||||
}
|
||||
return "成功";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return batchNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载摄像头激活码Excel
|
||||
*
|
||||
* @param model
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
public ModelAndView downloadActivaCodeExcel(ModelMap model, String code, String pici, String createTime, String isUsed) {
|
||||
try {
|
||||
List<Tbl_Activa_Code> list = tbl_Camera_List_Mapper.getTbl_Activa_Codes(code, pici, createTime, isUsed);
|
||||
model.put("list", list);
|
||||
DownloadExcel excel = new DownloadExcel();
|
||||
return new ModelAndView(excel, model);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*/
|
||||
package com.ifish.helper;
|
||||
|
||||
import org.springframework.ui.ModelMap;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
@@ -67,4 +68,45 @@ public interface CameraHelperI {
|
||||
*/
|
||||
public Object camerauserlistData(String cameraId, String userId, String phoneNumber, String showName, String isMaster, String isActiva, String isLive, String draw, Integer start, Integer length);
|
||||
|
||||
/**
|
||||
* 激活码列表页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ModelAndView getActiveCodeList();
|
||||
|
||||
/**
|
||||
* 激活码列表页面数据
|
||||
*
|
||||
* @param draw
|
||||
* @param start
|
||||
* @param length
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
public Object activeCodeListData(String draw, Integer start, Integer length, String code, String pici, String createTime, String isUsed);
|
||||
|
||||
/**
|
||||
* 批量生成激活码
|
||||
*
|
||||
* @param batchCode
|
||||
* @param batchNumber
|
||||
* @return
|
||||
*/
|
||||
public Object createActivaCode(String batchCode, Integer batchNumber);
|
||||
|
||||
/**
|
||||
* 下载摄像头激活码Excel
|
||||
*
|
||||
* @param model
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
public ModelAndView downloadActivaCodeExcel(ModelMap model, String code, String pici, String createTime, String isUsed);
|
||||
}
|
||||
|
||||
@@ -5,17 +5,23 @@
|
||||
*/
|
||||
package com.ifish.helper;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.ifish.API.JiGuangPush;
|
||||
import com.ifish.bean.Tbl_Activa_Code;
|
||||
import com.ifish.bean.Tbl_Device;
|
||||
import com.ifish.bean.Tbl_Device_Statistics;
|
||||
import com.ifish.bean.Tbl_Device_User;
|
||||
import com.ifish.bean.Tbl_HardWare_Type;
|
||||
import com.ifish.bean.Tbl_Push_List;
|
||||
import com.ifish.bean.Tbl_Upgrade_Notes;
|
||||
import com.ifish.bean.Tbl_User;
|
||||
import com.ifish.enums.PushTypeEnum;
|
||||
import com.ifish.enums.ResultEnum;
|
||||
import com.ifish.mapper.Tbl_Device_Mapper;
|
||||
import com.ifish.mapper.Tbl_Factory_List_Mapper;
|
||||
import com.ifish.util.IfishUtil;
|
||||
import com.ifish.webservice.MyService;
|
||||
import com.ifish.webservice.MyServiceService;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -23,6 +29,7 @@ import java.util.Map;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -49,6 +56,9 @@ public class DeviceHelper implements DeviceHelperI {
|
||||
@Autowired
|
||||
private PushMessageHelperI pushMessageHelperI;
|
||||
|
||||
@Autowired
|
||||
private Tbl_Factory_List_Mapper tbl_Factory_List_Mapper;
|
||||
|
||||
/**
|
||||
* 根据用户Id获取绑定设备集合
|
||||
*
|
||||
@@ -665,4 +675,189 @@ public class DeviceHelper implements DeviceHelperI {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息列表页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ModelAndView getDevicelist() {
|
||||
ModelAndView mv = new ModelAndView();
|
||||
mv.setViewName("devicelist");
|
||||
mv.addObject("pagetitle", "设备信息");
|
||||
mv.addObject("title", "设备信息");
|
||||
List<Map> list = tbl_Factory_List_Mapper.getFactoryListData(0, 1000);
|
||||
mv.addObject("factorylist", list);
|
||||
List<Map> list1 = tbl_Factory_List_Mapper.getAllVenderList();
|
||||
mv.addObject("venderlist", list1);
|
||||
List<Tbl_HardWare_Type> hardWare_Types = tbl_Factory_List_Mapper.getAllHardWare_TypeList();
|
||||
mv.addObject("hardWare_Types", hardWare_Types);
|
||||
|
||||
mv.addObject("myjs", "<!-- Other plugins ( load only nessesary plugins for every page) -->\n"
|
||||
+ " <script src=\"static/assets/plugins/core/moment/moment.min.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/charts/sparklines/jquery.sparkline.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/charts/pie-chart/jquery.easy-pie-chart.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/forms/icheck/jquery.icheck.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/forms/tags/jquery.tagsinput.min.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/forms/tinymce/tinymce.min.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/tables/jquery.dataTables.js\"></script>\n"
|
||||
+ "<link href=\"static/assets/plugins/tables/jquery.dataTables.css\" rel=\"stylesheet\">"
|
||||
+ "<link href=\"static/assets/plugins/tables/dataTables.bootstrap.css\" rel=\"stylesheet\">"
|
||||
+ " <script src=\"static/assets/plugins/tables/dataTables.bootstrap.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/misc/highlight/highlight.pack.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/plugins/misc/countTo/jquery.countTo.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/js/jquery.sprFlat.js\"></script>\n"
|
||||
+ " <script src=\"static/assets/js/app.js\"></script>");
|
||||
return mv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息列表页面数据
|
||||
*
|
||||
* @param draw
|
||||
* @param start
|
||||
* @param length
|
||||
* @param macAddress
|
||||
* @param deviceId
|
||||
* @param sdkVersion
|
||||
* @param upgradeVersion
|
||||
* @param createDate
|
||||
* @param createCode
|
||||
* @param loginTime
|
||||
* @param factoryCode
|
||||
* @param brandCode
|
||||
* @param hardwareType
|
||||
* @param isCharge
|
||||
* @param isBlacklist
|
||||
* @param isUpgrade
|
||||
* @param sortField
|
||||
* @param sortModel
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object getDevicelistData(String draw, Integer start, Integer length, String macAddress, String deviceId, String sdkVersion, String upgradeVersion, String createDate, String createCode, String loginTime,
|
||||
String factoryCode, String brandCode, String hardwareType, String isCharge, String isBlacklist, String isUpgrade, String sortField, String sortModel) {
|
||||
List<Map> list = tbl_Device_Mapper.getDeviceListData(start, length, macAddress, deviceId, sdkVersion, upgradeVersion, createDate, createCode, loginTime, factoryCode, brandCode, hardwareType, isCharge, isBlacklist, isUpgrade, sortField, sortModel);
|
||||
|
||||
for (Map map : list) {
|
||||
if (map.get("sdkTime") != null) {
|
||||
String date = IfishUtil.format((Date) map.get("sdkTime"));
|
||||
map.put("sdkTime", date);
|
||||
}
|
||||
|
||||
if (map.get("upgradeTime") != null) {
|
||||
String date2 = IfishUtil.format((Date) map.get("upgradeTime"));
|
||||
map.put("upgradeTime", date2);
|
||||
}
|
||||
|
||||
if (map.get("loginTime") != null) {
|
||||
String date3 = IfishUtil.format((Date) map.get("loginTime"));
|
||||
map.put("loginTime", date3);
|
||||
}
|
||||
|
||||
if (map.get("createDate") != null) {
|
||||
String date4 = IfishUtil.format((Date) map.get("createDate"));
|
||||
map.put("createDate", date4);
|
||||
}
|
||||
|
||||
if (map.get("firstActivate") != null) {
|
||||
String date5 = IfishUtil.format((Date) map.get("firstActivate"));
|
||||
map.put("firstActivate", date5);
|
||||
}
|
||||
|
||||
if (map.get("createTime") != null) {
|
||||
String date6 = IfishUtil.format((Date) map.get("createTime"));
|
||||
map.put("createTime", date6);
|
||||
}
|
||||
|
||||
if (map.get("authorizeTime") != null) {
|
||||
String date7 = IfishUtil.format((Date) map.get("authorizeTime"));
|
||||
map.put("authorizeTime", date7);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Integer allCount = tbl_Device_Mapper.getAllDeviceListDataCount();
|
||||
Integer count = 0;
|
||||
if (StringUtils.isBlank(macAddress) && StringUtils.isBlank(deviceId) && StringUtils.isBlank(sdkVersion) && StringUtils.isBlank(upgradeVersion) && StringUtils.isBlank(createDate)
|
||||
&& StringUtils.isBlank(createCode) && StringUtils.isBlank(loginTime) && StringUtils.isBlank(factoryCode) && StringUtils.isBlank(brandCode) && StringUtils.isBlank(hardwareType)
|
||||
&& StringUtils.isBlank(isCharge) && StringUtils.isBlank(isBlacklist) && StringUtils.isBlank(isUpgrade)) {
|
||||
count = allCount;
|
||||
} else {
|
||||
count = tbl_Device_Mapper.getDeviceListDataCountBySelect(macAddress, deviceId, sdkVersion, upgradeVersion, createDate, createCode, loginTime, factoryCode, brandCode, hardwareType, isCharge, isBlacklist, isUpgrade);
|
||||
}
|
||||
Map map = new HashMap();
|
||||
map.put("data", list);
|
||||
map.put("draw", draw);
|
||||
map.put("recordsTotal", allCount);
|
||||
map.put("recordsFiltered", count);
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询设备是否在线
|
||||
*
|
||||
* @param macAddress
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object selectDeviceOnline(String macAddress) {
|
||||
try {
|
||||
MyService web = new MyServiceService().getMyServicePort();
|
||||
boolean bln = web.deviceIsOnline(macAddress);
|
||||
Integer number = web.getLineDeviceNumber();
|
||||
Map<String, Object> map = new HashMap<String, Object>();
|
||||
map.put("online", bln);
|
||||
map.put("number", number);
|
||||
//json数据
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("map", map);
|
||||
return json.toString();
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 在线升级SDK
|
||||
*
|
||||
* @param macAddress
|
||||
* @param sdkVersion
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object upgradeSDKOnline(String macAddress, Integer sdkVersion) {
|
||||
try {
|
||||
MyService web = new MyServiceService().getMyServicePort();
|
||||
boolean bln = web.onlineUpgrade(macAddress, sdkVersion);
|
||||
if (bln) {
|
||||
return "成功";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return "升级失败";
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量升级SDK
|
||||
*
|
||||
* @param factoryCode
|
||||
* @param brandCode
|
||||
* @param hardwareType
|
||||
* @param upgradeVersion
|
||||
* @param sdkVersion
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Object upgradeSDKWhenLogin(Tbl_Upgrade_Notes tbl_Upgrade_Notes) {
|
||||
try {
|
||||
int number = tbl_Device_Mapper.addUpgradeSDKVersion(tbl_Upgrade_Notes);
|
||||
tbl_Upgrade_Notes.setUpgradeNumber(number);
|
||||
tbl_Device_Mapper.insertTbl_Upgrade_Notes(tbl_Upgrade_Notes);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@ package com.ifish.helper;
|
||||
import com.ifish.bean.Tbl_Device;
|
||||
import com.ifish.bean.Tbl_Device_Statistics;
|
||||
import com.ifish.bean.Tbl_Device_User;
|
||||
import com.ifish.bean.Tbl_Upgrade_Notes;
|
||||
import java.util.List;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -149,4 +151,66 @@ public interface DeviceHelperI {
|
||||
*/
|
||||
Object deleteDeviceUser(Tbl_Device_User deviceUser);
|
||||
|
||||
/**
|
||||
* 设备信息列表页面
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public ModelAndView getDevicelist();
|
||||
|
||||
/**
|
||||
* 设备信息列表页面数据
|
||||
*
|
||||
* @param draw
|
||||
* @param start
|
||||
* @param length
|
||||
* @param macAddress
|
||||
* @param deviceId
|
||||
* @param sdkVersion
|
||||
* @param upgradeVersion
|
||||
* @param createDate
|
||||
* @param createCode
|
||||
* @param loginTime
|
||||
* @param factoryCode
|
||||
* @param brandCode
|
||||
* @param hardwareType
|
||||
* @param isCharge
|
||||
* @param isBlacklist
|
||||
* @param isUpgrade
|
||||
* @param sortField
|
||||
* @param sortModel
|
||||
* @return
|
||||
*/
|
||||
public Object getDevicelistData(String draw, Integer start, Integer length, String macAddress, String deviceId, String sdkVersion, String upgradeVersion, String createDate, String createCode, String loginTime,
|
||||
String factoryCode, String brandCode, String hardwareType, String isCharge, String isBlacklist, String isUpgrade, String sortField, String sortModel);
|
||||
|
||||
/**
|
||||
* 查询设备是否在线
|
||||
*
|
||||
* @param macAddress
|
||||
* @return
|
||||
*/
|
||||
public Object selectDeviceOnline(String macAddress);
|
||||
|
||||
/**
|
||||
* 在线升级SDK
|
||||
*
|
||||
* @param macAddress
|
||||
* @param sdkVersion
|
||||
* @return
|
||||
*/
|
||||
public Object upgradeSDKOnline(String macAddress, Integer sdkVersion);
|
||||
|
||||
/**
|
||||
* 批量升级SDK
|
||||
*
|
||||
* @param factoryCode
|
||||
* @param brandCode
|
||||
* @param hardwareType
|
||||
* @param upgradeVersion
|
||||
* @param sdkVersion
|
||||
* @return
|
||||
*/
|
||||
public Object upgradeSDKWhenLogin(Tbl_Upgrade_Notes tbl_Upgrade_Notes);
|
||||
|
||||
}
|
||||
|
||||
@@ -5,10 +5,13 @@
|
||||
*/
|
||||
package com.ifish.mapper;
|
||||
|
||||
import com.ifish.bean.Tbl_Activa_Code;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.SelectKey;
|
||||
import org.apache.ibatis.annotations.SelectProvider;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
|
||||
@@ -107,4 +110,62 @@ public interface Tbl_Camera_List_Mapper {
|
||||
*/
|
||||
@Select("SELECT count(1) from tbl_device d LEFT JOIN tbl_device_user du ON d.device_id = du.device_id LEFT JOIN tbl_user u ON du.user_id = u.user_id WHERE d.is_camera = '1'")
|
||||
Integer getAllCameraUserListDataCount();
|
||||
|
||||
/**
|
||||
* 据条件分页获取激活码列表数据
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
@SelectProvider(type = Tbl_Camera_List_MapperSql.class, method = "getActiveCodeListData")
|
||||
List<Map> getActiveCodeListData(Integer start, Integer length, String code, @Param("pici") String pici, @Param("createTime") String createTime, @Param("isUsed") String isUsed);
|
||||
|
||||
/**
|
||||
* 根据条件(不分页,Excel下载使用)获取激活码列表
|
||||
*
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
@SelectProvider(type = Tbl_Camera_List_MapperSql.class, method = "getTbl_Activa_Codes")
|
||||
List<Tbl_Activa_Code> getTbl_Activa_Codes(String code, @Param("pici") String pici, @Param("createTime") String createTime, @Param("isUsed") String isUsed);
|
||||
|
||||
/**
|
||||
* 据条件获取激活码列表数据数量
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
@SelectProvider(type = Tbl_Camera_List_MapperSql.class, method = "getActiveCodeListCountBySelect")
|
||||
Integer getActiveCodeListCountBySelect(String code, @Param("pici") String pici, @Param("createTime") String createTime, @Param("isUsed") String isUsed);
|
||||
|
||||
/**
|
||||
* 获取所有激活码数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Select("SELECT COUNT(1) FROM tbl_activa_code ")
|
||||
Integer getAllactivaCodeCount();
|
||||
|
||||
/**
|
||||
* 创建一个摄像头激活码
|
||||
*
|
||||
* @param tbl_Activa_Code
|
||||
* @return
|
||||
*/
|
||||
@Insert("INSERT INTO tbl_activa_code(active_code,batch_code,is_used,create_time) VALUES (#{activaCode.activeCode},#{activaCode.batchCode},'0',NOW())")
|
||||
@SelectKey(statement = "select replace(uuid(),'-','')", keyProperty = "activaCode.activeCode", keyColumn = "active_code", before = true, resultType = String.class)
|
||||
Integer insertActivaCode(@Param("activaCode") Tbl_Activa_Code tbl_Activa_Code);
|
||||
}
|
||||
|
||||
@@ -175,4 +175,96 @@ public class Tbl_Camera_List_MapperSql {
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 据条件获取激活码列表数据
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
public String getActiveCodeListData(Integer start, Integer length, String code, @Param("pici") String pici, @Param("createTime") String createTime, @Param("isUsed") String isUsed) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("SELECT active_code activeCode,batch_code batchCode,is_used isUsed,create_time createTime from tbl_activa_code WHERE 1=1 ");
|
||||
if (StringUtils.isNotBlank(code)) {
|
||||
sb.append(" and active_code like '%").append(code).append("%'");
|
||||
}
|
||||
if (StringUtils.isNotBlank(pici)) {
|
||||
sb.append(" and batch_code = #{pici}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(createTime)) {
|
||||
sb.append(" and #{createTime}=date_format(create_time,'%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(isUsed)) {
|
||||
sb.append(" and is_used = #{isUsed}");
|
||||
}
|
||||
sb.append(" ORDER BY create_time DESC limit ").append(start).append(",").append(length);
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据条件(不分页,Excel下载使用)获取激活码列表
|
||||
*
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
public String getTbl_Activa_Codes(String code, @Param("pici") String pici, @Param("createTime") String createTime, @Param("isUsed") String isUsed) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("select active_code from tbl_activa_code WHERE 1=1 ");
|
||||
if (StringUtils.isNotBlank(code)) {
|
||||
sb.append(" and active_code like '%").append(code).append("%'");
|
||||
}
|
||||
if (StringUtils.isNotBlank(pici)) {
|
||||
sb.append(" and batch_code = #{pici}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(createTime)) {
|
||||
sb.append(" and #{createTime}=date_format(create_time,'%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(isUsed)) {
|
||||
sb.append(" and is_used = #{isUsed}");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 据条件获取激活码列表数据数量
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param code
|
||||
* @param pici
|
||||
* @param createTime
|
||||
* @param isUsed
|
||||
* @return
|
||||
*/
|
||||
public String getActiveCodeListCountBySelect(String code, @Param("pici") String pici, @Param("createTime") String createTime, @Param("isUsed") String isUsed) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append("SELECT count(1) from tbl_activa_code WHERE 1=1 ");
|
||||
if (StringUtils.isNotBlank(code)) {
|
||||
sb.append(" and active_code like '%").append(code).append("%'");
|
||||
}
|
||||
if (StringUtils.isNotBlank(pici)) {
|
||||
sb.append(" and batch_code = #{pici}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(createTime)) {
|
||||
sb.append(" and #{createTime}=date_format(create_time,'%Y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(isUsed)) {
|
||||
sb.append(" and is_used = #{isUsed}");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,9 +9,11 @@ import com.ifish.bean.Tbl_Activa_Code;
|
||||
import com.ifish.bean.Tbl_Device;
|
||||
import com.ifish.bean.Tbl_Device_Statistics;
|
||||
import com.ifish.bean.Tbl_Device_User;
|
||||
import com.ifish.bean.Tbl_Upgrade_Notes;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.InsertProvider;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
@@ -312,4 +314,84 @@ public interface Tbl_Device_Mapper {
|
||||
*/
|
||||
@SelectProvider(type = Tbl_Device_MapperSql.class, method = "getAuthorizationCountByDate")
|
||||
Integer getAuthorizationCountByDate(@Param("createTimeBefore") String createTimeBefore, @Param("createTimeAfter") String createTimeAfter, @Param("factoryCode") String factoryCode);
|
||||
|
||||
/**
|
||||
* 设备信息列表页面数据
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param macAddress
|
||||
* @param deviceId
|
||||
* @param sdkVersion
|
||||
* @param upgradeVersion
|
||||
* @param createDate
|
||||
* @param createCode
|
||||
* @param loginTime
|
||||
* @param factoryCode
|
||||
* @param brandCode
|
||||
* @param hardwareType
|
||||
* @param isCharge
|
||||
* @param isBlacklist
|
||||
* @param isUpgrade
|
||||
* @param sortField
|
||||
* @param sortModel
|
||||
* @return
|
||||
*/
|
||||
@SelectProvider(type = Tbl_Device_MapperSql.class, method = "getDeviceListData")
|
||||
List<Map> getDeviceListData(Integer start, Integer length, String macAddress, @Param("deviceId") String deviceId, @Param("sdkVersion") String sdkVersion, @Param("upgradeVersion") String upgradeVersion,
|
||||
@Param("createDate") String createDate, String createCode, @Param("loginTime") String loginTime, @Param("factoryCode") String factoryCode, @Param("brandCode") String brandCode, @Param("hardwareType") String hardwareType,
|
||||
@Param("isCharge") String isCharge, @Param("isBlacklist") String isBlacklist, @Param("isUpgrade") String isUpgrade, String sortField, String sortModel);
|
||||
|
||||
/**
|
||||
* 设备信息列表页面数据数量
|
||||
*
|
||||
* @param macAddress
|
||||
* @param deviceId
|
||||
* @param sdkVersion
|
||||
* @param upgradeVersion
|
||||
* @param createDate
|
||||
* @param createCode
|
||||
* @param loginTime
|
||||
* @param factoryCode
|
||||
* @param brandCode
|
||||
* @param hardwareType
|
||||
* @param isCharge
|
||||
* @param isBlacklist
|
||||
* @param isUpgrade
|
||||
* @return
|
||||
*/
|
||||
@SelectProvider(type = Tbl_Device_MapperSql.class, method = "getDeviceListDataCountBySelect")
|
||||
Integer getDeviceListDataCountBySelect(String macAddress, @Param("deviceId") String deviceId, @Param("sdkVersion") String sdkVersion, @Param("upgradeVersion") String upgradeVersion,
|
||||
@Param("createDate") String createDate, String createCode, @Param("loginTime") String loginTime, @Param("factoryCode") String factoryCode, @Param("brandCode") String brandCode, @Param("hardwareType") String hardwareType,
|
||||
@Param("isCharge") String isCharge, @Param("isBlacklist") String isBlacklist, @Param("isUpgrade") String isUpgrade);
|
||||
|
||||
/**
|
||||
* 设备信息列表页面数据总数量
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Select(" select count(1) from tbl_device d where d.is_camera = '0'")
|
||||
Integer getAllDeviceListDataCount();
|
||||
|
||||
/**
|
||||
* 添加自动升级任务
|
||||
*
|
||||
* @param tbl_Upgrade_Notes
|
||||
* @return
|
||||
*/
|
||||
@Select("update tbl_device SET is_upgrade=1,upgrade_version=#{upgrade.upgradeVersion} where IF(#{upgrade.factoryCode} != '', factory_code=#{upgrade.factoryCode}, true) and IF(#{upgrade.brandCode} != '', brand_code=#{upgrade.brandCode}, true) and"
|
||||
+ " IF(#{upgrade.hardWareType} != '', hardware_type=#{upgrade.hardWareType}, true) and IF(#{upgrade.sdkVersion} != -1, sdk_version=#{upgrade.sdkVersion}, true)")
|
||||
Integer addUpgradeSDKVersion(@Param("upgrade") Tbl_Upgrade_Notes tbl_Upgrade_Notes);
|
||||
|
||||
/**
|
||||
* 保存自动升级任务记录日志
|
||||
*
|
||||
* @param tbl_Upgrade_Notes
|
||||
* @return
|
||||
*/
|
||||
@Insert("INSERT INTO tbl_upgrade_notes(`upgrade_version`, `factory_code`, `brand_code`, `hardware_type`, `sdk_version`, `upgrade_number`, `remarks`, `create_date`, `create_time`) "
|
||||
+ "VALUES "
|
||||
+ " (#{upgrade.upgradeVersion}, #{upgrade.factoryCode},#{upgrade.brandCode}, #{upgrade.hardwareType},#{upgrade.sdkVersion},#{upgrade.upgradeNumber},#{upgrade.remarks},#{upgrade.createDate},#{upgrade.createTime});")
|
||||
@SelectKey(statement = "select @@IDENTITY as notes_id", keyProperty = "upgrade.notesId", keyColumn = "notes_id", before = false, resultType = int.class)
|
||||
Integer insertTbl_Upgrade_Notes(@Param("upgrade") Tbl_Upgrade_Notes tbl_Upgrade_Notes);
|
||||
}
|
||||
|
||||
@@ -500,4 +500,144 @@ public class Tbl_Device_MapperSql {
|
||||
sb.append(" AND d.factory_code= #{factoryCode} AND date_format(ts.authorize_time,'%Y-%m-%d') BETWEEN #{createTimeBefore} AND #{createTimeAfter} ");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设备信息列表页面数据
|
||||
*
|
||||
* @param start
|
||||
* @param length
|
||||
* @param macAddress
|
||||
* @param deviceId
|
||||
* @param sdkVersion
|
||||
* @param upgradeVersion
|
||||
* @param createDate
|
||||
* @param createCode
|
||||
* @param loginTime
|
||||
* @param factoryCode
|
||||
* @param brandCode
|
||||
* @param hardwareType
|
||||
* @param isCharge
|
||||
* @param isBlacklist
|
||||
* @param isUpgrade
|
||||
* @param sortField
|
||||
* @param sortModel
|
||||
* @return
|
||||
*/
|
||||
public String getDeviceListData(Integer start, Integer length, String macAddress, @Param("deviceId") String deviceId, @Param("sdkVersion") String sdkVersion, @Param("upgradeVersion") String upgradeVersion,
|
||||
@Param("createDate") String createDate, String createCode, @Param("loginTime") String loginTime, @Param("factoryCode") String factoryCode, @Param("brandCode") String brandCode, @Param("hardwareType") String hardwareType,
|
||||
@Param("isCharge") String isCharge, @Param("isBlacklist") String isBlacklist, @Param("isUpgrade") String isUpgrade, String sortField, String sortModel) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.append(" select d.device_id deviceId,d.mac_address macAddress,f.factory_name factoryName,v.brand_name brandName,h.hardware_name hardWareName,d.on_off onOff,d.water_remind waterRemind,ds.sdk_version sdkVersion,");
|
||||
sb.append("ds.sdk_time sdkTime,ds.upgrade_time upgradeTime,");
|
||||
sb.append(" ds.is_upgrade isUpgrade,ds.upgrade_version upgradeVersion,ds.login_count loginCount,ds.login_time loginTime,ds.create_date createDate,ds.create_code createCode,ds.first_activate firstActivate,");
|
||||
sb.append(" ds.create_time createTime,ds.MCU_count mcuCount,ds.module_count moduleCount,ds.router_count routerCount,ds.server_count serverCount,ds.server_try_count serverTryCount,ds.is_charge isCharge,");
|
||||
sb.append(" d.is_blacklist isBlacklist,ds.authorize_time authorizeTime");
|
||||
sb.append(" from tbl_device d");
|
||||
sb.append(" LEFT JOIN tbl_factory_list f ON d.factory_code = f.factory_code");
|
||||
sb.append(" LEFT JOIN tbl_vender_list v ON d.brand_code = v.brand_code");
|
||||
sb.append(" LEFT JOIN tbl_hardware_type h ON d.hardware_type = h.hardware_type");
|
||||
sb.append(" LEFT JOIN tbl_device_statistics ds ON d.device_id = ds.device_id where d.is_camera = '0' ");
|
||||
if (StringUtils.isNotBlank(macAddress)) {
|
||||
sb.append(" and d.mac_address like '%").append(macAddress).append('%');
|
||||
}
|
||||
if (StringUtils.isNotBlank(deviceId)) {
|
||||
sb.append(" and d.device_id = #{deviceId}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(sdkVersion)) {
|
||||
sb.append(" and ds.sdk_version = #{sdkVersion}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(upgradeVersion)) {
|
||||
sb.append(" and ds.upgrade_version = #{upgradeVersion}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(createDate)) {
|
||||
sb.append(" and #{createDate} = date_format(ds.create_date,'%y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(createCode)) {
|
||||
sb.append(" and ds.create_code like '%").append(createCode).append("%;");
|
||||
}
|
||||
if (StringUtils.isNotBlank(loginTime)) {
|
||||
sb.append(" and #{loginTime} = date_format(ds.login_time,'%y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(factoryCode)) {
|
||||
sb.append(" and d.factory_code = #{factoryCode}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(brandCode)) {
|
||||
sb.append(" and d.brand_code = #{brandCode}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(hardwareType)) {
|
||||
sb.append(" and d.hardware_type = #{hardwareType}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(isCharge)) {
|
||||
sb.append(" and ds.is_charge = #{isCharge}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(isBlacklist)) {
|
||||
sb.append(" and d.is_blacklist = #{isBlacklist}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(isUpgrade)) {
|
||||
sb.append(" and ds.is_upgrade = #{isUpgrade}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(sortField)) {
|
||||
sb.append(" ORDER BY " + sortField);
|
||||
} else {
|
||||
sb.append(" ORDER BY d.device_id ");
|
||||
}
|
||||
if (StringUtils.isNotBlank(sortModel)) {
|
||||
sb.append(sortModel);
|
||||
}
|
||||
sb.append(" limit ").append(start).append(",").append(length);
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public String getDeviceListDataCountBySelect(String macAddress, @Param("deviceId") String deviceId, @Param("sdkVersion") String sdkVersion, @Param("upgradeVersion") String upgradeVersion,
|
||||
@Param("createDate") String createDate, String createCode, @Param("loginTime") String loginTime, @Param("factoryCode") String factoryCode, @Param("brandCode") String brandCode, @Param("hardwareType") String hardwareType,
|
||||
@Param("isCharge") String isCharge, @Param("isBlacklist") String isBlacklist, @Param("isUpgrade") String isUpgrade) {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(" select count(1) from tbl_device d");
|
||||
sb.append(" LEFT JOIN tbl_factory_list f ON d.factory_code = f.factory_code");
|
||||
sb.append(" LEFT JOIN tbl_vender_list v ON d.brand_code = v.brand_code");
|
||||
sb.append(" LEFT JOIN tbl_hardware_type h ON d.hardware_type = h.hardware_type");
|
||||
sb.append(" LEFT JOIN tbl_device_statistics ds ON d.device_id = ds.device_id where d.is_camera = '0' ");
|
||||
if (StringUtils.isNotBlank(macAddress)) {
|
||||
sb.append(" and d.mac_address like '%").append(macAddress).append('%');
|
||||
}
|
||||
if (StringUtils.isNotBlank(deviceId)) {
|
||||
sb.append(" and d.device_id = #{deviceId}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(sdkVersion)) {
|
||||
sb.append(" and ds.sdk_version = #{sdkVersion}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(upgradeVersion)) {
|
||||
sb.append(" and ds.upgrade_version = #{upgradeVersion}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(createDate)) {
|
||||
sb.append(" and #{createDate} = date_format(ds.create_date,'%y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(createCode)) {
|
||||
sb.append(" and ds.create_code like '%").append(createCode).append("%;");
|
||||
}
|
||||
if (StringUtils.isNotBlank(loginTime)) {
|
||||
sb.append(" and #{loginTime} = date_format(ds.login_time,'%y-%m-%d')");
|
||||
}
|
||||
if (StringUtils.isNotBlank(factoryCode)) {
|
||||
sb.append(" and d.factory_code = #{factoryCode}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(brandCode)) {
|
||||
sb.append(" and d.brand_code = #{brandCode}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(hardwareType)) {
|
||||
sb.append(" and d.hardware_type = #{hardwareType}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(isCharge)) {
|
||||
sb.append(" and ds.is_charge = #{isCharge}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(isBlacklist)) {
|
||||
sb.append(" and d.is_blacklist = #{isBlacklist}");
|
||||
}
|
||||
if (StringUtils.isNotBlank(isUpgrade)) {
|
||||
sb.append(" and ds.is_upgrade = #{isUpgrade}");
|
||||
}
|
||||
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
|
||||
package com.ifish.webservice;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for deviceIsOnline complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="deviceIsOnline">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="arg0" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "deviceIsOnline", propOrder = {
|
||||
"arg0"
|
||||
})
|
||||
public class DeviceIsOnline {
|
||||
|
||||
protected String arg0;
|
||||
|
||||
/**
|
||||
* Gets the value of the arg0 property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getArg0() {
|
||||
return arg0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the arg0 property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setArg0(String value) {
|
||||
this.arg0 = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
package com.ifish.webservice;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for deviceIsOnlineResponse complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="deviceIsOnlineResponse">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="return" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "deviceIsOnlineResponse", propOrder = {
|
||||
"_return"
|
||||
})
|
||||
public class DeviceIsOnlineResponse {
|
||||
|
||||
@XmlElement(name = "return")
|
||||
protected boolean _return;
|
||||
|
||||
/**
|
||||
* Gets the value of the return property.
|
||||
*
|
||||
*/
|
||||
public boolean isReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the return property.
|
||||
*
|
||||
*/
|
||||
public void setReturn(boolean value) {
|
||||
this._return = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
|
||||
package com.ifish.webservice;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for getLineDeviceNumber complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="getLineDeviceNumber">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "getLineDeviceNumber")
|
||||
public class GetLineDeviceNumber {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
|
||||
package com.ifish.webservice;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for getLineDeviceNumberResponse complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="getLineDeviceNumberResponse">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="return" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "getLineDeviceNumberResponse", propOrder = {
|
||||
"_return"
|
||||
})
|
||||
public class GetLineDeviceNumberResponse {
|
||||
|
||||
@XmlElement(name = "return")
|
||||
protected Integer _return;
|
||||
|
||||
/**
|
||||
* Gets the value of the return property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the return property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public void setReturn(Integer value) {
|
||||
this._return = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.ifish.webservice;
|
||||
|
||||
import javax.jws.WebMethod;
|
||||
import javax.jws.WebParam;
|
||||
import javax.jws.WebResult;
|
||||
import javax.jws.WebService;
|
||||
import javax.xml.bind.annotation.XmlSeeAlso;
|
||||
import javax.xml.ws.Action;
|
||||
import javax.xml.ws.RequestWrapper;
|
||||
import javax.xml.ws.ResponseWrapper;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@WebService(name = "MyService", targetNamespace = "http://webService.socket.ifish.com/")
|
||||
@XmlSeeAlso({
|
||||
ObjectFactory.class
|
||||
})
|
||||
public interface MyService {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param arg1
|
||||
* @param arg0
|
||||
* @return returns boolean
|
||||
*/
|
||||
@WebMethod
|
||||
@WebResult(targetNamespace = "")
|
||||
@RequestWrapper(localName = "onlineUpgrade", targetNamespace = "http://webService.socket.ifish.com/", className = "com.ifish.socket.webService.OnlineUpgrade")
|
||||
@ResponseWrapper(localName = "onlineUpgradeResponse", targetNamespace = "http://webService.socket.ifish.com/", className = "com.ifish.socket.webService.OnlineUpgradeResponse")
|
||||
@Action(input = "http://webService.socket.ifish.com/MyService/onlineUpgradeRequest", output = "http://webService.socket.ifish.com/MyService/onlineUpgradeResponse")
|
||||
public boolean onlineUpgrade(
|
||||
@WebParam(name = "arg0", targetNamespace = "") String arg0,
|
||||
@WebParam(name = "arg1", targetNamespace = "") Integer arg1);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param arg0
|
||||
* @return returns boolean
|
||||
*/
|
||||
@WebMethod
|
||||
@WebResult(targetNamespace = "")
|
||||
@RequestWrapper(localName = "deviceIsOnline", targetNamespace = "http://webService.socket.ifish.com/", className = "com.ifish.socket.webService.DeviceIsOnline")
|
||||
@ResponseWrapper(localName = "deviceIsOnlineResponse", targetNamespace = "http://webService.socket.ifish.com/", className = "com.ifish.socket.webService.DeviceIsOnlineResponse")
|
||||
@Action(input = "http://webService.socket.ifish.com/MyService/deviceIsOnlineRequest", output = "http://webService.socket.ifish.com/MyService/deviceIsOnlineResponse")
|
||||
public boolean deviceIsOnline(
|
||||
@WebParam(name = "arg0", targetNamespace = "") String arg0);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return returns java.lang.Integer
|
||||
*/
|
||||
@WebMethod
|
||||
@WebResult(targetNamespace = "")
|
||||
@RequestWrapper(localName = "getLineDeviceNumber", targetNamespace = "http://webService.socket.ifish.com/", className = "com.ifish.socket.webService.GetLineDeviceNumber")
|
||||
@ResponseWrapper(localName = "getLineDeviceNumberResponse", targetNamespace = "http://webService.socket.ifish.com/", className = "com.ifish.socket.webService.GetLineDeviceNumberResponse")
|
||||
@Action(input = "http://webService.socket.ifish.com/MyService/getLineDeviceNumberRequest", output = "http://webService.socket.ifish.com/MyService/getLineDeviceNumberResponse")
|
||||
public Integer getLineDeviceNumber();
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.ifish.webservice;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import javax.xml.namespace.QName;
|
||||
import javax.xml.ws.Service;
|
||||
import javax.xml.ws.WebEndpoint;
|
||||
import javax.xml.ws.WebServiceClient;
|
||||
import javax.xml.ws.WebServiceException;
|
||||
import javax.xml.ws.WebServiceFeature;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@WebServiceClient(name = "MyServiceService", targetNamespace = "http://webService.socket.ifish.com/", wsdlLocation = "http://localhost:9002/Service/webService?wsdl")
|
||||
public class MyServiceService extends Service {
|
||||
|
||||
private final static URL MYSERVICESERVICE_WSDL_LOCATION;
|
||||
private final static WebServiceException MYSERVICESERVICE_EXCEPTION;
|
||||
private final static QName MYSERVICESERVICE_QNAME = new QName("http://webService.socket.ifish.com/", "MyServiceService");
|
||||
|
||||
static {
|
||||
URL url = null;
|
||||
WebServiceException e = null;
|
||||
try {
|
||||
url = new URL("http://localhost:9002/Service/webService?wsdl");
|
||||
} catch (MalformedURLException ex) {
|
||||
e = new WebServiceException(ex);
|
||||
}
|
||||
MYSERVICESERVICE_WSDL_LOCATION = url;
|
||||
MYSERVICESERVICE_EXCEPTION = e;
|
||||
}
|
||||
|
||||
public MyServiceService() {
|
||||
super(__getWsdlLocation(), MYSERVICESERVICE_QNAME);
|
||||
}
|
||||
|
||||
public MyServiceService(WebServiceFeature... features) {
|
||||
super(__getWsdlLocation(), MYSERVICESERVICE_QNAME, features);
|
||||
}
|
||||
|
||||
public MyServiceService(URL wsdlLocation) {
|
||||
super(wsdlLocation, MYSERVICESERVICE_QNAME);
|
||||
}
|
||||
|
||||
public MyServiceService(URL wsdlLocation, WebServiceFeature... features) {
|
||||
super(wsdlLocation, MYSERVICESERVICE_QNAME, features);
|
||||
}
|
||||
|
||||
public MyServiceService(URL wsdlLocation, QName serviceName) {
|
||||
super(wsdlLocation, serviceName);
|
||||
}
|
||||
|
||||
public MyServiceService(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
|
||||
super(wsdlLocation, serviceName, features);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return returns MyService
|
||||
*/
|
||||
@WebEndpoint(name = "MyServicePort")
|
||||
public MyService getMyServicePort() {
|
||||
return super.getPort(new QName("http://webService.socket.ifish.com/", "MyServicePort"), MyService.class);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param features A list of {@link javax.xml.ws.WebServiceFeature} to
|
||||
* configure on the proxy. Supported features not in the
|
||||
* <code>features</code> parameter will have their default values.
|
||||
* @return returns MyService
|
||||
*/
|
||||
@WebEndpoint(name = "MyServicePort")
|
||||
public MyService getMyServicePort(WebServiceFeature... features) {
|
||||
return super.getPort(new QName("http://webService.socket.ifish.com/", "MyServicePort"), MyService.class, features);
|
||||
}
|
||||
|
||||
private static URL __getWsdlLocation() {
|
||||
if (MYSERVICESERVICE_EXCEPTION != null) {
|
||||
throw MYSERVICESERVICE_EXCEPTION;
|
||||
}
|
||||
return MYSERVICESERVICE_WSDL_LOCATION;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package com.ifish.webservice;
|
||||
|
||||
import javax.xml.bind.JAXBElement;
|
||||
import javax.xml.bind.annotation.XmlElementDecl;
|
||||
import javax.xml.bind.annotation.XmlRegistry;
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
@XmlRegistry
|
||||
public class ObjectFactory {
|
||||
|
||||
private final static QName _OnlineUpgrade_QNAME = new QName("http://webService.socket.ifish.com/", "onlineUpgrade");
|
||||
private final static QName _GetLineDeviceNumberResponse_QNAME = new QName("http://webService.socket.ifish.com/", "getLineDeviceNumberResponse");
|
||||
private final static QName _DeviceIsOnlineResponse_QNAME = new QName("http://webService.socket.ifish.com/", "deviceIsOnlineResponse");
|
||||
private final static QName _OnlineUpgradeResponse_QNAME = new QName("http://webService.socket.ifish.com/", "onlineUpgradeResponse");
|
||||
private final static QName _GetLineDeviceNumber_QNAME = new QName("http://webService.socket.ifish.com/", "getLineDeviceNumber");
|
||||
private final static QName _DeviceIsOnline_QNAME = new QName("http://webService.socket.ifish.com/", "deviceIsOnline");
|
||||
|
||||
/**
|
||||
* Create a new ObjectFactory that can be used to create new instances of
|
||||
* schema derived classes for package: com.ifish.webService
|
||||
*
|
||||
*/
|
||||
public ObjectFactory() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link OnlineUpgrade }
|
||||
*
|
||||
*/
|
||||
public OnlineUpgrade createOnlineUpgrade() {
|
||||
return new OnlineUpgrade();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link DeviceIsOnline }
|
||||
*
|
||||
*/
|
||||
public DeviceIsOnline createDeviceIsOnline() {
|
||||
return new DeviceIsOnline();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link GetLineDeviceNumber }
|
||||
*
|
||||
*/
|
||||
public GetLineDeviceNumber createGetLineDeviceNumber() {
|
||||
return new GetLineDeviceNumber();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link OnlineUpgradeResponse }
|
||||
*
|
||||
*/
|
||||
public OnlineUpgradeResponse createOnlineUpgradeResponse() {
|
||||
return new OnlineUpgradeResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link DeviceIsOnlineResponse }
|
||||
*
|
||||
*/
|
||||
public DeviceIsOnlineResponse createDeviceIsOnlineResponse() {
|
||||
return new DeviceIsOnlineResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of {@link GetLineDeviceNumberResponse }
|
||||
*
|
||||
*/
|
||||
public GetLineDeviceNumberResponse createGetLineDeviceNumberResponse() {
|
||||
return new GetLineDeviceNumberResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of
|
||||
* {@link JAXBElement }{@code <}{@link OnlineUpgrade }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://webService.socket.ifish.com/", name = "onlineUpgrade")
|
||||
public JAXBElement<OnlineUpgrade> createOnlineUpgrade(OnlineUpgrade value) {
|
||||
return new JAXBElement<OnlineUpgrade>(_OnlineUpgrade_QNAME, OnlineUpgrade.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of
|
||||
* {@link JAXBElement }{@code <}{@link GetLineDeviceNumberResponse }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://webService.socket.ifish.com/", name = "getLineDeviceNumberResponse")
|
||||
public JAXBElement<GetLineDeviceNumberResponse> createGetLineDeviceNumberResponse(GetLineDeviceNumberResponse value) {
|
||||
return new JAXBElement<GetLineDeviceNumberResponse>(_GetLineDeviceNumberResponse_QNAME, GetLineDeviceNumberResponse.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of
|
||||
* {@link JAXBElement }{@code <}{@link DeviceIsOnlineResponse }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://webService.socket.ifish.com/", name = "deviceIsOnlineResponse")
|
||||
public JAXBElement<DeviceIsOnlineResponse> createDeviceIsOnlineResponse(DeviceIsOnlineResponse value) {
|
||||
return new JAXBElement<DeviceIsOnlineResponse>(_DeviceIsOnlineResponse_QNAME, DeviceIsOnlineResponse.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of
|
||||
* {@link JAXBElement }{@code <}{@link OnlineUpgradeResponse }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://webService.socket.ifish.com/", name = "onlineUpgradeResponse")
|
||||
public JAXBElement<OnlineUpgradeResponse> createOnlineUpgradeResponse(OnlineUpgradeResponse value) {
|
||||
return new JAXBElement<OnlineUpgradeResponse>(_OnlineUpgradeResponse_QNAME, OnlineUpgradeResponse.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of
|
||||
* {@link JAXBElement }{@code <}{@link GetLineDeviceNumber }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://webService.socket.ifish.com/", name = "getLineDeviceNumber")
|
||||
public JAXBElement<GetLineDeviceNumber> createGetLineDeviceNumber(GetLineDeviceNumber value) {
|
||||
return new JAXBElement<GetLineDeviceNumber>(_GetLineDeviceNumber_QNAME, GetLineDeviceNumber.class, null, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an instance of
|
||||
* {@link JAXBElement }{@code <}{@link DeviceIsOnline }{@code >}}
|
||||
*
|
||||
*/
|
||||
@XmlElementDecl(namespace = "http://webService.socket.ifish.com/", name = "deviceIsOnline")
|
||||
public JAXBElement<DeviceIsOnline> createDeviceIsOnline(DeviceIsOnline value) {
|
||||
return new JAXBElement<DeviceIsOnline>(_DeviceIsOnline_QNAME, DeviceIsOnline.class, null, value);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
|
||||
package com.ifish.webservice;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for onlineUpgrade complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="onlineUpgrade">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="arg0" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
|
||||
* <element name="arg1" type="{http://www.w3.org/2001/XMLSchema}int" minOccurs="0"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "onlineUpgrade", propOrder = {
|
||||
"arg0",
|
||||
"arg1"
|
||||
})
|
||||
public class OnlineUpgrade {
|
||||
|
||||
protected String arg0;
|
||||
protected Integer arg1;
|
||||
|
||||
/**
|
||||
* Gets the value of the arg0 property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public String getArg0() {
|
||||
return arg0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the arg0 property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link String }
|
||||
*
|
||||
*/
|
||||
public void setArg0(String value) {
|
||||
this.arg0 = value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the value of the arg1 property.
|
||||
*
|
||||
* @return
|
||||
* possible object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public Integer getArg1() {
|
||||
return arg1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the arg1 property.
|
||||
*
|
||||
* @param value
|
||||
* allowed object is
|
||||
* {@link Integer }
|
||||
*
|
||||
*/
|
||||
public void setArg1(Integer value) {
|
||||
this.arg1 = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
|
||||
package com.ifish.webservice;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlElement;
|
||||
import javax.xml.bind.annotation.XmlType;
|
||||
|
||||
|
||||
/**
|
||||
* <p>Java class for onlineUpgradeResponse complex type.
|
||||
*
|
||||
* <p>The following schema fragment specifies the expected content contained within this class.
|
||||
*
|
||||
* <pre>
|
||||
* <complexType name="onlineUpgradeResponse">
|
||||
* <complexContent>
|
||||
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
|
||||
* <sequence>
|
||||
* <element name="return" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
|
||||
* </sequence>
|
||||
* </restriction>
|
||||
* </complexContent>
|
||||
* </complexType>
|
||||
* </pre>
|
||||
*
|
||||
*
|
||||
*/
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
@XmlType(name = "onlineUpgradeResponse", propOrder = {
|
||||
"_return"
|
||||
})
|
||||
public class OnlineUpgradeResponse {
|
||||
|
||||
@XmlElement(name = "return")
|
||||
protected boolean _return;
|
||||
|
||||
/**
|
||||
* Gets the value of the return property.
|
||||
*
|
||||
*/
|
||||
public boolean isReturn() {
|
||||
return _return;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the value of the return property.
|
||||
*
|
||||
*/
|
||||
public void setReturn(boolean value) {
|
||||
this._return = value;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -109,14 +109,14 @@
|
||||
</li>
|
||||
<li><a href="camerauserlist"><i class="st-camera"></i> 摄像头绑定</a>
|
||||
</li>
|
||||
<li><a href="form-wizard.html"><i class="im-camera2"></i> 摄像头激活</a>
|
||||
<li><a href="activeCodeList"><i class="im-camera2"></i> 激活码列表</a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"> 设备管理 <i class="im-cogs"></i></a>
|
||||
<ul class="nav sub">
|
||||
<li><a href="forms.html"><i class="im-cog"></i> 设备信息</a>
|
||||
<li><a href="devicelist"><i class="im-cog"></i> 设备信息</a>
|
||||
</li>
|
||||
<li><a href="form-validation.html"><i class="im-cog2"></i> 设备绑定</a>
|
||||
</li>
|
||||
|
||||
@@ -106,6 +106,31 @@
|
||||
<put-attribute name="body" value="/WEB-INF/views/camera/userlist.jsp" />
|
||||
</definition>
|
||||
|
||||
<!-- 摄像头激活码页面 -->
|
||||
<definition name="activaCode" extends="base">
|
||||
<put-attribute name="body" value="/WEB-INF/views/camera/activaCode.jsp" />
|
||||
</definition>
|
||||
|
||||
<!-- 设备信息列表页面 -->
|
||||
<definition name="devicelist" extends="base">
|
||||
<put-attribute name="body" value="/WEB-INF/views/device/list.jsp" />
|
||||
</definition>
|
||||
|
||||
<!-- 设备绑定列表页面 -->
|
||||
<definition name="devicebindlist" extends="base">
|
||||
<put-attribute name="body" value="/WEB-INF/views/device/bindlist.jsp" />
|
||||
</definition>
|
||||
|
||||
<!-- 设备类型列表页面 -->
|
||||
<definition name="hardwareTypelist" extends="base">
|
||||
<put-attribute name="body" value="/WEB-INF/views/device/hardwareType.jsp" />
|
||||
</definition>
|
||||
|
||||
<!-- 设备登陆记录列表页面 -->
|
||||
<definition name="deviceloginlist" extends="base">
|
||||
<put-attribute name="body" value="/WEB-INF/views/device/loginlist.jsp" />
|
||||
</definition>
|
||||
|
||||
<!-- 测试页面 -->
|
||||
<definition name="testj" extends="base">
|
||||
<put-attribute name="body" value="/WEB-INF/views/query/test.jsp" />
|
||||
|
||||
@@ -0,0 +1,218 @@
|
||||
<%--
|
||||
Document : activaCode
|
||||
Created on : 2017-8-17, 9:33:05
|
||||
Author : Administrator
|
||||
--%>
|
||||
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<form id="downloadExcelForm" method="post" action="downloadActivaCodeExcel">
|
||||
<table style="width: 100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><label>激活码:</label></td>
|
||||
<td><input type="text" id="activateCode" name="activateCode"></td>
|
||||
<td><label>批次号:</label></td>
|
||||
<td><input type="text" id="pici" name="pici"></td>
|
||||
<td><label>生成时间:</label></td>
|
||||
<td><input type="text" id="createTime" name="createTime" class="input-medium searchClass" maxlength="20"></td>
|
||||
<td><label>是否使用:</label></td>
|
||||
<td>
|
||||
<select id="isUsed" name="isUsed" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">已使用</option>
|
||||
<option value="0">未使用</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<div id="searchDiv" style="text-align: center;padding-top: 30px;">
|
||||
<button class="btn btn-primary" id="clearSelect" style="display: inline-block"><i class="fa-undo"></i>重置</button>
|
||||
<button class="btn btn-primary" id="createActivaCode" style="display: inline-block"><i class="br-inbox"></i>生成激活码</button>
|
||||
<button class="btn btn-primary" id="downloadExcel" style="display: inline-block"><i class="fa-cloud-download"></i>导出Excel</button>
|
||||
</div>
|
||||
<table class="dataTable cell-border" id="datatable" >
|
||||
<thead>
|
||||
<tr>
|
||||
<th>激活码</th>
|
||||
<th>批次号</th>
|
||||
<th>是否使用</th>
|
||||
<th>生成时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div class="modal fade" id="createActivaCodeModel" tabindex="1" role="dialog" aria-labelledby="exampleModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">激活摄像头</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="recipient-name" class="control-label" style="width: 70px;">生成数量:</label>
|
||||
<input type="text" class="form-control" id="batchNumber" name="batchNumber" style="display: inline;width: 460px;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="message-text" class="control-label" style="width: 70px;">批次号:</label>
|
||||
<input type="text" class="form-control" id="batchCode" name="batchCode" style="display: inline;width: 460px;">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" id="createActivaCodeBtn" data-toggle="modal" >保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
//日期控件
|
||||
$('#createTime').datepicker({
|
||||
dateFormat: "yy-mm-dd"
|
||||
});
|
||||
|
||||
var table = $('#datatable').on('draw.dt', function () {
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function (html) {
|
||||
var switchery = new Switchery(html);
|
||||
});
|
||||
}).DataTable({
|
||||
//记录用户状态
|
||||
stateSave: true,
|
||||
//中文自定义
|
||||
language: {
|
||||
"sProcessing": "处理中...",
|
||||
"sLengthMenu": "显示 _MENU_ 项结果",
|
||||
"sZeroRecords": "没有匹配结果",
|
||||
"sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
|
||||
"sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
|
||||
"sInfoFiltered": "(由 _MAX_ 项结果过滤)",
|
||||
"sInfoPostFix": "",
|
||||
"sSearch": "搜索:",
|
||||
"sUrl": "",
|
||||
"sEmptyTable": "表中数据为空",
|
||||
"sLoadingRecords": "载入中...",
|
||||
"sInfoThousands": ",",
|
||||
"oPaginate": {
|
||||
"sFirst": "首页",
|
||||
"sPrevious": "上页",
|
||||
"sNext": "下页",
|
||||
"sLast": "末页"
|
||||
},
|
||||
"oAria": {
|
||||
"sSortAscending": ": 以升序排列此列",
|
||||
"sSortDescending": ": 以降序排列此列"
|
||||
}
|
||||
},
|
||||
//是否显示排序
|
||||
bSort: false,
|
||||
//是否显示过滤搜索
|
||||
bFilter: false,
|
||||
//页脚展示风格
|
||||
pagingType: "full_numbers",
|
||||
//是否启动服务器数据处理
|
||||
serverSide: true,
|
||||
autoWidth: false,
|
||||
"lengthChange": false,
|
||||
//ajax获取服务器数据
|
||||
ajax: {
|
||||
url: 'activeCodeListData',
|
||||
type: 'post',
|
||||
data: function (d) {
|
||||
d.pici = $('#pici').val();
|
||||
d.activateCode = $('#activateCode').val();
|
||||
d.createTime = $('#createTime').val();
|
||||
d.isUsed = $('#isUsed').val();
|
||||
}
|
||||
},
|
||||
//数据展示
|
||||
columns: [
|
||||
{
|
||||
"data": "activeCode",
|
||||
},
|
||||
{
|
||||
"data": "batchCode",
|
||||
},
|
||||
{
|
||||
"data": "isUsed",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.isUsed === '1') {
|
||||
str = '<span class="btn btn-xs btn-success">是</span>';
|
||||
} else {
|
||||
str = '<span class="btn btn-xs btn-danger">否</span>';
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "createTime",
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
$('#isUsed,#createTime,#pici').change(function () {
|
||||
table.ajax.reload(null, true);
|
||||
});
|
||||
|
||||
$('#activateCode').keyup(function () {
|
||||
table.ajax.reload(null, true);
|
||||
});
|
||||
|
||||
$(document).keyup(function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
table.ajax.reload(null, true);
|
||||
}
|
||||
});
|
||||
|
||||
$('#createActivaCode').click(function () {
|
||||
$('#createActivaCodeModel').modal("show");
|
||||
});
|
||||
|
||||
$('#createActivaCodeBtn').click(function () {
|
||||
if (window.confirm('你确定要生成吗?')) {
|
||||
$.ajax({
|
||||
url: 'createActivaCode',
|
||||
type: 'post',
|
||||
data: {"batchCode": $('#batchCode').val(), "batchNumber": $('#batchNumber').val()},
|
||||
success: function (data) {
|
||||
if (data === '成功') {
|
||||
location.reload();
|
||||
} else {
|
||||
alert(data);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//alert("取消");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#downloadExcel').click(function () {
|
||||
if (window.confirm('你确定要生成吗?')) {
|
||||
$("#downloadExcelForm").submit();
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#clearSelect').click(function () {
|
||||
$('#pici').val('');
|
||||
$('#activateCode').val('');
|
||||
$('#createTime').val('');
|
||||
$('#isUsed').val('');
|
||||
table.ajax.reload(null, true);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,17 @@
|
||||
<%--
|
||||
Document : bindlist
|
||||
Created on : 2017-8-17, 11:14:32
|
||||
Author : Administrator
|
||||
--%>
|
||||
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>JSP Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,17 @@
|
||||
<%--
|
||||
Document : hardwareType
|
||||
Created on : 2017-8-17, 11:15:30
|
||||
Author : Administrator
|
||||
--%>
|
||||
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>JSP Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,524 @@
|
||||
<%--
|
||||
Document : list
|
||||
Created on : 2017-8-17, 11:13:35
|
||||
Author : Administrator
|
||||
--%>
|
||||
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<table style="width: 100%">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="text-align: right;padding: 10px">MAC地址:</td>
|
||||
<td><input type="text" id="macAddress" name="macAddress" class="input-medium searchClass" maxlength="20"></td>
|
||||
<td style="text-align: right;padding: 10px">设备ID:</td>
|
||||
<td><input type="text" id="deviceId" name="deviceId" class="input-medium searchClass" maxlength="20"></td>
|
||||
<td style="text-align: right;padding: 10px">设备版本:</td>
|
||||
<td><input type="text" id="sdkVersion" name="sdkVersion" class="input-medium searchClass" maxlength="20"></td>
|
||||
<td style="text-align: right;padding: 10px">目标版本:</td>
|
||||
<td><input type="text" id="upgradeVersion" name="upgradeVersion" class="input-medium searchClass" maxlength="20"></td>
|
||||
<td style="text-align: right;padding: 10px">分配日期:</td>
|
||||
<td><input type="text" id="createDate" name="createDate" class="input-medium searchClass" maxlength="20"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right;padding: 10px">登陆日期:</td>
|
||||
<td><input type="text" id="loginTime" name="loginTime" class="input-medium searchClass" maxlength="20"></td>
|
||||
<td style="text-align: right;padding: 10px">分配编号:</td>
|
||||
<td><input type="text" id="createCode" name="createCode" class="input-medium searchClass" maxlength="20"></td>
|
||||
<td style="text-align: right;padding: 10px">电子厂:</td>
|
||||
<td>
|
||||
<select id="factoryCode" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<c:forEach var="item" items="${factorylist}">
|
||||
<option value="${item.factoryCode}">${item.factoryName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td style="text-align: right;padding: 10px">鱼缸厂:</td>
|
||||
<td>
|
||||
<select id="brandCode" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<c:forEach var="item" items="${venderlist}">
|
||||
<option value="${item.brandCode}">${item.brandName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
<td style="text-align: right;padding: 10px">硬件类型:</td>
|
||||
<td>
|
||||
<select id="hardwareType" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<c:forEach var="item" items="${hardWare_Types}">
|
||||
<option value="${item.hardwareType}">${item.hardwareName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align: right;padding: 10px">是否收费:</td>
|
||||
<td >
|
||||
<select id="isCharge" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="text-align: right;padding: 10px">授权状态:</td>
|
||||
<td >
|
||||
<select id="isBlacklist" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="text-align: right;padding: 10px">自动升级:</td>
|
||||
<td >
|
||||
<select id="isUpgrade" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="text-align: right;padding: 10px">排序字段:</td>
|
||||
<td >
|
||||
<select id="sortField" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</td>
|
||||
<td style="text-align: right;padding: 10px">排序方式:</td>
|
||||
<td >
|
||||
<select id="sortModel" class="input-medium searchClass">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div id="searchDiv" style="text-align: center;padding-top: 30px;">
|
||||
<button class="btn btn-primary" id="clearSelect" style="display: inline-block"><i class="fa-undo"></i>重置</button>
|
||||
<button class="btn btn-primary" id="upgradeSDKWhenLogin" style="display: inline-block"><i class="fa-cloud-upload"></i>批量升级SDK</button>
|
||||
<button class="btn btn-primary" id="upgradeSDKOnline" style="display: inline-block"><i class="fa-cloud-upload"></i>在线升级SDK</button>
|
||||
<button class="btn btn-primary" id="selectDeviceOnline" style="display: inline-block"><i class="ec-search"></i>设备在线状态</button>
|
||||
</div>
|
||||
<table class="dataTable cell-border" id="datatable" style="display: inline-block;">
|
||||
<thead style="width: 1600px">
|
||||
<tr style="width: 1600px">
|
||||
<th >设备/ID</th>
|
||||
<th >设备信息</th>
|
||||
<th >设备参数</th>
|
||||
<th >SDK版本信息</th>
|
||||
<th >登陆信息</th>
|
||||
<th >分配信息</th>
|
||||
<th >上报记录</th>
|
||||
<th >授权信息</th>
|
||||
<th >授权</th>
|
||||
<th >操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<div class="modal fade" id="upgradeSDKOnlineModal" tabindex="1" role="dialog" aria-labelledby="exampleModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">在线升级SDK</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="recipient-name" class="control-label" style="width: 70px;">mac地址:</label>
|
||||
<input type="text" class="form-control" id="upgradeSDKOnlineMacAddress" name="upgradeSDKOnlineMacAddress" style="display: inline;width: 460px;">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="message-text" class="control-label" style="width: 70px;">升级版本:</label>
|
||||
<input type="text" class="form-control" id="upgradeSDKOnlineUpgradeVersion" name="upgradeSDKOnlineUpgradeVersion" style="display: inline;width: 460px;">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" id="upgradeSDKOnlineBtn" data-toggle="modal" >保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="selectDeviceOnlineModal" tabindex="1" role="dialog" aria-labelledby="exampleModalLabel">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
<h4 class="modal-title" id="exampleModalLabel">查询设备在线</h4>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form>
|
||||
<div class="form-group">
|
||||
<label for="recipient-name" class="control-label" style="width: 70px;">mac地址:</label>
|
||||
<input type="text" class="form-control" id="selectDeviceOnlineAddress" name="selectDeviceOnlineAddress" style="display: inline;width: 460px;">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
|
||||
<button type="button" class="btn btn-primary" id="selectDeviceOnlineBtn" data-toggle="modal" >保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function upgradeSDKOnline(macAddress) {
|
||||
$('#upgradeSDKOnlineMacAddress').val(macAddress);
|
||||
$('#upgradeSDKOnlineModal').modal("show");
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
//日期控件
|
||||
$('#activateTime').datepicker({
|
||||
dateFormat: "yy-mm-dd"
|
||||
});
|
||||
|
||||
var table = $('#datatable').on('draw.dt', function () {
|
||||
var elems = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
|
||||
elems.forEach(function (html) {
|
||||
var switchery = new Switchery(html);
|
||||
});
|
||||
}).DataTable({
|
||||
//记录用户状态
|
||||
stateSave: true,
|
||||
//中文自定义
|
||||
language: {
|
||||
"sProcessing": "处理中...",
|
||||
"sLengthMenu": "显示 _MENU_ 项结果",
|
||||
"sZeroRecords": "没有匹配结果",
|
||||
"sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
|
||||
"sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
|
||||
"sInfoFiltered": "(由 _MAX_ 项结果过滤)",
|
||||
"sInfoPostFix": "",
|
||||
"sSearch": "搜索:",
|
||||
"sUrl": "",
|
||||
"sEmptyTable": "表中数据为空",
|
||||
"sLoadingRecords": "载入中...",
|
||||
"sInfoThousands": ",",
|
||||
"oPaginate": {
|
||||
"sFirst": "首页",
|
||||
"sPrevious": "上页",
|
||||
"sNext": "下页",
|
||||
"sLast": "末页"
|
||||
},
|
||||
"oAria": {
|
||||
"sSortAscending": ": 以升序排列此列",
|
||||
"sSortDescending": ": 以降序排列此列"
|
||||
}
|
||||
},
|
||||
//是否显示排序
|
||||
bSort: false,
|
||||
//是否显示过滤搜索
|
||||
bFilter: false,
|
||||
//页脚展示风格
|
||||
pagingType: "full_numbers",
|
||||
//是否启动服务器数据处理
|
||||
serverSide: true,
|
||||
autoWidth: false,
|
||||
//ajax获取服务器数据
|
||||
ajax: {
|
||||
url: 'devicelistData',
|
||||
type: 'post',
|
||||
data: function (d) {
|
||||
d.macAddress = $('#macAddress').val();
|
||||
d.deviceId = $('#deviceId').val();
|
||||
d.sdkVersion = $('#sdkVersion').val();
|
||||
d.upgradeVersion = $('#upgradeVersion').val();
|
||||
d.createDate = $('#createDate').val();
|
||||
d.createCode = $('#createCode').val();
|
||||
d.loginTime = $('#loginTime').val();
|
||||
d.factoryCode = $('#factoryCode').val();
|
||||
d.brandCode = $('#brandCode').val();
|
||||
d.hardwareType = $('#hardwareType').val();
|
||||
d.isCharge = $('#isCharge').val();
|
||||
d.isBlacklist = $('#isBlacklist').val();
|
||||
d.isUpgrade = $('#isUpgrade').val();
|
||||
d.sortField = $('#sortField').val();
|
||||
d.sortModel = $('#sortModel').val();
|
||||
}
|
||||
},
|
||||
//数据展示
|
||||
columns: [
|
||||
{
|
||||
"data": "deviceId",
|
||||
"width": "98px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.macAddress !== undefined && row.macAddress !== '') {
|
||||
str = str + "<span class='btn btn-dark'>" + row.macAddress + "</span></br>";
|
||||
}
|
||||
if (row.deviceId !== undefined && row.deviceId !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-info'>" + row.deviceId + "</span>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "factoryName",
|
||||
"width": "81px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.factoryName !== undefined && row.factoryName !== '') {
|
||||
str = str + "<span class='btn btn-dark'>" + row.factoryName + "</span></br>";
|
||||
}
|
||||
if (row.brandName !== undefined && row.brandName !== '') {
|
||||
str = str + "<span class='btn btn-primary'>" + row.brandName + "</span></br>";
|
||||
}
|
||||
if (row.hardWareName !== undefined && row.hardWareName !== '') {
|
||||
str = str + "<span class='btn btn-success'>" + row.hardWareName + "</span>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "onOff",
|
||||
"width": "69px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.onOff !== undefined && row.phoneNumber !== '1') {
|
||||
str = str + "<span class='btn btn-xs btn-default'>温度报警:开</span></br>";
|
||||
} else {
|
||||
str = str + "<span class='btn btn-xs btn-danger'>温度报警:关</span></br>";
|
||||
}
|
||||
if (row.waterRemind !== undefined && row.waterRemind !== '1') {
|
||||
str = str + "<span class='btn btn-xs btn-default'>换水提醒:开</span>";
|
||||
} else {
|
||||
str = str + "<span class='btn btn-xs btn-danger'>换水提醒:关</span>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "sdkVersion",
|
||||
"width": "172px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.sdkVersion !== undefined && row.sdkVersion !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-primary'>SDK版本:" + row.sdkVersion + "</span></br>";
|
||||
}
|
||||
if (row.sdkTime !== undefined && row.sdkTime !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-success'>版本日期:" + row.sdkTime + "</span></br>";
|
||||
}
|
||||
if (row.upgradeTime !== undefined && row.upgradeTime !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-success'>升级日期:" + row.upgradeTime + "</span></br>";
|
||||
}
|
||||
if (row.isUpgrade !== undefined && row.isUpgrade !== '1') {
|
||||
str = str + "<span class='btn btn-xs btn-default'>自动升级:开</span></br>";
|
||||
} else {
|
||||
str = str + "<span class='btn btn-xs btn-danger'>自动升级:关</span></br>";
|
||||
}
|
||||
if (row.upgradeVersion !== undefined && row.upgradeVersion !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-brown'>升级版本:" + row.upgradeVersion + "</span>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "loginCount",
|
||||
"width": "172px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.loginCount !== undefined && row.loginCount !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-default'>登陆次数:" + row.loginCount + "</span></br>";
|
||||
}
|
||||
if (row.loginTime !== undefined && row.loginTime !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-success'>登陆时间:" + row.loginTime + "</span>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "createDate",
|
||||
"width": "172px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.createDate !== undefined && row.createDate !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-success'>分配日期:" + row.createDate + "</span></br>";
|
||||
}
|
||||
if (row.createCode !== undefined && row.createCode !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-primary'>分配编号:" + row.createCode + "</span></br>";
|
||||
}
|
||||
if (row.firstActivate !== undefined && row.firstActivate !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-success'>激活时间:" + row.firstActivate + "</span></br>";
|
||||
}
|
||||
if (row.createTime !== undefined && row.createTime !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-success'>创建时间:" + row.createTime + "</span>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "mcuCount",
|
||||
"width": "125px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.mcuCount !== undefined && row.mcuCount !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-primary mr10' style='width:130px;'>MCU启动次数:" + row.mcuCount + "</span></br>";
|
||||
}
|
||||
if (row.moduleCount !== undefined && row.moduleCount !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-primary mr10' style='width:130px;'>模块启动次数:" + row.moduleCount + "</span></br>";
|
||||
}
|
||||
if (row.routerCount !== undefined && row.routerCount !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-primary mr10' style='width:130px;'>连接路由器次数:" + row.routerCount + "</span></br>";
|
||||
}
|
||||
if (row.serverCount !== undefined && row.serverCount !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-primary mr10' style='width:130px;'>成功连接次数:" + row.serverCount + "</span></br>";
|
||||
}
|
||||
if (row.serverTryCount !== undefined && row.serverTryCount !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-primary mr10' style='width:130px;'>尝试连接次数:" + row.serverTryCount + "</span></br>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "activeTime",
|
||||
"width": "172px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = "";
|
||||
if (row.isCharge !== undefined && row.isCharge !== '1') {
|
||||
str = str + "<span class='btn btn-xs btn-default' style='width:130px;'>是否收费:是</span></br>";
|
||||
} else {
|
||||
str = str + "<span class='btn btn-xs btn-danger' style='width:130px;'>是否收费:否</span></br>";
|
||||
}
|
||||
if (row.isBlacklist !== undefined && row.isBlacklist !== '1') {
|
||||
str = str + "<span class='btn btn-xs btn-default' style='width:130px;'>授权状态:OK</span></br>";
|
||||
} else {
|
||||
str = str + "<span class='btn btn-xs btn-danger' style='width:130px;'>授权状态:NO</span></br>";
|
||||
}
|
||||
if (row.authorizeTime !== undefined && row.authorizeTime !== '') {
|
||||
str = str + "<span class='btn btn-xs btn-success'>授权时间:" + row.authorizeTime + "</span>";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "deviceId",
|
||||
"width": "58px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = '';
|
||||
//如果没有收费
|
||||
if (row.isCharge === undefined || row.isCharge === '0') {
|
||||
//如果没有授权
|
||||
if (row.isBlacklist === '1') {
|
||||
str = '<button title="授权" onclick="hardwareLicense(' + row.deviceId + ',0)" class="btn btn-xs btn-primary"><span class="fa-ok-circle"></span>授予权限</button>';
|
||||
} else {
|
||||
str = '<button title="取消授权" onclick="hardwareLicense(' + row.deviceId + ',1)" class="btn btn-xs btn-danger"><span class="fa-remove-circle"></span>取消授权</button>';
|
||||
}
|
||||
}
|
||||
return str;
|
||||
}
|
||||
},
|
||||
{
|
||||
"data": "deviceId",
|
||||
"width": "58px",
|
||||
render: function (data, type, row, meta) {
|
||||
var str = '';
|
||||
//如果开启自动升级
|
||||
if (row.isUpgrade === '1') {
|
||||
str = str + '<button title="取消升级SDK" onclick="noUpgradeSdk(' + row.deviceId + ',' + row.sdkVersion + ',0)" class="btn btn-xs btn-danger"><span class="fa-cloud-download"></span>取消升级</button></br>';
|
||||
} else {
|
||||
str = str + '<button title="重启升级SDK" onclick="upgradeSdk(' + row.deviceId + ',' + row.sdkVersion + ',1)" class="btn btn-xs btn-primary"><span class="fa-cloud-upload"></span>重启升级</button></br>';
|
||||
}
|
||||
str = str + '<button title="查询设备状态" onclick="searchStatus(\'' + row.macAddress + '\')" class="btn btn-xs btn-default"><span class="ec-search"></span>查询状态</button></br>';
|
||||
str = str + '<button title="在线升级SDK" onclick="upgradeSDKOnline(\'' + row.macAddress + '\')" class="btn btn-xs btn-success"><span class="fa-cloud-upload"></span>在线升级</button>';
|
||||
return str;
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
//下拉框条件和特殊条件移开焦点后刷新table
|
||||
$('#deviceId,#sdkVersion,#upgradeVersion,#createDate,#loginTime,#factoryCode,#brandCode,#hardwareType,#isCharge,#isBlacklist,#isUpgrade,#sortField,#sortModel').change(function () {
|
||||
table.ajax.reload(null, true);
|
||||
});
|
||||
//mac地址,分配编号填写后刷新table
|
||||
$('#macAddress,#createCode').keyup(function () {
|
||||
table.ajax.reload(null, true);
|
||||
});
|
||||
//回车后刷新table
|
||||
$(document).keyup(function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
table.ajax.reload(null, true);
|
||||
}
|
||||
});
|
||||
//重置按钮,清空所有已选条件
|
||||
$('#clearSelect').click(function () {
|
||||
$('#macAddress').val('');
|
||||
$('#deviceId').val('');
|
||||
$('#sdkVersion').val('');
|
||||
$('#upgradeVersion').val('');
|
||||
$('#createDate').val('');
|
||||
$('#createCode').val('');
|
||||
$('#loginTime').val('');
|
||||
$('#factoryCode').val('');
|
||||
$('#brandCode').val('');
|
||||
$('#hardwareType').val('');
|
||||
$('#isCharge').val('');
|
||||
$('#isBlacklist').val('');
|
||||
$('#isUpgrade').val('');
|
||||
$('#sortField').val('');
|
||||
$('#sortModel').val('');
|
||||
table.ajax.reload(null, true);
|
||||
});
|
||||
//在线升级按钮,弹出SDK升级弹窗
|
||||
$('#upgradeSDKOnline').click(function () {
|
||||
$('#upgradeSDKOnlineModal').modal("show");
|
||||
});
|
||||
//确认在线升级按钮,发送在线升级请求
|
||||
$('#upgradeSDKOnlineBtn').click(function () {
|
||||
if (window.confirm('你确定要升级SDK吗?')) {
|
||||
$.ajax({
|
||||
url: 'upgradeSDKOnline',
|
||||
type: 'post',
|
||||
data: {"macAddress": $('#upgradeSDKOnlineMacAddress').val(), "sdkVersion": $('#upgradeSDKOnlineUpgradeVersion').val()},
|
||||
success: function (data) {
|
||||
if (data === '成功') {
|
||||
alert('升级成功');
|
||||
$('#upgradeSDKOnlineModal').modal("hide");
|
||||
} else {
|
||||
alert(data);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
//alert("取消");
|
||||
return false;
|
||||
}
|
||||
});
|
||||
//查询设备在线按钮,弹出查询框
|
||||
$('#selectDeviceOnline').click(function () {
|
||||
$('#selectDeviceOnlineModal').modal("show");
|
||||
});
|
||||
//确认查询设备在线按钮,发送查询请求
|
||||
$('#selectDeviceOnlineBtn').click(function () {
|
||||
$.ajax({
|
||||
url: 'selectDeviceOnline',
|
||||
type: 'post',
|
||||
data: {"macAddress": $('#selectDeviceOnlineAddress').val()},
|
||||
success: function (data) {
|
||||
if (data === '成功') {
|
||||
alert('升级成功');
|
||||
$('#selectDeviceOnlineModal').modal("hide");
|
||||
} else {
|
||||
alert(data);
|
||||
}
|
||||
},
|
||||
error: function (data) {
|
||||
console.log(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,17 @@
|
||||
<%--
|
||||
Document : loginlist
|
||||
Created on : 2017-8-17, 11:16:04
|
||||
Author : Administrator
|
||||
--%>
|
||||
|
||||
<%@page contentType="text/html" pageEncoding="UTF-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>JSP Page</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
|
||||
version="3.1">
|
||||
<session-config>
|
||||
<session-timeout>
|
||||
30
|
||||
</session-timeout>
|
||||
</session-config>
|
||||
</web-app>
|
||||
Reference in New Issue
Block a user