摄像头激活码页面,设备信息列表页面
This commit is contained in:
@@ -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,14 +8,16 @@ 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;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Administrator
|
||||
*/
|
||||
public interface DeviceHelperI {
|
||||
|
||||
|
||||
/**
|
||||
* 根据用户Id获取绑定设备集合
|
||||
*
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user