新增厂商设备授权页面
This commit is contained in:
parent
8e76caf137
commit
d7581651e6
|
|
@ -63,7 +63,6 @@ import com.ifish.util.IfishUtil;
|
|||
import com.ifish.util.ResultUtil;
|
||||
import com.ifish.webService.MyService;
|
||||
import com.ifish.webService.MyServiceService;
|
||||
import com.ifishNew.bean.Tbl_Push_List;
|
||||
|
||||
/**
|
||||
* @ClassName: AdminAction
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import java.util.Map;
|
|||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.ifish.entity.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -19,13 +20,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import com.ifish.entity.Device;
|
||||
import com.ifish.entity.FactoryList;
|
||||
import com.ifish.entity.OperateRecord;
|
||||
import com.ifish.entity.PayBill;
|
||||
import com.ifish.entity.PayeeInfo;
|
||||
import com.ifish.entity.QuestionsFeedback;
|
||||
import com.ifish.entity.SecurityUser;
|
||||
import com.ifish.hibernate.Pagination;
|
||||
import com.ifish.search.SearchFilter;
|
||||
import com.ifish.service.AdminService;
|
||||
|
|
@ -42,7 +36,7 @@ import com.ifish.util.getRemoteAddress;
|
|||
@Controller("factoryAction")
|
||||
@RequestMapping("/factory")
|
||||
public class FactoryAction {
|
||||
|
||||
|
||||
@Autowired
|
||||
private FactoryService factoryService;
|
||||
@Autowired
|
||||
|
|
@ -98,6 +92,24 @@ public class FactoryAction {
|
|||
}
|
||||
return new ModelAndView("roleFactory/tmpDeviceList",map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息页面 新
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deviceListByPage.do")
|
||||
public ModelAndView deviceListByPage(ModelMap map) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
//鱼缸厂
|
||||
map.put("list2", factoryList.getVenderLists());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("tmpDeviceList:error message:{}",e.toString());
|
||||
}
|
||||
return new ModelAndView("roleFactory/deviceList",map);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备授权页面
|
||||
|
|
@ -122,7 +134,6 @@ public class FactoryAction {
|
|||
|
||||
/**
|
||||
* 授权
|
||||
* @param tmpDevice
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deviceAuthorize.do")
|
||||
|
|
@ -140,6 +151,27 @@ public class FactoryAction {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 授权
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deviceAuthorizeNew.do")
|
||||
@ResponseBody
|
||||
public Object deviceAuthorizeNew(HttpServletRequest request) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
String ip = getRemoteAddress.getIp(request);
|
||||
String[] deviceIds = request.getParameter("deviceId").split("_");
|
||||
this.adminService.deviceAuthorizeNew(ip,factoryList.getFactoryCode(),deviceIds);
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("deviceAuthorize:error message:{}",e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 重新分配
|
||||
|
|
@ -186,6 +218,31 @@ public class FactoryAction {
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 单个重新分配
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deviceFenpeiSingleNew.do")
|
||||
@ResponseBody
|
||||
public Object deviceFenpeiSingleNew(String deviceId,String brandCode,String createCode,HttpServletRequest request) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
String ip = getRemoteAddress.getIp(request);
|
||||
String[] deviceIds = deviceId.split("_");
|
||||
for (String dId : deviceIds) {
|
||||
int id = Integer.parseInt(dId);
|
||||
this.adminService.deviceFenpeiSingleNew(ip,factoryList.getFactoryCode(),id,brandCode,createCode);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("deviceFenpei:error message:{}",e.toString());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息
|
||||
|
|
@ -211,6 +268,32 @@ public class FactoryAction {
|
|||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备信息 新
|
||||
* @param searchFilter
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping("/deviceList.do")
|
||||
@ResponseBody
|
||||
public Object deviceList(SearchFilter searchFilter) {
|
||||
try {
|
||||
FactoryList factoryList = getFactoryListByUserName();
|
||||
if(factoryList!=null){
|
||||
searchFilter.setSelectField3(factoryList.getFactoryCode());
|
||||
|
||||
Pagination<Device> page = this.factoryService.getDeviceByPageNew(searchFilter,factoryList.getHardwareTypeSet());
|
||||
return IfishUtil.returnPageData(page, searchFilter.getsEcho());
|
||||
}
|
||||
else{
|
||||
Pagination<Device> page = new Pagination<Device>(0,0,0,new ArrayList<Device>());
|
||||
return IfishUtil.returnPageData(page , searchFilter.getsEcho());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("get tmpDeviceListInf information:error message:{}",e.toString());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 问题反馈列表页面
|
||||
|
|
|
|||
|
|
@ -229,13 +229,19 @@ public interface AdminService {
|
|||
|
||||
//授权
|
||||
public void deviceAuthorize(String ip,String factoryCode,SearchFilter searchFilter);
|
||||
|
||||
//授权
|
||||
public void deviceAuthorizeNew(String ip,String factoryCode,String[] deviceIds);
|
||||
|
||||
//设备分配
|
||||
public void deviceFenpei(String ip,String factoryCode,String createCode,String brandCode);
|
||||
|
||||
//设备单个重新分配
|
||||
public void deviceFenpeiSingle(String ip,String factoryCode,Integer deviceId,String brandCode);
|
||||
|
||||
|
||||
//设备单个重新分配
|
||||
public void deviceFenpeiSingleNew(String ip,String factoryCode,Integer deviceId,String brandCode,String createCode);
|
||||
|
||||
//消息推送列表
|
||||
public Pagination<Map> getPushListByPage(SearchFilter searchFilter);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.ifish.service;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
import com.ifish.entity.HardwareType;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import com.ifish.entity.Device;
|
||||
|
|
@ -26,5 +28,7 @@ public interface FactoryService {
|
|||
|
||||
//上传Excel
|
||||
public void uploadExcel(String ip,String factoryCode,String brandCode,MultipartFile fileUpload);
|
||||
|
||||
Pagination<Device> getDeviceByPageNew(SearchFilter searchFilter,Set<HardwareType> hardwareTypeSet);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1643,6 +1643,25 @@ public class AdminServiceImpl implements AdminService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deviceAuthorizeNew(String ip, String factoryCode, String[] deviceIds) {
|
||||
for (String deviceId : deviceIds) {
|
||||
String sql = "UPDATE tbl_device SET is_blacklist='0',authorize_time=CURRENT_TIMESTAMP() where is_blacklist='1' AND device_id = '"+ deviceId +"'";
|
||||
int number = this.deviceDao.executeSql(sql);
|
||||
//授权记录
|
||||
if (number > 0) {
|
||||
OperateRecord operateRecord = new OperateRecord();
|
||||
operateRecord.setCreateTime(new Date());
|
||||
operateRecord.setRecordIp(ip);
|
||||
operateRecord.setRecordNumber(number);
|
||||
operateRecord.setRecordType(RecordTypeEnum.shouquan.getKey());
|
||||
operateRecord.setFactoryCode(factoryCode);
|
||||
this.operateRecordDao.save(operateRecord);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deviceFenpei(String ip, String factoryCode, String createCode, String brandCode) {
|
||||
if (createCode != null && createCode.length() > 0 && brandCode != null && brandCode.length() > 0) {
|
||||
|
|
@ -1685,6 +1704,30 @@ public class AdminServiceImpl implements AdminService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deviceFenpeiSingleNew(String ip, String factoryCode, Integer deviceId,String brandCode,String createCode) {
|
||||
if (deviceId != null && createCode != null && createCode.length() > 0) {
|
||||
Device device = this.deviceDao.get(deviceId);
|
||||
if (device != null) {
|
||||
VenderList vender = new VenderList();
|
||||
vender.setBrandCode(brandCode);
|
||||
device.setVenderList(vender);
|
||||
device.setCreateDate(new Date());
|
||||
device.setCreateCode(createCode);
|
||||
this.deviceDao.update(device);
|
||||
//分配记录
|
||||
OperateRecord operateRecord = new OperateRecord();
|
||||
operateRecord.setCreateTime(new Date());
|
||||
operateRecord.setCreateCode(device.getCreateCode());
|
||||
operateRecord.setRecordIp(ip);
|
||||
operateRecord.setRecordNumber(1);
|
||||
operateRecord.setRecordType(RecordTypeEnum.fenpei.getKey());
|
||||
operateRecord.setFactoryCode(factoryCode);
|
||||
this.operateRecordDao.save(operateRecord);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<Map> getPushListByPage(SearchFilter searchFilter) {
|
||||
if (searchFilter != null) {
|
||||
|
|
|
|||
|
|
@ -1,11 +1,9 @@
|
|||
package com.ifish.serviceImpl;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.*;
|
||||
|
||||
import com.ifish.entity.*;
|
||||
import jxl.Cell;
|
||||
import jxl.Sheet;
|
||||
import jxl.Workbook;
|
||||
|
|
@ -21,10 +19,6 @@ import org.springframework.web.multipart.MultipartFile;
|
|||
import com.ifish.dao.DeviceDao;
|
||||
import com.ifish.dao.FactoryListDao;
|
||||
import com.ifish.dao.OperateRecordDao;
|
||||
import com.ifish.entity.Device;
|
||||
import com.ifish.entity.FactoryList;
|
||||
import com.ifish.entity.OperateRecord;
|
||||
import com.ifish.entity.VenderList;
|
||||
import com.ifish.enums.BooleanEnum;
|
||||
import com.ifish.enums.RecordTypeEnum;
|
||||
import com.ifish.enums.SortModeEnum;
|
||||
|
|
@ -218,5 +212,50 @@ public class FactoryServiceImpl implements FactoryService {
|
|||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Pagination<Device> getDeviceByPageNew(SearchFilter searchFilter,Set<HardwareType> hardwareTypeSet) {
|
||||
if(searchFilter!=null){
|
||||
//查询条件
|
||||
List<Criterion> queryList = new ArrayList<Criterion>();
|
||||
//排序条件
|
||||
List<Order> orderList = new ArrayList<Order>();
|
||||
//分页
|
||||
Integer iDisplayStart = searchFilter.getiDisplayStart();
|
||||
Integer iDisplayLength = searchFilter.getiDisplayLength();
|
||||
//授权日期
|
||||
String sSearch1 = searchFilter.getsSearch1();
|
||||
if(sSearch1!=null && !sSearch1.equals("")){
|
||||
queryList.add(Restrictions.sqlRestriction("'"+sSearch1+"'=date_format(create_time,'%Y-%m-%d')"));
|
||||
}
|
||||
|
||||
if (hardwareTypeSet != null && hardwareTypeSet.size() != 0) {
|
||||
queryList.add(Restrictions.in("hardwareType",hardwareTypeSet));
|
||||
}
|
||||
|
||||
String selectField1 = searchFilter.getSelectField1();
|
||||
if(selectField1!=null && !selectField1.equals("")){
|
||||
queryList.add(Restrictions.eq("isBlacklist", selectField1));
|
||||
}
|
||||
|
||||
|
||||
|
||||
String selectField2 = searchFilter.getSelectField2();
|
||||
if(selectField2!=null && !selectField2.equals("")){
|
||||
if ("1".equals(selectField2)) {
|
||||
queryList.add(Restrictions.sqlRestriction("create_code != ''"));
|
||||
} else {
|
||||
queryList.add(Restrictions.sqlRestriction("create_code = ''"));
|
||||
}
|
||||
}
|
||||
|
||||
orderList.add(Order.desc("createTime"));
|
||||
|
||||
return this.deviceDao.findByCriteria(iDisplayStart,iDisplayLength,orderList,queryList.toArray(new Criterion[queryList.size()]));
|
||||
}
|
||||
else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
c3p0.driverClassName=com.mysql.jdbc.Driver
|
||||
c3p0.url=jdbc\:mysql\://localhost\:3306/myfishdb?characterEncoding\=UTF-8
|
||||
#c3p0.url=jdbc\:mysql\://139.196.24.156\:3306/myfishdb?characterEncoding\=UTF-8
|
||||
c3p0.username=root
|
||||
c3p0.password=ifish7mysql
|
||||
#c3p0.username=root
|
||||
#c3p0.password=123456
|
||||
#c3p0.password=ifish7mysql
|
||||
c3p0.username=ifish
|
||||
c3p0.password=ifish7pwd
|
||||
|
||||
c3p0.autoCommitOnClose=true
|
||||
c3p0.initialPoolSize=20
|
||||
|
|
|
|||
|
|
@ -33,9 +33,6 @@ log4j.appender.ROLLING_FILE.layout=org.apache.log4j.PatternLayout
|
|||
log4j.appender.ROLLING_FILE.layout.ConversionPattern=[ifish7System][%-5p]%d - %c.%t(%F:%L) - %m%n
|
||||
|
||||
log4j.logger.org.springframework=INFO
|
||||
log4j.logger.com.ibatis=ERROR
|
||||
log4j.logger.com.ibatis=INFO
|
||||
log4j.logger.java.sql=INFO
|
||||
log4j.logger.com.travelsky.ypb.service.persistent=ERROR
|
||||
log4j.logger.com.taobao.diamond=ERROR
|
||||
log4j.logger.com.umetrip.consumer=ERROR
|
||||
log4j.logger.com.umetrip.register=ERROR
|
||||
log4j.logger.org.hibernate=INFO
|
||||
|
|
|
|||
|
|
@ -28,4 +28,5 @@ fastDFS_url_local=http://139.196.24.156:83/
|
|||
fastDFS_url_app=http://app.ifish7.com/
|
||||
#\u73af\u5883(local:\u672c\u5730\u73af\u5883,test:\u6d4b\u8bd5\u73af\u5883,\u6b63\u5f0f\u73af\u5883:product)
|
||||
#env=test
|
||||
env=product
|
||||
env=product
|
||||
#env=local
|
||||
|
|
@ -0,0 +1,447 @@
|
|||
<%@page import="com.ifish.enums.SysUserEnum"%>
|
||||
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>硬件信息</title>
|
||||
<!-- css and js -->
|
||||
<%@ include file="../htm/script.jsp" %>
|
||||
<link href="<%=basePath%>static/css/datepicker.css" rel="stylesheet"/>
|
||||
<script src="<%=basePath%>static/js/date-time/bootstrap-datepicker.min.js"></script>
|
||||
<style type="text/css">
|
||||
.important
|
||||
{
|
||||
vertical-align:middle;
|
||||
text-align:right;
|
||||
padding:10px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var dataTable = null;
|
||||
$(function(){
|
||||
$("#searchTable").find("td:even").addClass("important");
|
||||
$("#searchTable").find("input").addClass("searchClass");
|
||||
$("#searchTable").find("select").addClass("searchClass");
|
||||
//模态框
|
||||
$('.modal').modal({
|
||||
backdrop:'static',
|
||||
show:false
|
||||
});
|
||||
//分页
|
||||
dataTable = $('#sample-table-2').dataTable({
|
||||
"sPaginationType": "bootstrap",
|
||||
//"bProcessing": true,
|
||||
"bLengthChange": false,
|
||||
"bFilter": false,
|
||||
"bServerSide": true,//指定从服务器端获取数据
|
||||
"sAjaxSource": "<%=basePath%>page/factory/deviceList.do",
|
||||
"fnServerData": returnServerData,
|
||||
"aoColumns": [
|
||||
{ "mData": function(device){
|
||||
return '<input type="checkbox" name="one" id="one" value=\''+ device.deviceId +'\' />';
|
||||
},"bSortable": false },
|
||||
{ "mData": "macAddress","bSortable": false },
|
||||
{ "mData": function(device){
|
||||
return device.venderList!=null ?device.venderList.brandName:'';
|
||||
},
|
||||
"bSortable": false
|
||||
},
|
||||
{ "mData": function(device){
|
||||
return device.hardwareType!=null ?device.hardwareType.hardwareName:'';
|
||||
},
|
||||
"bSortable": false
|
||||
},
|
||||
{ "mData": "createTime","bSortable": false },
|
||||
{ "mData": "createDate","bSortable": false },
|
||||
{ "mData": "createCode","bSortable": false },
|
||||
{ "mData": "firstActivate","bSortable": false },
|
||||
{ "mData": "loginTime","bSortable": false },
|
||||
{ "mData": "loginCount","bSortable": false },
|
||||
{ "mData": "authorizeTime","bSortable": false },
|
||||
{ "mData": function(device){
|
||||
return device.isBlacklist==1?'<span class="badge label-danger">NO</span>':'<span class="badge label-success">OK</span>';
|
||||
},
|
||||
"bSortable": false
|
||||
},
|
||||
{ "mData": function(device){
|
||||
return device.isBlacklist == 1 ? ('<a href="javascript:void(0);" title="授权" onclick="shouquanDeviceOne(\''+device.deviceId+'\')" class="btn btn-xs btn-primary"><span class="icon-edit"></span>授权</a> ' +
|
||||
'<a href="javascript:void(0);" title="重新分配" onclick="fenpeiDeviceOne(\''+device.deviceId+'\',\''+ device.createCode +'\')" class="btn btn-xs btn-primary"><span class="icon-edit"></span>分配厂家</a>'):
|
||||
'<a href="javascript:void(0);" title="重新分配" onclick="fenpeiDeviceOne(\''+device.deviceId+'\',\''+ device.createCode +'\')" class="btn btn-xs btn-primary"><span class="icon-edit"></span>分配厂家</a>';
|
||||
|
||||
|
||||
|
||||
},
|
||||
"bSortable": false
|
||||
}
|
||||
],
|
||||
"oLanguage": {
|
||||
"sLengthMenu": "每页显示 _MENU_条",
|
||||
"sZeroRecords": "没有找到符合条件的数据",
|
||||
"sInfo": "当前第 _START_ - _END_ 条 共计 _TOTAL_ 条",
|
||||
"sProcessing": "<img src='<%=basePath%>static/css/images/loading.gif'>",
|
||||
"sInfoEmpty": "木有记录",
|
||||
"sInfoFiltered": "(从 _MAX_ 条记录中过滤)",
|
||||
"sSearch": "<input type='hidden' id='searchField' value='macAddress'/>mac地址:",
|
||||
"oPaginate": {
|
||||
"sFirst": "首页",
|
||||
"sPrevious": "前一页",
|
||||
"sNext": "后一页",
|
||||
"sLast": "尾页"
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#sSearch1').datepicker({
|
||||
format:"yyyy-mm-dd",
|
||||
language: 'cn'
|
||||
});
|
||||
|
||||
//重置
|
||||
$("#reset").click(function(){
|
||||
var searchClass = $(".searchClass");
|
||||
for (var i = 0; i < searchClass.length; i++) {
|
||||
$(searchClass[i]).val("");
|
||||
}
|
||||
dataTable.fnDraw();
|
||||
});
|
||||
|
||||
var isCheckAll = false;
|
||||
$("#All").click(function () {
|
||||
if (isCheckAll) {
|
||||
$('input[type="checkbox"][name="one"]').each(function (item, index) {
|
||||
this.checked = false;
|
||||
});
|
||||
isCheckAll = false;
|
||||
} else {
|
||||
$('input[type="checkbox"][name="one"]').each(function (item, index) {
|
||||
this.checked = true;
|
||||
});
|
||||
isCheckAll = true;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
//自动查询
|
||||
$("#searchTable").find("input,select").change(function(){
|
||||
dataTable.fnDraw();
|
||||
});
|
||||
//导入Excel
|
||||
$("#uploadBut").click(function(){
|
||||
$('#uploadExcel').modal("show");
|
||||
});
|
||||
//关闭
|
||||
$(".closeBtn").click(function(){
|
||||
$('.modal').modal("hide");
|
||||
});
|
||||
//异步提交表单
|
||||
$('#uploadForm').ajaxForm(function(data){
|
||||
//弹出ajax请求后的回调结果
|
||||
if(data==true){
|
||||
$('.modal').modal("hide");
|
||||
refreshTable();
|
||||
alert("导入成功");
|
||||
}
|
||||
else{
|
||||
alert("导入失败:"+data);
|
||||
}
|
||||
});
|
||||
//异步提交表单
|
||||
$('#fenpeiForm').ajaxForm(function(data){
|
||||
//弹出ajax请求后的回调结果
|
||||
if(data==true){
|
||||
//刷新当前页面
|
||||
$('.modal').modal("hide");
|
||||
refreshTable();
|
||||
jAlert('成功!', '提示');
|
||||
}
|
||||
else{
|
||||
//刷新当前页面
|
||||
refreshTable();
|
||||
jAlert('失败!', '提示');
|
||||
}
|
||||
});
|
||||
//异步提交表单
|
||||
$('#fenpeiSingleForm').ajaxForm(function(data){
|
||||
//弹出ajax请求后的回调结果
|
||||
if(data==true){
|
||||
//刷新当前页面
|
||||
$('.modal').modal("hide");
|
||||
refreshTable();
|
||||
jAlert('成功!', '提示');
|
||||
}
|
||||
else{
|
||||
//刷新当前页面
|
||||
refreshTable();
|
||||
jAlert('失败!', '提示');
|
||||
}
|
||||
});
|
||||
//异步提交表单
|
||||
$('#shouquanForm').ajaxForm(function(data){
|
||||
//弹出ajax请求后的回调结果
|
||||
if(data==true){
|
||||
//刷新当前页面
|
||||
$('.modal').modal("hide");
|
||||
refreshTable();
|
||||
jAlert('成功!', '提示');
|
||||
}
|
||||
else{
|
||||
//刷新当前页面
|
||||
refreshTable();
|
||||
jAlert('失败!', '提示');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//服务器返回数据
|
||||
function returnServerData(sSource, aoData, fnCallback){
|
||||
//查询参数
|
||||
var searchClass = $(".searchClass");
|
||||
for (var i = 0; i < searchClass.length; i++) {
|
||||
var id = $(searchClass[i]).attr("id");
|
||||
var value = $(searchClass[i]).val();
|
||||
aoData.push({"name":id,"value":value});
|
||||
}
|
||||
$.ajax({
|
||||
"url": sSource,
|
||||
"type": "POST",
|
||||
"data": aoData,
|
||||
"dataType": "json",
|
||||
"cache": false,
|
||||
"success": function(json){
|
||||
fnCallback(json);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//刷新当前页
|
||||
function refreshTable(){
|
||||
var iDisplayStart = dataTable.fnSettings()._iDisplayStart;
|
||||
var iDisplayLength = dataTable.fnSettings()._iDisplayLength;
|
||||
var pageNum = (iDisplayStart+iDisplayLength)/iDisplayLength;
|
||||
dataTable.fnPageChange(--pageNum,true);
|
||||
}
|
||||
|
||||
//重新分配
|
||||
function fenpeiDeviceOne(deviceId,fenpeiCode){
|
||||
$("#deviceId").val(deviceId);
|
||||
$("#createCode").val(fenpeiCode);
|
||||
$('#fenpei').modal("show");
|
||||
}
|
||||
function shouquanDeviceOne(deviceId) {
|
||||
$("#shouquanDevice").val(deviceId);
|
||||
$("#shouquanForm").submit();
|
||||
}
|
||||
|
||||
function shouquanDevice() {
|
||||
var devicesId = "";
|
||||
var checkSize = $('input[type=checkbox]:checked').length;
|
||||
if (checkSize == 0 ) {
|
||||
jAlert('请选择!', '提示');
|
||||
return;
|
||||
} else {
|
||||
$('input[type=checkbox]:checked').each(function (index, item) {
|
||||
devicesId = $(this).val() + "_" + devicesId;
|
||||
});
|
||||
$("#shouquanDevice").val(devicesId);
|
||||
$("#shouquanForm").submit();
|
||||
}
|
||||
}
|
||||
|
||||
//重新分配
|
||||
function fenpeiDevice(){
|
||||
var devicesId = "";
|
||||
var checkSize = $('input[type=checkbox]:checked').length;
|
||||
if (checkSize == 0 ) {
|
||||
jAlert('请选择!', '提示');
|
||||
return;
|
||||
} else {
|
||||
$('input[type=checkbox]:checked').each(function (index, item) {
|
||||
devicesId = $(this).val() + "_" + devicesId;
|
||||
});
|
||||
$("#deviceId").val(devicesId);
|
||||
$('#fenpei').modal("show");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- 头部 -->
|
||||
<%@ include file="../htm/header.jsp" %>
|
||||
<!-- 主体 -->
|
||||
<div class="main-container" id="main-container">
|
||||
<div class="main-container-inner">
|
||||
<!-- 侧边栏 -->
|
||||
<%@ include file="../htm/sidebar.jsp" %>
|
||||
<!-- 主体内容 -->
|
||||
<div class="main-content">
|
||||
<div class="breadcrumbs" id="breadcrumbs">
|
||||
<script type="text/javascript">
|
||||
try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
|
||||
</script>
|
||||
<ul class="breadcrumb">
|
||||
<li>
|
||||
<i class="icon-home home-icon"></i>
|
||||
<a href="<%=basePath%>page/public/index.do">首页</a>
|
||||
</li>
|
||||
<li class="active">硬件信息</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="page-content">
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="table-responsive">
|
||||
<table id="searchTable" class="col-xs-12">
|
||||
<tr>
|
||||
<td>
|
||||
<label>出厂日期</label>
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' id='sSearch1' class='input-medium date-picker' maxlength='20'/>
|
||||
</td>
|
||||
<td>
|
||||
<label>是否授权</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="selectField1" class="input-medium">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">NO</option>
|
||||
<option value="0">OK</option>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<label>是否分配</label>
|
||||
</td>
|
||||
<td>
|
||||
<select id="selectField2" class="input-medium">
|
||||
<option value="">请选择</option>
|
||||
<option value="1">是</option>
|
||||
<option value="0">否</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="8" style="text-align:center;">
|
||||
<button id="refresh" type="button" class="btn btn-sm btn-info" onclick="refreshTable();" style="margin-right:20px;"><i class="icon-refresh"></i>刷新</button>
|
||||
<button id="reset" type="reset" class="btn btn-sm btn-info" style="margin-right:20px;"><i class="icon-undo"></i>重置</button>
|
||||
<button id="authorizeBtn" type="button" onclick="shouquanDevice();" class="btn btn-sm btn-info" style="margin-right:20px;"><i class="icon-edit"></i>授权</button>
|
||||
<button id="fenpeiBtn" type="button" onclick="fenpeiDevice();" class="btn btn-sm btn-info" style="margin-right:20px;"><i class="icon-edit"></i>分配</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table id="sample-table-2" class="table table-striped table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="All" id="All" />全选</th>
|
||||
<th>MAC地址</th>
|
||||
<th>鱼缸厂</th>
|
||||
<th>硬件类型</th>
|
||||
<th>出厂日期</th>
|
||||
<th>分配日期</th>
|
||||
<th>分配编号</th>
|
||||
<th>激活时间</th>
|
||||
<th>最后登录</th>
|
||||
<th>登录次数</th>
|
||||
<th>授权时间</th>
|
||||
<th>授权状态</th>
|
||||
<th>分配厂家</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<form action="<%=basePath%>page/factory/uploadExcel.do" class="form-horizontal" method="post" enctype="multipart/form-data" id="uploadForm">
|
||||
<div class="modal fade" id="uploadExcel">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="closeBtn close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">导入Excel</h4>
|
||||
</div>
|
||||
<div class="modal-body row">
|
||||
<div class="col-xs-12">
|
||||
<div class="space-4"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-2 control-label no-padding-right">鱼缸厂<span style="color:red;">*</span></label>
|
||||
<div class="col-xs-8">
|
||||
<select name="brandCode" class="input-medium" required="required">
|
||||
<option value="">请选择</option>
|
||||
<c:forEach items="${list2}" var="vl">
|
||||
<option value="${vl.brandCode}">${vl.brandName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-4"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-2 control-label no-padding-right">Excel文件<span style="color:red;">*</span></label>
|
||||
<div class="col-xs-8">
|
||||
<input type="file" name="fileUpload" required="required">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="closeBtn btn btn-default">关闭</button>
|
||||
<button type="submit" class="btn btn-primary">导入</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form action="<%=basePath%>page/factory/deviceAuthorizeNew.do" class="form-horizontal" method="post" id="shouquanForm">
|
||||
<input type="hidden" name="deviceId" id="shouquanDevice" />
|
||||
|
||||
</form>
|
||||
<form action="<%=basePath%>page/factory/deviceFenpeiSingleNew.do" class="form-horizontal" method="post" id="fenpeiForm">
|
||||
<input type="hidden" name="deviceId" id="deviceId" />
|
||||
<div class="modal fade" id="fenpei">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="closeBtn close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<h4 class="modal-title">重新分配厂家</h4>
|
||||
</div>
|
||||
<div class="modal-body row">
|
||||
<div class="col-xs-12">
|
||||
<div class="form-group">
|
||||
<label class="col-xs-2 control-label no-padding-right">分配编号<span style="color:red;">*</span></label>
|
||||
<div class="col-xs-8">
|
||||
<input type="text" id="createCode" name="createCode" class="input-medium" required="required" maxlength="20">
|
||||
</div>
|
||||
</div>
|
||||
<div class="space-4"></div>
|
||||
<div class="form-group">
|
||||
<label class="col-xs-2 control-label no-padding-right">鱼缸厂<span style="color:red;">*</span></label>
|
||||
<div class="col-xs-8">
|
||||
<select name="brandCode" class="input-medium" required="required">
|
||||
<option value="">请选择</option>
|
||||
<c:forEach items="${list2}" var="vl">
|
||||
<option value="${vl.brandCode}">${vl.brandName}</option>
|
||||
</c:forEach>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="closeBtn btn btn-default">关闭</button>
|
||||
<button type="submit" id="fenpeiForm-submitBtn" class="btn btn-primary">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- 设置工具 -->
|
||||
<%@ include file="../htm/setting.jsp" %>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Reference in New Issue