1、增加用户配置和简单权限管理
2、增加取初始值,并在推送时减去初始值
This commit is contained in:
parent
aaa1740f13
commit
8df590a7ad
@ -8,4 +8,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
||||
public interface RtcmClient {
|
||||
@PostMapping("/config")
|
||||
HttpResp config(@RequestParam(name = "deviceId") String deviceId, @RequestParam(name = "configuration") String configData);
|
||||
|
||||
@PostMapping("/device_param_changed")
|
||||
HttpResp deviceParamChanged(@RequestParam(name = "deviceId") String deviceId);
|
||||
}
|
||||
|
||||
@ -55,15 +55,6 @@ public class GnssCalcData {
|
||||
@ExcelProperty("惯导位置天")
|
||||
Double r9250d;
|
||||
|
||||
@ExcelProperty("融合位置东")
|
||||
Double resulte;
|
||||
|
||||
@ExcelProperty("融合位置北")
|
||||
Double resultn;
|
||||
|
||||
@ExcelProperty("融合位置天")
|
||||
Double resultd;
|
||||
|
||||
@ExcelProperty("相对北斗位置东")
|
||||
Double rb562e;
|
||||
|
||||
|
||||
@ -31,6 +31,7 @@ public class GnssDevice {
|
||||
private LocalDateTime updatetime;
|
||||
private String updateuser;
|
||||
private String deviceid;
|
||||
private String fwddeviceid; //推送的设备名
|
||||
private String name;
|
||||
private String parentid;
|
||||
private Integer devicetype;
|
||||
@ -41,6 +42,9 @@ public class GnssDevice {
|
||||
private String fwd_group_id;
|
||||
private Boolean syn; //组参数是否同步
|
||||
private String pictures;
|
||||
private Double b562e; //初始位置
|
||||
private Double b562n; //初始位置
|
||||
private Double b562d; //初始位置
|
||||
|
||||
public String getObjectName(){
|
||||
return "gnssdevice";
|
||||
|
||||
@ -98,7 +98,7 @@ public class TCPClient {
|
||||
channel.writeAndFlush(sendBuffer).addListener(future -> {
|
||||
if (future.isSuccess()) {
|
||||
logger.info("send to xfz server succeed.");
|
||||
sendBuffer.release();
|
||||
//sendBuffer.release(); // writeAndFlush后就释放了
|
||||
} else {
|
||||
logger.info("send to xfz server failed.");
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||
public class Forwarder {
|
||||
String name;
|
||||
String description;
|
||||
Integer tenantId;
|
||||
|
||||
@Autowired
|
||||
private GnssDeviceMapper deviceMapper;
|
||||
@ -29,9 +30,10 @@ public class Forwarder {
|
||||
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
|
||||
|
||||
void init(String name, String desc){
|
||||
void init(String name, String desc, Integer tenantId){
|
||||
this.name = name;
|
||||
this.description = desc;
|
||||
this.tenantId = tenantId;
|
||||
QueryWrapper<GnssGroupFwd> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("name",name);
|
||||
GnssGroupFwd gnssGroupFwd = fwdMapper.selectOne(queryWrapper);
|
||||
@ -72,12 +74,21 @@ public class Forwarder {
|
||||
gnssQueryWrapper.eq("deviceid",device.getDeviceid());
|
||||
gnssQueryWrapper.ge("createtime",sendAfterTime);
|
||||
gnssQueryWrapper.orderByDesc("createtime");
|
||||
List<GnssCalcData> records = gnssDataMapper.selectList(gnssQueryWrapper);
|
||||
for(GnssCalcData record:records) {
|
||||
if (record.getEnabled()) {
|
||||
recordsToSend.add(record);
|
||||
break;
|
||||
gnssQueryWrapper.eq("enabled",true);
|
||||
gnssQueryWrapper.isNotNull("rb562e");
|
||||
gnssQueryWrapper.last("limit 1");
|
||||
GnssCalcData record = gnssDataMapper.selectOne(gnssQueryWrapper);
|
||||
if(record!=null) {
|
||||
// 替换成推送用的名字和数值
|
||||
if(device.getB562e()!=null &&
|
||||
device.getB562n()!=null &&
|
||||
device.getB562d()!=null){
|
||||
record.setRb562e(record.getRb562e()-device.getB562e());
|
||||
record.setRb562n(record.getRb562n()-device.getB562n());
|
||||
record.setRb562d(record.getRb562d()-device.getB562d());
|
||||
}
|
||||
if(device.getFwddeviceid()!=null) record.setDeviceid(device.getFwddeviceid());
|
||||
recordsToSend.add(record);
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +102,7 @@ public class Forwarder {
|
||||
// 记录推送
|
||||
FwdRecord fwdRecord = new FwdRecord();
|
||||
fwdRecord.setProject_id(entry.getKey());
|
||||
fwdRecord.setTenantid(1);
|
||||
fwdRecord.setTenantid(tenantId);
|
||||
fwdRecord.setDevicenum((short) entry.getValue().size());
|
||||
fwdRecord.setStarttime(nowTime);
|
||||
fwdRecord.setEndtime(nowTime);
|
||||
@ -114,14 +125,24 @@ public class Forwarder {
|
||||
List<FwdRecord> fwdRecordsList = fwdRecordsMapper.selectList(queryWrapper);
|
||||
// 2.检索这个这个时间段的解算结果,如果有数据则单个终端转发,标志记录为已补传
|
||||
for(FwdRecord fwdRecord:fwdRecordsList){
|
||||
// 查找device
|
||||
QueryWrapper<GnssDevice> deviceQueryWrapper = new QueryWrapper<>();
|
||||
deviceQueryWrapper.eq("fwd_group_id", fwdGroupId);
|
||||
deviceQueryWrapper.eq("deviceid", fwdRecord.getDeviceid());
|
||||
GnssDevice device = deviceMapper.selectOne(deviceQueryWrapper);
|
||||
if(device == null) continue;
|
||||
|
||||
// 查找位置记录
|
||||
QueryWrapper<GnssCalcData> calcDataQueryWrapper = new QueryWrapper<>();
|
||||
calcDataQueryWrapper.eq("deviceid", fwdRecord.getDeviceid());
|
||||
calcDataQueryWrapper.ge("createtime", fwdRecord.getStarttime());
|
||||
calcDataQueryWrapper.le("createtime", fwdRecord.getEndtime());
|
||||
calcDataQueryWrapper.orderByAsc("createtime");
|
||||
calcDataQueryWrapper.eq("enabled",true);
|
||||
calcDataQueryWrapper.isNotNull("rb562e");
|
||||
List<GnssCalcData> calcDataList = gnssDataMapper.selectList(calcDataQueryWrapper);
|
||||
// 推送记录
|
||||
if(sendBatch(fwdRecord.getProject_id(),calcDataList)>0) {
|
||||
if(sendBatch(device, fwdRecord.getProject_id(), calcDataList)>0) {
|
||||
// 记录推送结果
|
||||
fwdRecord.setState(FwdRecord.STATE_FWD_DONE);
|
||||
fwdRecordsMapper.updateById(fwdRecord);
|
||||
@ -129,16 +150,25 @@ public class Forwarder {
|
||||
}
|
||||
}
|
||||
|
||||
int sendBatch(String projectId, List<GnssCalcData> records){
|
||||
int sendBatch(GnssDevice device, String projectId, List<GnssCalcData> records){
|
||||
if(records.size() == 0) return 0;
|
||||
|
||||
LocalDateTime lastTime = records.get(0).getCreatetime();
|
||||
|
||||
for(GnssCalcData calcData:records){
|
||||
if(calcData.getEnabled() &&
|
||||
calcData.getCreatetime().isAfter(lastTime.plusMinutes(28))){
|
||||
if(calcData.getCreatetime().isAfter(lastTime.plusMinutes(28))){
|
||||
// 推送
|
||||
lastTime = calcData.getCreatetime();
|
||||
// 替换推送名和值
|
||||
if(device.getFwddeviceid()!=null)
|
||||
calcData.setDeviceid(device.getFwddeviceid());
|
||||
if(device.getB562e()!=null &&
|
||||
device.getB562n()!=null &&
|
||||
device.getB562d()!=null){
|
||||
calcData.setRb562e(calcData.getRb562e()-device.getB562e());
|
||||
calcData.setRb562n(calcData.getRb562n()-device.getB562n());
|
||||
calcData.setRb562d(calcData.getRb562d()-device.getB562d());
|
||||
}
|
||||
}
|
||||
else{
|
||||
calcData.setEnabled(false);//借用来表示不推送,不会保存到数据库
|
||||
|
||||
@ -37,7 +37,7 @@ public class GXXfzForwarder extends Forwarder{
|
||||
|
||||
@PostConstruct
|
||||
void registerMe(){
|
||||
init(FORWARDER_NAME, "TCP "+host+":"+port);
|
||||
init(FORWARDER_NAME, "TCP "+host+":"+port,1);
|
||||
xfzTcpClient = new TCPClient();
|
||||
xfzTcpClient.init(host, port);
|
||||
xfzTcpClient.start();
|
||||
@ -48,6 +48,7 @@ public class GXXfzForwarder extends Forwarder{
|
||||
*/
|
||||
@Scheduled(cron = "0 0/30 * * * ?") // 每30分钟执行一次
|
||||
private void forwardGnss() {
|
||||
logger.info("forwardGnss");
|
||||
forwardCurrentGnss(FORWARDER_NAME);
|
||||
}
|
||||
|
||||
@ -70,7 +71,6 @@ public class GXXfzForwarder extends Forwarder{
|
||||
xfzTcpMessage.setData(dataList);
|
||||
|
||||
for(GnssCalcData locationRecord: records) {
|
||||
if(!locationRecord.getEnabled() || locationRecord.getRb562e()==null) continue;
|
||||
XFZData.Data data = new XFZData.Data();
|
||||
dataList.add(data);
|
||||
data.setDataTime(locationRecord.getCreatetime().format(dateFormatter));
|
||||
|
||||
@ -33,14 +33,14 @@ public class GZYForwarder extends Forwarder{
|
||||
|
||||
@PostConstruct
|
||||
void registerMe(){
|
||||
init(FORWARDER_NAME, host+":"+port);
|
||||
init(FORWARDER_NAME, host+":"+port,2);
|
||||
udpClient = new UDPClient();
|
||||
udpClient.init(host, port);
|
||||
}
|
||||
/**
|
||||
* 每半小时转发GNSS解算结果
|
||||
*/
|
||||
@Scheduled(cron = "0 0/30 * * * ?") // 每30分钟执行一次
|
||||
@Scheduled(cron = "0 0/5 * * * ?") // 每30分钟执行一次
|
||||
private void forwardGnss() {
|
||||
forwardCurrentGnss(FORWARDER_NAME);
|
||||
}
|
||||
@ -61,7 +61,6 @@ public class GZYForwarder extends Forwarder{
|
||||
|
||||
|
||||
for(GnssCalcData locationRecord: records) {
|
||||
if(!locationRecord.getEnabled() || locationRecord.getRb562e()==null) continue;
|
||||
GZYData.Data tranData = new GZYData.Data();
|
||||
tranData.setCollectTime(locationRecord.getCreatetime().format(formatter));
|
||||
double n = NumberUtils.scale(locationRecord.getRb562n(), 2);
|
||||
|
||||
@ -43,7 +43,7 @@ public class KingMaForwarder extends Forwarder{
|
||||
|
||||
@PostConstruct
|
||||
void registerMe(){
|
||||
init(FORWARDER_NAME, data_host);
|
||||
init(FORWARDER_NAME, data_host,3);
|
||||
}
|
||||
/**
|
||||
* 每半小时转发GNSS解算结果
|
||||
@ -101,7 +101,6 @@ public class KingMaForwarder extends Forwarder{
|
||||
List<KingMaData> dataList = new ArrayList<>(records.size());
|
||||
|
||||
for(GnssCalcData locationRecord: records) {
|
||||
if(!locationRecord.getEnabled() || locationRecord.getRb562e()==null) continue;
|
||||
KingMaData data = new KingMaData();
|
||||
data.setDataTime(locationRecord.getCreatetime().toString());
|
||||
data.setProjectId(projectId);
|
||||
|
||||
@ -21,13 +21,15 @@ app.format.datetime = yyyy-MM-dd HH:mm:ss
|
||||
|
||||
mybatis-plus.configuration.map-underscore-to-camel-case=false
|
||||
|
||||
xfz.server.host = 171.106.48.63
|
||||
xfz.server.port = 52000
|
||||
#xfz.server.host = 115.236.153.174
|
||||
#xfz.server.port = 31035
|
||||
#xfz.server.host = 171.106.48.63
|
||||
#xfz.server.port = 52000
|
||||
xfz.server.host = 115.236.153.174
|
||||
xfz.server.port = 31035
|
||||
|
||||
gzy.server.host = 8.134.84.223
|
||||
gzy.server.port = 8088
|
||||
#gzy.server.host = 8.134.84.223
|
||||
#gzy.server.port = 8088
|
||||
gzy.server.host = 127.0.0.1
|
||||
gzy.server.port = 18088
|
||||
|
||||
kingma.server.login_user = ceshi
|
||||
kingma.server.login_pwd = ceshi!123
|
||||
|
||||
@ -65,6 +65,7 @@ public class GNSSCalcFilterService {
|
||||
// 平滑处理
|
||||
calcFilterLocation(locationRecord, filterCycle,
|
||||
groupCalc.getXy_threshold(), groupCalc.getZ_threshold());
|
||||
|
||||
repository.insert(locationRecord);
|
||||
|
||||
// 更新平滑周期
|
||||
@ -101,6 +102,7 @@ public class GNSSCalcFilterService {
|
||||
query.eq("deviceid", deviceId);
|
||||
query.ge("createtime", filterAfterTime.format(dateFormatter));
|
||||
query.le("createtime", newRecordTime.format(dateFormatter));
|
||||
//query.eq("enabled", true);// 坏点参与比较,不参与滤波
|
||||
query.orderByDesc("createtime");
|
||||
|
||||
List<GnssCalcData> gnssDeviceLocationRecords = repository.selectList(query);
|
||||
@ -174,11 +176,12 @@ public class GNSSCalcFilterService {
|
||||
QueryWrapper<GnssCalcData> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("deviceid", deviceId);
|
||||
queryWrapper.le("createtime",cmpTime.format(dateFormatter));
|
||||
queryWrapper.last("limit 3");
|
||||
queryWrapper.eq("enabled",true);
|
||||
queryWrapper.isNotNull("rb562e");
|
||||
queryWrapper.last("limit 1");
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
List<GnssCalcData> gnssCalcDataList = repository.selectList(queryWrapper);
|
||||
for (GnssCalcData gnssCalcData:gnssCalcDataList) {
|
||||
if (gnssCalcData.getEnabled() && gnssCalcData.getRb562e() != null) {
|
||||
GnssCalcData gnssCalcData = repository.selectOne(queryWrapper);
|
||||
if (gnssCalcData != null) {
|
||||
double gapE = Math.abs(gnssCalcData.getRb562e() - curCalcData.getRb562e());
|
||||
double gapN = Math.abs(gnssCalcData.getRb562n() - curCalcData.getRb562n());
|
||||
if (gapE >= groupCalc.getAuto_threshold() || gapN >= groupCalc.getAuto_threshold()) {
|
||||
@ -188,8 +191,6 @@ public class GNSSCalcFilterService {
|
||||
autoCycleDevices.put(deviceId, varyCycle1);
|
||||
logger.info(deviceId + ": filter cycle change to " + varyCycle1.filterCycleHour);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -206,20 +207,19 @@ public class GNSSCalcFilterService {
|
||||
query.eq("deviceid", deviceId);
|
||||
query.le("createtime", beforTime.format(dateFormatter));
|
||||
query.ge("createtime", afterTime.format(dateFormatter));
|
||||
//query.eq("enabled",true); //好点坏点重新判断
|
||||
query.orderByAsc("createtime");
|
||||
|
||||
LocalDateTime lastTime = afterTime;
|
||||
|
||||
List<GnssCalcData> calcDataListToUpdate = repository.selectList(query);
|
||||
for(GnssCalcData calcData:calcDataListToUpdate){
|
||||
if(calcData.getEnabled()) {
|
||||
calcFilterLocation(calcData, groupCalc.getFilter_hour(),
|
||||
groupCalc.getXy_threshold(), groupCalc.getZ_threshold());
|
||||
repository.updateById(calcData);
|
||||
lastTime = calcData.getCreatetime();
|
||||
logger.info(deviceId + " update rb562");
|
||||
}
|
||||
}
|
||||
return lastTime;
|
||||
}
|
||||
}
|
||||
|
||||
@ -169,10 +169,6 @@ public class SingleLineGNSSCalcService implements GNSSDataCalcService {
|
||||
locationRecord.setB562n(b562Result[1] * 10);
|
||||
locationRecord.setB562d(b562Result[2] * 10);
|
||||
|
||||
locationRecord.setResulte(result[0]);
|
||||
locationRecord.setResultn(result[1]);
|
||||
locationRecord.setResultd(result[2]);
|
||||
|
||||
if(r9250Result!=null) {
|
||||
locationRecord.setR9250e(r9250Result[0]);
|
||||
locationRecord.setR9250n(r9250Result[1]);
|
||||
|
||||
@ -48,4 +48,10 @@ public class LocalDeviceServiceImpl implements DeviceService {
|
||||
return device;
|
||||
}
|
||||
|
||||
public void refresh(String deviceId){
|
||||
Device device = delegate.findByDeviceId(deviceId);
|
||||
if (device != null) {
|
||||
deviceCache.put(deviceId, device);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.imdroid.sideslope.web;
|
||||
|
||||
import com.imdroid.secapi.client.HttpResp;
|
||||
import com.imdroid.sideslope.sal.LocalDeviceServiceImpl;
|
||||
import com.imdroid.sideslope.server.DeviceChannel;
|
||||
import com.imdroid.sideslope.server.OnlineChannels;
|
||||
import com.imdroid.common.util.DataTypeUtil;
|
||||
@ -8,6 +9,7 @@ import io.netty.buffer.ByteBuf;
|
||||
import io.netty.buffer.Unpooled;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@ -25,6 +27,9 @@ public class ApiController {
|
||||
|
||||
private final Logger logger = LoggerFactory.getLogger(ApiController.class);
|
||||
|
||||
@Autowired
|
||||
LocalDeviceServiceImpl localDeviceService;
|
||||
|
||||
@PostMapping(value = "/config")
|
||||
public HttpResp config(String deviceId, String configuration) {
|
||||
Map<String, Object> status = new HashMap<>();
|
||||
@ -53,14 +58,15 @@ public class ApiController {
|
||||
return resp;
|
||||
}
|
||||
|
||||
/*@RequestMapping(value = "/clean-tilt")
|
||||
public HttpResp config(String deviceId) {
|
||||
// 清空指定设备的惯导值
|
||||
gnssCalcService.cleanTiltByDeviceId(deviceId);
|
||||
@PostMapping("/device_param_changed")
|
||||
public HttpResp deviceParamChanged(String deviceId) {
|
||||
// 更新设备缓存
|
||||
localDeviceService.refresh(deviceId);
|
||||
|
||||
HttpResp resp = new HttpResp();
|
||||
resp.setResponseMessage("succeed");
|
||||
return resp;
|
||||
}*/
|
||||
}
|
||||
|
||||
private static byte[] getBinaryData(ConfigDataTypeEnum dataTypeEnum, String text) {
|
||||
if (dataTypeEnum == ConfigDataTypeEnum.HEX) {
|
||||
|
||||
@ -26,7 +26,7 @@ public class SessionUtils {
|
||||
public static void setCurrentUser(HttpServletRequest request, User user, Tenant tenant) {
|
||||
HttpSession session = request.getSession();
|
||||
session.setAttribute(SESSION_CURRENT_USER, user.getName());
|
||||
session.setAttribute(SESSION_TENANT_ID, user.getTenant_id());
|
||||
session.setAttribute(SESSION_TENANT_ID, user.getTenantid());
|
||||
session.setAttribute(SESSION_TENANT_NAME, tenant.getName());
|
||||
session.setAttribute(SESSION_ROLE, user.getRole());
|
||||
session.setAttribute(SESSION_CURRENT_USER_ID, user.getId());
|
||||
|
||||
@ -9,7 +9,9 @@ package com.imdroid.beidou.common;
|
||||
*/
|
||||
|
||||
public class Role {
|
||||
public static final String SUPER_ADMIN = "SUPER_ADMIN";
|
||||
public static final String ADMIN = "ADMIN";
|
||||
|
||||
public static final String MANAGER = "MANAGER";
|
||||
public static final String USER = "USER";
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.imdroid.beidou.service.CommonExcelService;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@ -22,7 +23,8 @@ public class GnssCalcDataController extends BasicController implements CommonExc
|
||||
GnssCalcDataMapper dataMapper;
|
||||
|
||||
@RequestMapping("/page/gnss_data_calc")
|
||||
public String gnssData() {
|
||||
public String gnssData(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/gnss_data_calc";
|
||||
}
|
||||
|
||||
|
||||
@ -38,6 +38,8 @@ public class GnssDeviceController extends BasicController{
|
||||
TenantMapper tenantMapper;
|
||||
@Autowired
|
||||
private GnssStatusMapper gnssStatusMapper;
|
||||
@Autowired
|
||||
GnssCalcDataMapper gnssCalcDataMapper;
|
||||
|
||||
@Autowired
|
||||
RtcmClient rtcmClient;
|
||||
@ -158,10 +160,31 @@ public class GnssDeviceController extends BasicController{
|
||||
} else {
|
||||
// 更新组参数的关联个数
|
||||
updateBasicGroupAssociatedNum(device,old_device);
|
||||
rtcmClient.deviceParamChanged(device.getDeviceid());
|
||||
return HttpResult.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/gnss/device/init_loc")
|
||||
@ResponseBody
|
||||
public JSONObject initLoc(@RequestParam String deviceid){
|
||||
QueryWrapper<GnssCalcData> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("deviceid",deviceid);
|
||||
queryWrapper.eq("enabled",1);
|
||||
queryWrapper.orderByDesc("createtime");
|
||||
queryWrapper.last("limit 1");
|
||||
queryWrapper.isNotNull("rb562e");
|
||||
GnssCalcData calcData = gnssCalcDataMapper.selectOne(queryWrapper);
|
||||
if(calcData != null){
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("b562e",calcData.getRb562e());
|
||||
jsonObject.put("b562n",calcData.getRb562n());
|
||||
jsonObject.put("b562d",calcData.getRb562d());
|
||||
return jsonObject;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
void updateBasicGroupAssociatedNum(GnssDevice newCfg, GnssDevice oldCfg){
|
||||
updateBasicGroupAssociatedNum(newCfg.getGroup_id());
|
||||
updateCalcGroupAssociatedNum(newCfg.getCalc_group_id());
|
||||
|
||||
@ -4,13 +4,18 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.imdroid.beidou.auth.SessionUtils;
|
||||
import com.imdroid.beidou.entity.Tenant;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
@Controller
|
||||
public class GnssFwdController {
|
||||
public class GnssFwdController extends BasicController{
|
||||
@Autowired
|
||||
GnssGroupFwdMapper gnssGroupFwdMapper;
|
||||
@Autowired
|
||||
@ -18,12 +23,14 @@ public class GnssFwdController {
|
||||
|
||||
/********* 推送页面 *********/
|
||||
@RequestMapping("/page/fwd_agents")
|
||||
public String fwdAgents() {
|
||||
public String fwdAgents(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/fwd_agents";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/fwd_records")
|
||||
public String fwdRecords() {
|
||||
public String fwdRecords(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/fwd_records";
|
||||
}
|
||||
|
||||
@ -44,10 +51,14 @@ public class GnssFwdController {
|
||||
|
||||
@RequestMapping("/fwd/records")
|
||||
@ResponseBody
|
||||
public JSONObject listRecords(int page, int limit) {
|
||||
public JSONObject listRecords(HttpSession session, int page, int limit) {
|
||||
Page<FwdRecord> pageable = new Page<>(page, limit);
|
||||
QueryWrapper<FwdRecord> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.orderByDesc("starttime");
|
||||
Integer tenantId = (Integer) session.getAttribute(SessionUtils.SESSION_TENANT_ID);
|
||||
if (tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
}
|
||||
IPage<FwdRecord> cs = fwdRecordMapper.selectPage(pageable, queryWrapper);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
|
||||
@ -7,10 +7,13 @@ import com.imdroid.beidou.common.HttpResult;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
@Controller
|
||||
public class GnssGroupController {
|
||||
public class GnssGroupController extends BasicController {
|
||||
@Autowired
|
||||
GnssGroupMapper gnssGroupMapper;
|
||||
@Autowired
|
||||
@ -21,17 +24,20 @@ public class GnssGroupController {
|
||||
|
||||
/********* 推送页面 *********/
|
||||
@RequestMapping("/page/table/gnss_add_group")
|
||||
public String gnssAddGroup() {
|
||||
public String gnssAddGroup(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/table/gnss_add_group";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/table/gnss_add_group_calc")
|
||||
public String gnssAddCalcGroup() {
|
||||
public String gnssAddCalcGroup(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/table/gnss_add_group_calc";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/gnss_group_cfg")
|
||||
public String gnssGroupCfg() {
|
||||
public String gnssGroupCfg(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/gnss_group_cfg";
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import com.imdroid.beidou.service.CommonExcelService;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@ -24,7 +25,8 @@ public class GnssMsgController extends BasicController implements CommonExcelSer
|
||||
|
||||
/**** 推送页面 *****/
|
||||
@RequestMapping("/page/gnss_msg")
|
||||
public String gnssMsg(){
|
||||
public String gnssMsg(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/gnss_msg";
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import com.imdroid.secapi.dto.GnssStatusMsg;
|
||||
import com.imdroid.secapi.dto.GnssStatusMsgMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@ -27,7 +28,8 @@ public class GnssMsgStatusController extends BasicController implements CommonEx
|
||||
private final GnssStatusMsgMapper statusMsgMapper;
|
||||
|
||||
@RequestMapping("/page/gnss_msg_status")
|
||||
public String gnssStatusMsg() {
|
||||
public String gnssStatusMsg(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/gnss_msg_status";
|
||||
}
|
||||
|
||||
|
||||
@ -7,6 +7,7 @@ import com.imdroid.secapi.dto.GnssTrxMsg;
|
||||
import com.imdroid.secapi.dto.GnssTrxMsgMapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
@ -27,7 +28,8 @@ public class GnssMsgTrxController extends BasicController implements CommonExcel
|
||||
private final GnssTrxMsgMapper trxMsgMapper;
|
||||
|
||||
@RequestMapping("/page/gnss_msg_trx")
|
||||
public String gnssTrxMsg(){
|
||||
public String gnssTrxMsg(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/gnss_msg_trx";
|
||||
}
|
||||
|
||||
|
||||
@ -9,6 +9,7 @@ import com.imdroid.secapi.dto.GnssRawData;
|
||||
import com.imdroid.secapi.dto.GnssRawDataMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
@ -20,7 +21,8 @@ public class GnssRawDataController extends BasicController{
|
||||
@Autowired
|
||||
GnssRawDataMapper dataMapper;
|
||||
@RequestMapping("/page/gnss_data_raw")
|
||||
public String gnssDataRaw() {
|
||||
public String gnssDataRaw(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/gnss_data_raw";
|
||||
}
|
||||
|
||||
|
||||
@ -101,4 +101,9 @@ public class GnssStatusController extends BasicController implements CommonExcel
|
||||
public boolean isJoinSelect() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String tenantIdField() {
|
||||
return "d.tenantid";
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,23 +1,29 @@
|
||||
package com.imdroid.beidou.controller;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
@Controller
|
||||
public class IndexController extends BasicController{
|
||||
|
||||
@RequestMapping("/")
|
||||
public String index0() {
|
||||
public String index0(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/index";
|
||||
}
|
||||
|
||||
@RequestMapping("/index")
|
||||
public String index() {
|
||||
public String index(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/index";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/device_overview")
|
||||
public String deviceOverview() {
|
||||
public String deviceOverview(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/device_overview";
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ public class LoginController {
|
||||
if (user == null) {
|
||||
return HttpResult.fail(HttpResult.HTTP_RSP_USER_NOT_EXIST, "用户不存在");
|
||||
}
|
||||
Tenant tenant = tenantMapper.selectById(user.getTenant_id());
|
||||
Tenant tenant = tenantMapper.selectById(user.getTenantid());
|
||||
SessionUtils.setCurrentUser(request, user, tenant);
|
||||
|
||||
return HttpResult.success(buildMiniUser(user, tenant));
|
||||
@ -72,7 +72,7 @@ public class LoginController {
|
||||
if (!bCryptPasswordEncoderUtil.matches(userLoginVO.getPassword(), user.getPassword())) {
|
||||
return HttpResult.fail("用户名或密码错误");
|
||||
}
|
||||
Tenant tenant = tenantMapper.selectById(user.getTenant_id());
|
||||
Tenant tenant = tenantMapper.selectById(user.getTenantid());
|
||||
SessionUtils.setCurrentUser(request, user, tenant);
|
||||
//response.sendRedirect("/index"); //发这条没用,会导致login.html收不到应答,也跳转不了
|
||||
HttpResult rsp = HttpResult.success(null);
|
||||
|
||||
@ -5,18 +5,11 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.imdroid.beidou.common.HttpResult;
|
||||
import com.imdroid.beidou.data.vo.device.DeviceInstallVO;
|
||||
import com.imdroid.beidou.data.vo.device.DeviceListVO;
|
||||
import com.imdroid.beidou.data.vo.device.DeviceStatusVO;
|
||||
import com.imdroid.beidou.entity.Tenant;
|
||||
import com.imdroid.beidou.entity.TenantMapper;
|
||||
import com.imdroid.secapi.client.RtcmClient;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
@ -38,12 +31,14 @@ public class TenantController extends BasicController{
|
||||
}
|
||||
|
||||
@RequestMapping("/sys/tenant/add")
|
||||
public String addTenant(Model m){
|
||||
public String addTenant(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/table/tenant_add";
|
||||
}
|
||||
|
||||
@RequestMapping("/sys/tenant/edit")
|
||||
public String editTenant(Model m){
|
||||
public String editTenant(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/table/tenant_add";
|
||||
}
|
||||
|
||||
|
||||
@ -1,28 +1,124 @@
|
||||
package com.imdroid.beidou.controller;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.imdroid.beidou.common.HttpResult;
|
||||
import com.imdroid.beidou.entity.Tenant;
|
||||
import com.imdroid.beidou.entity.TenantMapper;
|
||||
import com.imdroid.beidou.entity.User;
|
||||
import com.imdroid.beidou.entity.UserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpSession;
|
||||
import java.util.List;
|
||||
|
||||
@Controller
|
||||
public class UserController extends BasicController {
|
||||
|
||||
@Value("${default_pwd}")
|
||||
private String default_pwd;
|
||||
@Autowired
|
||||
UserMapper userMapper;
|
||||
|
||||
@Autowired
|
||||
TenantMapper tenantMapper;
|
||||
/**** 推送页面 *****/
|
||||
@RequestMapping("/page/user_pwd")
|
||||
public String warning() throws Exception {
|
||||
public String userPwd() throws Exception {
|
||||
return "/page/user_pwd";
|
||||
}
|
||||
|
||||
@RequestMapping("/sys/user")
|
||||
public String listUser(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/user_cfg";
|
||||
}
|
||||
|
||||
@RequestMapping("/sys/user/add")
|
||||
public String addUser(Model m, HttpSession session){
|
||||
initModel(m, session);
|
||||
|
||||
List<Tenant> tenants = tenantMapper.selectList(null);
|
||||
m.addAttribute("tenant_list", tenants);
|
||||
|
||||
return "/page/table/user_add";
|
||||
}
|
||||
|
||||
@RequestMapping("/sys/user/edit")
|
||||
public String editUser(Model m, HttpSession session){
|
||||
initModel(m, session);
|
||||
List<Tenant> tenants = tenantMapper.selectList(null);
|
||||
m.addAttribute("tenant_list", tenants);
|
||||
return "/page/table/user_add";
|
||||
}
|
||||
|
||||
/**** 推送数据 *****/
|
||||
@RequestMapping("/sys/user/list")
|
||||
@ResponseBody
|
||||
public JSONObject list(HttpSession session, int page, int limit, String searchParams) {
|
||||
Page<User> pageable = new Page<>(page, limit);
|
||||
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
IPage<User> cs = userMapper.selectPage(pageable, queryWrapper);
|
||||
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("code", 0);
|
||||
jsonObject.put("msg", "");
|
||||
jsonObject.put("count", cs.getTotal());
|
||||
jsonObject.put("data", cs.getRecords());
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@PostMapping("/sys/user/update")
|
||||
@ResponseBody
|
||||
public String update(HttpSession session, @RequestBody JSONObject object) throws Exception {
|
||||
// 从请求参数中创建对象
|
||||
User userNew = JSONObject.toJavaObject(object,User.class);
|
||||
QueryWrapper<Tenant> tenantQueryWrapper = new QueryWrapper<>();
|
||||
tenantQueryWrapper.eq("name", userNew.getTenantname());
|
||||
Tenant tenant = tenantMapper.selectOne(tenantQueryWrapper);
|
||||
if(tenant==null) return HttpResult.result(2, "invalid tenant");
|
||||
userNew.setTenantid(tenant.getId());
|
||||
|
||||
// 检测该对象是否已存在
|
||||
QueryWrapper<User> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("name", userNew.getName());
|
||||
queryWrapper.eq("tenantname",userNew.getTenantname());
|
||||
queryWrapper.last("limit 1");
|
||||
User userOld = userMapper.selectOne(queryWrapper);
|
||||
//新增或更新
|
||||
int num = 0;
|
||||
if(null != userOld) {
|
||||
userNew.setId(userOld.getId());
|
||||
num = userMapper.updateById(userNew);
|
||||
}
|
||||
else{
|
||||
userNew.setPwd(new BCryptPasswordEncoder().encode(default_pwd));
|
||||
num = userMapper.insert(userNew); //id自增
|
||||
}
|
||||
if (num == 0) {
|
||||
return HttpResult.failed();
|
||||
} else {
|
||||
return HttpResult.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@PostMapping("/sys/user/delete")
|
||||
@ResponseBody
|
||||
public String delete(@RequestParam String name) throws Exception {
|
||||
QueryWrapper<User> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("name",name);
|
||||
int num = userMapper.delete(wrapper);
|
||||
if (num == 0) {
|
||||
return HttpResult.failed();
|
||||
} else return HttpResult.ok();
|
||||
}
|
||||
|
||||
/**** 推送数据 *****/
|
||||
@PostMapping("/personal/update_pwd")
|
||||
@ResponseBody
|
||||
|
||||
@ -6,13 +6,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.imdroid.beidou.common.HttpResult;
|
||||
import com.imdroid.beidou.entity.Tenant;
|
||||
import com.imdroid.beidou.service.CommonExcelService;
|
||||
import com.imdroid.secapi.dto.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.util.StringUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
@ -46,12 +44,14 @@ public class WarningController extends BasicController implements CommonExcelSer
|
||||
|
||||
/**** 推送页面 *****/
|
||||
@RequestMapping("/page/warning")
|
||||
public String warning() throws Exception {
|
||||
public String warning(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/warning";
|
||||
}
|
||||
|
||||
@RequestMapping("/page/warning_cfg")
|
||||
public String warningCfg() {
|
||||
public String warningCfg(Model m, HttpSession session) {
|
||||
initModel(m, session);
|
||||
return "/page/warning_cfg";
|
||||
}
|
||||
|
||||
@ -75,7 +75,6 @@ public class WarningController extends BasicController implements CommonExcelSer
|
||||
* @param session HttpSession
|
||||
* @param request HttpServletRequest
|
||||
* @param response HttpServletResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
@RequestMapping("/warning/export")
|
||||
@ResponseBody
|
||||
|
||||
@ -16,13 +16,14 @@ public class User {
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
int tenant_id;
|
||||
Integer tenantid;
|
||||
String tenantname;
|
||||
private String name;
|
||||
private String pwd;
|
||||
String role;
|
||||
private boolean locked;
|
||||
private Boolean locked;
|
||||
private String nickname;
|
||||
private boolean init_pwd=true;
|
||||
private Boolean init_pwd=true;
|
||||
private String mobile;
|
||||
private String avatar_url;
|
||||
private String openid;
|
||||
|
||||
@ -84,6 +84,10 @@ public interface CommonExcelService<T, R> {
|
||||
return false;
|
||||
}
|
||||
|
||||
default String tenantIdField() {
|
||||
return "tenantid";
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
@ -100,7 +104,7 @@ public interface CommonExcelService<T, R> {
|
||||
|
||||
Integer tenantId = (Integer) session.getAttribute(SessionUtils.SESSION_TENANT_ID);
|
||||
if (tenantId != null && tenantId != Tenant.SAAS_PROVIDER_ID) {
|
||||
queryWrapper.eq("tenantid", tenantId);
|
||||
queryWrapper.eq(tenantIdField(), tenantId);
|
||||
}
|
||||
|
||||
// 条件查询
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.imdroid.beidou.service;
|
||||
|
||||
|
||||
import com.imdroid.beidou.common.Role;
|
||||
import com.imdroid.beidou.entity.Tenant;
|
||||
import com.imdroid.beidou.entity.TenantMapper;
|
||||
import com.imdroid.beidou.entity.User;
|
||||
@ -58,8 +59,9 @@ public class ServiceEnvInit implements ApplicationRunner {
|
||||
user.setId(0L);
|
||||
user.setName(default_user_name);
|
||||
user.setPwd(bCryptPasswordEncoderUtil.encode(default_pwd));
|
||||
user.setRole("ADMIN");
|
||||
user.setTenant_id(Tenant.SAAS_PROVIDER_ID);
|
||||
user.setRole(Role.SUPER_ADMIN);
|
||||
user.setTenantid(Tenant.SAAS_PROVIDER_ID);
|
||||
user.setTenantname(Tenant.SAAS_PROVIDER_NAME);
|
||||
userMapper.insert(user);
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
CREATE TABLE IF NOT EXISTS `UserCfg` (
|
||||
`id` bigint(20) AUTO_INCREMENT,
|
||||
`tenant_id` int DEFAULT 0,
|
||||
`tenantid` int DEFAULT 0,
|
||||
`tenantname` varchar(100) NOT NULL,
|
||||
`name` varchar(20) NOT NULL,
|
||||
`pwd` varchar(64) NOT NULL,
|
||||
`role` varchar(24) NOT NULL,
|
||||
@ -42,6 +43,7 @@ CREATE TABLE IF NOT EXISTS `gnssdevices` (
|
||||
`updatetime` datetime DEFAULT NULL,
|
||||
`updateuser` varchar(50) DEFAULT NULL,
|
||||
`deviceid` varchar(20) NOT NULL,
|
||||
`fwddeviceid` varchar(40) NOT NULL,
|
||||
`name` varchar(50) NOT NULL,
|
||||
`parentid` varchar(20) DEFAULT NULL,
|
||||
`devicetype` smallint DEFAULT 0,
|
||||
@ -52,6 +54,9 @@ CREATE TABLE IF NOT EXISTS `gnssdevices` (
|
||||
`fwd_group_id` varchar(64) DEFAULT NULL,
|
||||
`syn` bit(1) DEFAULT 0 COMMENT '是否已同步',
|
||||
`pictures` varchar(100) DEFAULT NULL,
|
||||
`b562e` double DEFAULT NULL COMMENT '初始位置东E',
|
||||
`b562n` double DEFAULT NULL COMMENT '初始位置北N',
|
||||
`b562d` double DEFAULT NULL COMMENT '初始位置天D',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
@ -132,9 +137,6 @@ CREATE TABLE IF NOT EXISTS `gnssdevicelocationrecords` (
|
||||
`r9250e` double DEFAULT NULL,
|
||||
`r9250n` double DEFAULT NULL,
|
||||
`r9250d` double DEFAULT NULL,
|
||||
`resulte` double DEFAULT NULL,
|
||||
`resultn` double DEFAULT NULL,
|
||||
`resultd` double DEFAULT NULL,
|
||||
`rb562e` double DEFAULT NULL COMMENT '相对北斗位置东E',
|
||||
`rb562d` double DEFAULT NULL COMMENT '相对北斗位置北N',
|
||||
`rb562n` double DEFAULT NULL COMMENT '相对北斗位置天D',
|
||||
|
||||
@ -147,7 +147,7 @@
|
||||
},
|
||||
{
|
||||
"title": "用户管理",
|
||||
"href": "",
|
||||
"href": "sys/user",
|
||||
"icon": "fa fa-user",
|
||||
"target": "_self"
|
||||
},
|
||||
|
||||
@ -0,0 +1,95 @@
|
||||
{
|
||||
"homeInfo": {
|
||||
"title": "首页",
|
||||
"href": "page/device_overview"
|
||||
},
|
||||
"logoInfo": {
|
||||
"title": "形变监测平台",
|
||||
"image": "images/logo.png",
|
||||
"href": ""
|
||||
},
|
||||
"menuInfo": [
|
||||
{
|
||||
"title": "设备管理",
|
||||
"icon": "fa fa-address-book",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "设备总览",
|
||||
"href": "page/device_overview",
|
||||
"icon": "fa fa-home",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "运行状态",
|
||||
"href": "page/gnss_status",
|
||||
"icon": "fa fa-tachometer",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "告警管理",
|
||||
"href": "",
|
||||
"icon": "fa fa-bell-o",
|
||||
"target": "",
|
||||
"child": [
|
||||
{
|
||||
"title": "告警消息",
|
||||
"href": "page/warning",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "解算结果",
|
||||
"href": "page/gnss_data_calc",
|
||||
"icon": "fa fa-calculator",
|
||||
"target": "_self"
|
||||
},
|
||||
{
|
||||
"title": "配置管理",
|
||||
"href": "",
|
||||
"icon": "fa fa-gear",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "设备参数",
|
||||
"href": "page/gnss_dev_cfg",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "数据推送",
|
||||
"href": "",
|
||||
"icon": "fa fa-send-o",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "推送记录",
|
||||
"href": "page/fwd_records",
|
||||
"icon": "fa fa-minus",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "系统管理",
|
||||
"icon": "fa fa-lemon-o",
|
||||
"href": "",
|
||||
"target": "_self",
|
||||
"child": [
|
||||
{
|
||||
"title": "操作日志",
|
||||
"href": "",
|
||||
"icon": "fa fa-pencil-square-o",
|
||||
"target": "_self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -58,7 +58,7 @@
|
||||
<a href="javascript:;" data-check-screen="full"><i class="fa fa-arrows-alt"></i></a>
|
||||
</li>
|
||||
<li class="layui-nav-item layuimini-setting">
|
||||
<a href="javascript:;">admin</a>
|
||||
<a href="javascript:;" th:text="${login_user}">admin</a>
|
||||
<dl class="layui-nav-child">
|
||||
<dd>
|
||||
<a href="javascript:;" layuimini-content-href="page/user-password" data-title="修改密码" data-icon="fa fa-gears">修改密码</a>
|
||||
@ -124,15 +124,22 @@
|
||||
</div>
|
||||
<script src="lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
<script src="js/lay-config.js?v=2.0.0" charset="utf-8"></script>
|
||||
<script>
|
||||
layui.use(['jquery', 'layer', 'miniAdmin','miniTongji'], function () {
|
||||
<script th:inline="javascript">
|
||||
layui.use(['jquery', 'layer', 'miniAdmin'], function () {
|
||||
var $ = layui.jquery,
|
||||
layer = layui.layer,
|
||||
miniAdmin = layui.miniAdmin,
|
||||
miniTongji = layui.miniTongji;
|
||||
miniAdmin = layui.miniAdmin;
|
||||
|
||||
var nav_url;
|
||||
if([[${role}]] == "SUPER_ADMIN" || [[${role}]] == "ADMIN") {
|
||||
nav_url = "api/init.json";
|
||||
}
|
||||
else {
|
||||
nav_url = "api/init_enterprise.json"
|
||||
}
|
||||
|
||||
var options = {
|
||||
iniUrl: "api/init.json", // 初始化接口
|
||||
iniUrl: nav_url, // 初始化接口
|
||||
clearUrl: "api/clear.json", // 缓存清理接口
|
||||
urlHashLocation: true, // 是否打开hash定位
|
||||
bgColorDefault: false, // 主题默认配置
|
||||
@ -146,7 +153,7 @@
|
||||
|
||||
$('.login-out').on("click", function () {
|
||||
layer.msg('退出登录成功', function () {
|
||||
window.location = 'page/login';
|
||||
window.location = 'login';
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -30,6 +30,7 @@
|
||||
elem: '#forwardParaTableId',
|
||||
url: '/fwd/records',
|
||||
toolbar: '#toolbarTable',
|
||||
defaultToolbar: ['filter'],
|
||||
cols: [[
|
||||
{field: 'project_id', title: '项目号', sort: true},
|
||||
{field: 'devicenum', title: '推送设备数'},
|
||||
|
||||
@ -82,6 +82,8 @@
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/data/list_calc',
|
||||
toolbar: '#toolbarDemo', //开启头部工具栏
|
||||
defaultToolbar: ['filter'],
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
{field: 'createtime', title: '产生时间', width:'18%', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
|
||||
@ -93,6 +93,7 @@
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/device/list',
|
||||
toolbar: '#toolbarTop',
|
||||
defaultToolbar: ['filter'],
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号', sort: true},
|
||||
{field: 'name', title: '设备名称'},
|
||||
@ -143,7 +144,7 @@
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: ['100%', '100%'],
|
||||
content: '../page/table/gnss_add_dev',
|
||||
content: '../page/table/gnss_add_dev'
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
elem: '#baseParaTableId',
|
||||
url: '/gnss/group/list',
|
||||
toolbar: '#toolbarTable',
|
||||
defaultToolbar: [],
|
||||
cols: [[
|
||||
{field: 'id', title: '组号', sort: true},
|
||||
{field: 'work_cycle', title: '工作周期(分钟)'},
|
||||
@ -78,7 +79,7 @@
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: ['100%', '100%'],
|
||||
content: '../page/table/gnss_add_group',
|
||||
content: '../page/table/gnss_add_group'
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
@ -134,6 +135,7 @@
|
||||
elem: '#calcParaTableId',
|
||||
url: '/gnss/group/list_calc',//假数据
|
||||
toolbar: '#toolbarTable',
|
||||
defaultToolbar: [],
|
||||
cols: [[
|
||||
{field: 'id', title: '组号', sort: true},
|
||||
{field: 'filter_hour', title: '滤波周期(小时)'},
|
||||
@ -160,7 +162,7 @@
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: ['100%', '100%'],
|
||||
content: '../page/table/gnss_add_group_calc',
|
||||
content: '../page/table/gnss_add_group_calc'
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
|
||||
@ -68,6 +68,8 @@
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/msg/list_all',
|
||||
toolbar: '#toolbarDemo',//开启头部工具栏
|
||||
defaultToolbar: ['filter'],
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
{field: 'createtime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
|
||||
@ -68,6 +68,8 @@
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/msg/status/list',
|
||||
toolbar: '#toolbarDemo',//开启头部工具栏
|
||||
defaultToolbar: ['filter'],
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
{field: 'createtime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
|
||||
@ -68,6 +68,8 @@
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/msg/trx/list',
|
||||
toolbar: '#toolbarDemo',//开启头部工具栏
|
||||
defaultToolbar: ['filter'],
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
{field: 'createtime', title: '上报时间', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
|
||||
@ -84,18 +84,13 @@
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/status/list',
|
||||
defaultToolbar: ['filter', 'exports', 'print', {
|
||||
title: '提示',
|
||||
layEvent: 'LAYTABLE_TIPS',
|
||||
icon: 'layui-icon-tips'
|
||||
}],
|
||||
toolbar: '#toolbarDemo',//开启头部工具栏
|
||||
defaultToolbar: ['filter'],
|
||||
cols: [[
|
||||
{field: 'deviceid', title: '设备号', sort: true},
|
||||
{field: 'devicetype', title: '设备类型',templet: '#typeTrans'},
|
||||
{field: 'updatetime', title: '更新时间', templet: "<div>{{layui.util.toDateString(d.updatetime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'devicetime', title: '设备时间'},
|
||||
{field: 'satelliteinview', title: '可见卫星'},
|
||||
{field: 'satelliteinuse', title: '使用卫星'},
|
||||
{field: 'state', title: '状态',templet: '#stateTrans'},
|
||||
{field: 'warning', title: '告警',templet: '#warningTrans'},
|
||||
{field: 'location', title: '位置'},
|
||||
|
||||
@ -18,18 +18,21 @@
|
||||
|
||||
<div class="layui-form layuimini-form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">设备编号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="deviceid" id="deviceid" lay-verify="required" lay-reqtext="不能为空" placeholder="请输入设备编号" value="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">设备名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="name" id="name" placeholder="请输入设备名称" value="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">设备类型</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="devicetype" id="devicetype" lay-verify="required" lay-search="">
|
||||
@ -38,27 +41,17 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">父设备号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" name="parentid" id="parentid" placeholder="请输入关联基准站编号" value="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">所属部门</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="tenantname" id="tenantname" lay-verify="required" lay-search="">
|
||||
<option th:each="item : ${tenant_list}" th:text="${item.name}" th:value="${item.name}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">项目号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="project_id" id="project_id" placeholder="请输入项目编号" value="" class="layui-input">
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">基本参数组</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="group_id" id="group_id" lay-verify="required" lay-search="">
|
||||
@ -66,7 +59,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">解算参数组</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="calc_group_id" id="calc_group_id" lay-verify="required" lay-search="">
|
||||
@ -74,16 +67,25 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">推送至</label>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">所属部门</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="fwd_group_id" id="fwd_group_id" lay-verify="required" lay-search="">
|
||||
<option value="不推送">不推送</option>
|
||||
<option th:each="item : ${gnss_group_fwd_list}" th:text="${item.name}" th:value="${item.name}"></option>
|
||||
<select name="tenantname" id="tenantname" lay-verify="required" lay-search="">
|
||||
<option th:each="item : ${tenant_list}" th:text="${item.name}" th:value="${item.name}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">项目号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="project_id" id="project_id" placeholder="请输入项目编号" value="" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label required">使用状态</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="opmode" id="opmode" lay-verify="required" lay-search="">
|
||||
@ -93,11 +95,52 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<hr>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">推送至</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="fwd_group_id" id="fwd_group_id" lay-verify="required" lay-search="">
|
||||
<option value="不推送">不推送</option>
|
||||
<option th:each="item : ${gnss_group_fwd_list}" th:text="${item.name}" th:value="${item.name}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">推送名称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="fwddeviceid" id="fwddeviceid" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">初始位置 东</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="b562e" id="b562e" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">北</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="b562n" id="b562n" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">天</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="b562d" id="b562d" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block" style="float:right" >
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="initLocBtn">取初值</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -130,6 +173,26 @@
|
||||
return false;
|
||||
});
|
||||
|
||||
form.on('submit(initLocBtn)', function (data) {
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"/gnss/device/init_loc",
|
||||
data:{
|
||||
'deviceid':$('#deviceid').val()
|
||||
},
|
||||
success: function (result) {
|
||||
$('#b562e').val(result.b562e);
|
||||
$('#b562n').val(result.b562n);
|
||||
$('#b562d').val(result.b562d);
|
||||
},
|
||||
error: function () {
|
||||
console.log("ajax error");
|
||||
}
|
||||
});
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
@ -148,6 +211,10 @@
|
||||
$('#calc_group_id').val(data.calc_group_id);
|
||||
$('#fwd_group_id').val(data.fwd_group_id);
|
||||
$('#opmode').val(data.opmode);
|
||||
$('#fwddeviceid').val(data.fwddeviceid);
|
||||
$('#b562e').val(data.b562e);
|
||||
$('#b562n').val(data.b562n);
|
||||
$('#b562d').val(data.b562d);
|
||||
form.render();
|
||||
}
|
||||
</script>
|
||||
|
||||
139
sec-beidou/src/main/resources/templates/page/table/user_add.html
Normal file
139
sec-beidou/src/main/resources/templates/page/table/user_add.html
Normal file
@ -0,0 +1,139 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>组织</title>
|
||||
<meta name="renderer" content="webkit">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<link rel="stylesheet" href="../../lib/layui-v2.6.3/css/layui.css" media="all">
|
||||
<link rel="stylesheet" href="../../css/public.css" media="all">
|
||||
<style>
|
||||
body {
|
||||
background-color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="layui-form layuimini-form">
|
||||
<input type="hidden" name="id" id="id">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">用户名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="name" id="name" lay-verify="required" lay-reqtext="不能为空" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label required">手机号</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="mobile" id="mobile" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">昵称</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="nickname" id="nickname" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item" name="div_tenant" id="div_tenant">
|
||||
<div class="layui-input-group">
|
||||
<label class="layui-form-label">所属企业</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="tenantname" id="tenantname" lay-filter="tenant_id">
|
||||
<option th:each="item : ${tenant_list}" th:text="${item.name}" th:value="${item.name}"></option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-group">
|
||||
<label class="layui-form-label">角色</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="role" id="role" lay-filter="role">
|
||||
<option value="SUPER_ADMIN" th:if="${tenant_id}==0">超级管理员</option>
|
||||
<option value="ADMIN" th:if="${tenant_id}==0">系统管理员</option>
|
||||
<option value="MANAGER">管理员</option>
|
||||
<option value="USER">用户</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-group">
|
||||
<label class="layui-form-label">冻结</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="locked" id="locked" lay-filter="locked">
|
||||
<option value="0">否</option>
|
||||
<option value="1">是</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">头像位置</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="avatar_url" id="avatar_url" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">openid</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="openid" id="openid" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="../../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
<script>
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form,
|
||||
$ = layui.$;
|
||||
var iframeIndex = parent.layer.getFrameIndex(window.name);
|
||||
|
||||
//监听提交
|
||||
form.on('submit(saveBtn)', function (data) {
|
||||
console.log(JSON.stringify(data.field));
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"/sys/user/update",
|
||||
contentType: "application/json;charset=UTF-8",
|
||||
data: JSON.stringify(data.field),
|
||||
success: function (result) {
|
||||
console.log(result);
|
||||
parent.onBaseParaUpdated();
|
||||
parent.layer.close(iframeIndex);
|
||||
},
|
||||
error: function () {
|
||||
console.log("ajax error");
|
||||
parent.layer.close(iframeIndex);
|
||||
}
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function setParams(data){
|
||||
var form = layui.form,
|
||||
$ = layui.$;
|
||||
$('#name').val(data.name);
|
||||
$('#mobile').val(data.mobile);
|
||||
$('#nickname').val(data.nickname);
|
||||
$('#tenantname').val(data.tenantname);
|
||||
$('#role').val(data.role);
|
||||
$('#locked').val(data.locked?'1':'0');
|
||||
$('#avatar_url').val(data.avatar_url);
|
||||
$('#openid').val(data.openid);
|
||||
form.render();
|
||||
}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -60,13 +60,13 @@
|
||||
table.on('toolbar(currentTableFilter)', function (obj) {
|
||||
if (obj.event === 'add') {
|
||||
var index = layer.open({
|
||||
title: '新增推送参数组',
|
||||
title: '新增企业部门',
|
||||
type: 2,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: ['100%', '100%'],
|
||||
content: '../sys/tenant/add',
|
||||
content: '../sys/tenant/add'
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
|
||||
@ -55,11 +55,10 @@
|
||||
</div>
|
||||
<script src="../lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
|
||||
<script th:inline="none">
|
||||
layui.use(['form', 'table','miniPage','element'], function () {
|
||||
layui.use(['form', 'table'], function () {
|
||||
var $ = layui.$,
|
||||
form = layui.form,
|
||||
table = layui.table,
|
||||
miniPage = layui.miniPage;
|
||||
table = layui.table;
|
||||
/**
|
||||
* 初始化表单,要加上,不然刷新部分组件可能会不加载
|
||||
*/
|
||||
@ -67,17 +66,15 @@
|
||||
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/gnss/device/list',
|
||||
url: '/sys/user/list',
|
||||
toolbar: '#toolbarTop',
|
||||
cols: [[
|
||||
{field: 'name', title: '用户名'},
|
||||
{field: 'mobile', title: '手机号'},
|
||||
{field: 'nickname', title: '昵称'},
|
||||
{field: 'role', title: '角色'},
|
||||
{field: 'tenant_id', title: '组织id'},
|
||||
{field: 'avatar_url', title: '头像位置'},
|
||||
{field: 'openid', title: 'openid'},
|
||||
{field: 'locked', title: '是否冻结'},
|
||||
{field: 'tenantname', title: '所属组织'},
|
||||
{field: 'locked', title: '是否冻结', templet: "<div>{{d.locked==1?'是':'否'}}</div>"},
|
||||
{title: '操作', toolbar: '#currentTableBar', align: "center", minWidth: 120}
|
||||
]],
|
||||
limits: [10, 15, 20, 25, 50, 100],
|
||||
@ -109,18 +106,14 @@
|
||||
*/
|
||||
table.on('toolbar(currentTableFilter)', function (obj) {
|
||||
if (obj.event === 'add') { // 监听添加操作
|
||||
var content = miniPage.getHrefContent('page/table/gnss_add_dev');
|
||||
var openWH = miniPage.getOpenWidthHeight();
|
||||
|
||||
var index = layer.open({
|
||||
title: '新增设备',
|
||||
type: 1,
|
||||
title: '新增用户',
|
||||
type: 2,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content,
|
||||
area: ['100%', '100%'],
|
||||
content: '../sys/user/add'
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
@ -131,32 +124,17 @@
|
||||
table.on('tool(currentTableFilter)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'edit') {
|
||||
|
||||
var content = miniPage.getHrefContent('page/table/gnss_add_dev');
|
||||
var openWH = miniPage.getOpenWidthHeight();
|
||||
|
||||
var index = layer.open({
|
||||
title: '修改设备',
|
||||
type: 1,
|
||||
title: '修改用户',
|
||||
type: 2,
|
||||
shade: 0.2,
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: [openWH[0] + 'px', openWH[1] + 'px'],
|
||||
offset: [openWH[2] + 'px', openWH[3] + 'px'],
|
||||
content: content,
|
||||
area: ['100%', '100%'],
|
||||
content: '../sys/user/edit',
|
||||
success: function(layero, index) {
|
||||
var device_id = layero.find('#deviceid');
|
||||
device_id.val(data.deviceid);
|
||||
device_id.attr('readonly',true);
|
||||
layero.find('#name').val(data.name);
|
||||
layero.find('#devicetype').val(data.devicetype);
|
||||
layero.find('#parentid').val(data.parentid);
|
||||
layero.find('#tenantname').val(data.tenantname);
|
||||
layero.find('#project_id').val(data.project_id);
|
||||
layero.find('#group_id').val(data.group_id);
|
||||
layero.find('#calc_group_id').val(data.calc_group_id);
|
||||
layero.find('#fwd_group_id').val(data.fwd_group_id);
|
||||
layero.find('#opmode').val(data.opmode);
|
||||
var iframe = window['layui-layer-iframe' + index];
|
||||
iframe.setParams(data);
|
||||
}
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
@ -164,12 +142,12 @@
|
||||
});
|
||||
return false;
|
||||
} else if (obj.event === 'delete') {
|
||||
layer.confirm('确定删除'+data.deviceid+"?", function(index){
|
||||
layer.confirm('确定删除'+data.name+"?", function(index){
|
||||
$.ajax({
|
||||
type:"POST",
|
||||
url:"/gnss/device/delete",
|
||||
url:"/sys/user/delete",
|
||||
data:{
|
||||
'del_id':data.deviceid
|
||||
'name':data.name
|
||||
},
|
||||
success: function (data) {
|
||||
//data是cotroller相应处理函数的返回值
|
||||
@ -186,36 +164,10 @@
|
||||
|
||||
});
|
||||
|
||||
function onDeviceCfgUpdated(){
|
||||
function onBaseParaUpdated(){
|
||||
layui.table.reload('currentTableId');
|
||||
}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="typeTrans">
|
||||
{{# if(d.devicetype == 1){ }}
|
||||
<span>基准站</span>
|
||||
{{# } else { }}
|
||||
<span>监测站</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="modeTrans">
|
||||
{{# if(d.opmode == 0){ }}
|
||||
<span class="layui-badge layui-bg-green">正常</span>
|
||||
{{# } else if(d.opmode == 1){ }}
|
||||
<span class="layui-badge layui-bg-blue">维护</span>
|
||||
{{# } else { }}
|
||||
<span class="layui-badge layui-bg-gray">停用</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="synTrans">
|
||||
{{# if(d.syn == 0){ }}
|
||||
<span class="layui-badge layui-bg-orange">否</span>
|
||||
{{# } else { }}
|
||||
<span class="layui-badge layui-bg-green">是</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@ -88,11 +88,8 @@
|
||||
table.render({
|
||||
elem: '#currentTableId',
|
||||
url: '/warning/msg',
|
||||
defaultToolbar: ['filter', 'exports', 'print', {
|
||||
title: '提示',
|
||||
layEvent: 'LAYTABLE_TIPS',
|
||||
icon: 'layui-icon-tips'
|
||||
}],
|
||||
toolbar: '#toolbarDemo', //开启头部工具栏
|
||||
defaultToolbar: ['filter'],
|
||||
cols: [[
|
||||
{field: 'createtime', title: '上报时间', width: '15%', templet: "<div>{{layui.util.toDateString(d.createtime, 'yyyy-MM-dd HH:mm:ss')}}</div>"},
|
||||
{field: 'deviceid', title: '设备号'},
|
||||
|
||||
@ -40,6 +40,7 @@
|
||||
elem: '#currentTableId',
|
||||
url: '/warning/cfg',
|
||||
toolbar: '#toolbarTop',
|
||||
defaultToolbar: [],
|
||||
cols: [[
|
||||
{field: 'devicetype', title: '设备类型'},
|
||||
{field: 'type', title: '告警类型'},
|
||||
@ -66,7 +67,7 @@
|
||||
maxmin:true,
|
||||
shadeClose: true,
|
||||
area: ['100%', '100%'],
|
||||
content: '../page/table/warning_add',
|
||||
content: '../page/table/warning_add'
|
||||
});
|
||||
$(window).on("resize", function () {
|
||||
layer.full(index);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user