汽车吊、履带吊数据对接
This commit is contained in:
parent
4e808120c1
commit
786e6d1106
@ -104,7 +104,7 @@ public class CrawlerCraneAlarmController {
|
||||
@ApiOperation(value = " 添加履带吊报警信息信息", notes = "添加履带吊报警信息信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody CrawlerCraneAlarm crawlerCraneAlarm) {
|
||||
crawlerCraneAlarmService.save(crawlerCraneAlarm);
|
||||
crawlerCraneAlarmService.saveInfo(crawlerCraneAlarm);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
@ -118,8 +118,7 @@ public class CrawlerCraneCurrentDataController {
|
||||
@ApiOperation(value = " 添加履带吊实时数据信息信息", notes = "添加履带吊实时数据信息信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody CrawlerCraneCurrentData crawlerCraneCurrentData) {
|
||||
Result<CrawlerCraneCurrentData> result = new Result<CrawlerCraneCurrentData>();
|
||||
crawlerCraneCurrentDataService.save(crawlerCraneCurrentData);
|
||||
crawlerCraneCurrentDataService.saveInfo(crawlerCraneCurrentData);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
@ -104,8 +104,7 @@ public class CrawlerCraneWorkerCycleController {
|
||||
@ApiOperation(value = " 添加履带吊工作循环信息信息", notes = "添加履带吊工作循环信息信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody CrawlerCraneWorkerCycle crawlerCraneWorkerCycle) {
|
||||
Result<CrawlerCraneWorkerCycle> result = new Result<CrawlerCraneWorkerCycle>();
|
||||
crawlerCraneWorkerCycleService.save(crawlerCraneWorkerCycle);
|
||||
crawlerCraneWorkerCycleService.saveInfo(crawlerCraneWorkerCycle);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
@ -104,8 +104,7 @@ public class TruckCraneAlarmController {
|
||||
@ApiOperation(value = " 添加汽车吊报警信息信息", notes = "添加汽车吊报警信息信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody TruckCraneAlarm truckCraneAlarm) {
|
||||
Result<TruckCraneAlarm> result = new Result<TruckCraneAlarm>();
|
||||
truckCraneAlarmService.save(truckCraneAlarm);
|
||||
truckCraneAlarmService.saveInfo(truckCraneAlarm);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ public class TruckCraneCurrentDataController {
|
||||
@ApiOperation(value = " 添加汽车吊实时数据信息信息", notes = "添加汽车吊实时数据信息信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody TruckCraneCurrentData truckCraneCurrentData) {
|
||||
truckCraneCurrentDataService.save(truckCraneCurrentData);
|
||||
truckCraneCurrentDataService.saveInfo(truckCraneCurrentData);
|
||||
return Result.success("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.bigdevice.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneAlarm;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneCurrentData;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -14,4 +15,6 @@ import java.util.Map;
|
||||
public interface ICrawlerCraneAlarmService extends IService<CrawlerCraneAlarm> {
|
||||
|
||||
Map<String, Object> alarmStat(Map<String, Object> map);
|
||||
|
||||
boolean saveInfo(CrawlerCraneAlarm crawlerCraneAlarm);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.bigdevice.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneCurrentData;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneWorkerCycle;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCraneCurrentData;
|
||||
|
||||
import java.util.List;
|
||||
@ -19,4 +20,6 @@ public interface ICrawlerCraneCurrentDataService extends IService<CrawlerCraneCu
|
||||
|
||||
|
||||
CrawlerCraneCurrentData getNewData(Map<String, Object> map);
|
||||
|
||||
boolean saveInfo(CrawlerCraneCurrentData crawlerCraneCurrentData);
|
||||
}
|
||||
|
||||
@ -1,7 +1,12 @@
|
||||
package com.zhgd.xmgl.modules.bigdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneWorkerCycle;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCrane;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCraneAlarm;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @Description: 履带吊工作循环信息
|
||||
@ -11,4 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
*/
|
||||
public interface ICrawlerCraneWorkerCycleService extends IService<CrawlerCraneWorkerCycle> {
|
||||
|
||||
boolean saveInfo(CrawlerCraneWorkerCycle crawlerCraneWorkerCycle);
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.zhgd.xmgl.modules.bigdevice.service;
|
||||
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCraneAlarm;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCraneCurrentData;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@ -14,4 +15,6 @@ import java.util.Map;
|
||||
public interface ITruckCraneAlarmService extends IService<TruckCraneAlarm> {
|
||||
|
||||
Map<String, Object> alarmStat(Map<String, Object> map);
|
||||
|
||||
boolean saveInfo(TruckCraneAlarm truckCraneAlarm);
|
||||
}
|
||||
|
||||
@ -19,4 +19,6 @@ public interface ITruckCraneCurrentDataService extends IService<TruckCraneCurren
|
||||
|
||||
TruckCraneCurrentData getNewData(Map<String, Object> map);
|
||||
|
||||
boolean saveInfo(TruckCraneCurrentData truckCraneCurrentData);
|
||||
|
||||
}
|
||||
|
||||
@ -3,12 +3,16 @@ package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCrane;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneAlarm;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneCurrentData;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCraneAlarm;
|
||||
import com.zhgd.xmgl.modules.bigdevice.mapper.CrawlerCraneAlarmMapper;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ICrawlerCraneAlarmService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ICrawlerCraneService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -24,6 +28,9 @@ import java.util.*;
|
||||
@Service
|
||||
public class CrawlerCraneAlarmServiceImpl extends ServiceImpl<CrawlerCraneAlarmMapper, CrawlerCraneAlarm> implements ICrawlerCraneAlarmService {
|
||||
|
||||
@Autowired
|
||||
private ICrawlerCraneService crawlerCraneService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> alarmStat(Map<String, Object> map) {
|
||||
QueryWrapper<CrawlerCraneAlarm> queryWrapper = QueryGenerator.initPageQueryWrapper(CrawlerCraneAlarm.class, map);
|
||||
@ -84,4 +91,15 @@ public class CrawlerCraneAlarmServiceImpl extends ServiceImpl<CrawlerCraneAlarmM
|
||||
resultMap.put("todayAlarm", this.count(Wrappers.<CrawlerCraneAlarm>lambdaQuery().ge(CrawlerCraneAlarm::getReportTime, DateUtil.beginOfDay(new Date()))));
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveInfo(CrawlerCraneAlarm crawlerCraneAlarm) {
|
||||
CrawlerCrane crawlerCrane = crawlerCraneService.getOne(Wrappers.<CrawlerCrane>lambdaQuery().eq(CrawlerCrane::getDevSn, crawlerCraneAlarm.getDevSn()));
|
||||
if (crawlerCrane == null) {
|
||||
throw new OpenAlertException("该设备不存在");
|
||||
}
|
||||
crawlerCraneAlarm.setDevName(crawlerCrane.getDevName());
|
||||
crawlerCraneAlarm.setProjectSn(crawlerCrane.getProjectSn());
|
||||
return this.save(crawlerCraneAlarm);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,9 +5,11 @@ import cn.hutool.core.map.MapUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCrane;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneCurrentData;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneWorkerCycle;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCraneCurrentData;
|
||||
import com.zhgd.xmgl.modules.bigdevice.mapper.CrawlerCraneCurrentDataMapper;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ICrawlerCraneCurrentDataService;
|
||||
@ -72,4 +74,15 @@ public class CrawlerCraneCurrentDataServiceImpl extends ServiceImpl<CrawlerCrane
|
||||
CrawlerCraneCurrentData devSn = baseMapper.getNewData(MapUtil.getStr(map, "devSn"));
|
||||
return devSn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveInfo(CrawlerCraneCurrentData crawlerCraneCurrentData) {
|
||||
CrawlerCrane crawlerCrane = crawlerCraneService.getOne(Wrappers.<CrawlerCrane>lambdaQuery().eq(CrawlerCrane::getDevSn, crawlerCraneCurrentData.getDevSn()));
|
||||
if (crawlerCrane == null) {
|
||||
throw new OpenAlertException("该设备不存在");
|
||||
}
|
||||
crawlerCraneCurrentData.setDevName(crawlerCrane.getDevName());
|
||||
crawlerCraneCurrentData.setProjectSn(crawlerCrane.getProjectSn());
|
||||
return this.save(crawlerCraneCurrentData);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,14 @@
|
||||
package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCrane;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCraneWorkerCycle;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCrane;
|
||||
import com.zhgd.xmgl.modules.bigdevice.mapper.CrawlerCraneWorkerCycleMapper;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ICrawlerCraneService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ICrawlerCraneWorkerCycleService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -16,4 +22,17 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@Service
|
||||
public class CrawlerCraneWorkerCycleServiceImpl extends ServiceImpl<CrawlerCraneWorkerCycleMapper, CrawlerCraneWorkerCycle> implements ICrawlerCraneWorkerCycleService {
|
||||
|
||||
@Autowired
|
||||
private ICrawlerCraneService crawlerCraneService;
|
||||
|
||||
@Override
|
||||
public boolean saveInfo(CrawlerCraneWorkerCycle crawlerCraneWorkerCycle) {
|
||||
CrawlerCrane crawlerCrane = crawlerCraneService.getOne(Wrappers.<CrawlerCrane>lambdaQuery().eq(CrawlerCrane::getDevSn, crawlerCraneWorkerCycle.getDevSn()));
|
||||
if (crawlerCrane == null) {
|
||||
throw new OpenAlertException("该设备不存在");
|
||||
}
|
||||
crawlerCraneWorkerCycle.setDevName(crawlerCrane.getDevName());
|
||||
crawlerCraneWorkerCycle.setProjectSn(crawlerCrane.getProjectSn());
|
||||
return this.save(crawlerCraneWorkerCycle);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,16 @@
|
||||
package com.zhgd.xmgl.modules.bigdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCrane;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCraneAlarm;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCraneCurrentData;
|
||||
import com.zhgd.xmgl.modules.bigdevice.mapper.TruckCraneAlarmMapper;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ITruckCraneAlarmService;
|
||||
import com.zhgd.xmgl.modules.bigdevice.service.ITruckCraneService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
@ -23,6 +29,9 @@ import java.util.Map;
|
||||
@Service
|
||||
public class TruckCraneAlarmServiceImpl extends ServiceImpl<TruckCraneAlarmMapper, TruckCraneAlarm> implements ITruckCraneAlarmService {
|
||||
|
||||
@Autowired
|
||||
private ITruckCraneService truckCraneService;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> alarmStat(Map<String, Object> map) {
|
||||
QueryWrapper<TruckCraneAlarm> queryWrapper = QueryGenerator.initPageQueryWrapper(TruckCraneAlarm.class, map);
|
||||
@ -61,4 +70,15 @@ public class TruckCraneAlarmServiceImpl extends ServiceImpl<TruckCraneAlarmMappe
|
||||
resultMap.put("alarmTypeList", alarmTypeList);
|
||||
return resultMap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveInfo(TruckCraneAlarm truckCraneAlarm) {
|
||||
TruckCrane truckCrane = truckCraneService.getOne(Wrappers.<TruckCrane>lambdaQuery().eq(TruckCrane::getDevSn, truckCraneAlarm.getDevSn()));
|
||||
if (truckCrane == null) {
|
||||
throw new OpenAlertException("该设备不存在");
|
||||
}
|
||||
truckCraneAlarm.setDevName(truckCrane.getDevName());
|
||||
truckCraneAlarm.setProjectSn(truckCrane.getProjectSn());
|
||||
return this.save(truckCraneAlarm);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,8 @@ import cn.hutool.core.map.MapUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.zhgd.exception.CustomException;
|
||||
import com.zhgd.jeecg.common.execption.OpenAlertException;
|
||||
import com.zhgd.jeecg.common.system.query.QueryGenerator;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.CrawlerCrane;
|
||||
import com.zhgd.xmgl.modules.bigdevice.entity.TruckCrane;
|
||||
@ -76,4 +78,15 @@ public class TruckCraneCurrentDataServiceImpl extends ServiceImpl<TruckCraneCurr
|
||||
TruckCraneCurrentData devSn = baseMapper.getNewData(MapUtil.getStr(map, "devSn"));
|
||||
return devSn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveInfo(TruckCraneCurrentData truckCraneCurrentData) {
|
||||
TruckCrane truckCrane = truckCraneService.getOne(Wrappers.<TruckCrane>lambdaQuery().eq(TruckCrane::getDevSn, truckCraneCurrentData.getDevSn()));
|
||||
if (truckCrane == null) {
|
||||
throw new OpenAlertException("该设备不存在");
|
||||
}
|
||||
truckCraneCurrentData.setDevName(truckCrane.getDevName());
|
||||
truckCraneCurrentData.setProjectSn(truckCrane.getProjectSn());
|
||||
return this.save(truckCraneCurrentData);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user