|
|
@@ -14,7 +14,6 @@ import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
import org.jeecg.common.system.query.QueryGenerator;
|
|
|
-import org.jeecg.modules.system.app.dto.evaluate.EventRequestDTO;
|
|
|
import org.jeecg.modules.system.app.entity.AppDevice;
|
|
|
import org.jeecg.modules.system.app.mapper.AppSiteMapper;
|
|
|
import org.jeecg.modules.system.app.service.IAppDeviceService;
|
|
|
@@ -70,7 +69,7 @@ public class AppDeviceController extends JeecgController<AppDevice, IAppDeviceSe
|
|
|
return Result.OK(pageList);
|
|
|
}
|
|
|
pageList.getRecords().forEach(item->{
|
|
|
- if(!item.getSiteId().isEmpty()){
|
|
|
+ if(null != item.getSiteId() && !item.getSiteId().isEmpty()){
|
|
|
item.setSiteName(appSiteMapper.selectById(item.getSiteId()).getName());
|
|
|
}
|
|
|
});
|
|
|
@@ -88,9 +87,7 @@ public class AppDeviceController extends JeecgController<AppDevice, IAppDeviceSe
|
|
|
@Transactional
|
|
|
public Result<String> add(@RequestBody AppDevice appDevice){
|
|
|
if(AppDeviceService.getOne(Wrappers.<AppDevice>lambdaQuery()
|
|
|
- .eq(AppDevice::getDeviceSerial,appDevice.getDeviceSerial())
|
|
|
- .eq(AppDevice::getDeviceNo,appDevice.getDeviceNo())
|
|
|
- .eq(AppDevice::getDeviceType,appDevice.getDeviceType())) != null) {
|
|
|
+ .eq(AppDevice::getDeviceSerial,appDevice.getDeviceSerial())) != null) {
|
|
|
return Result.error("设备已存在!");
|
|
|
}
|
|
|
AppDeviceService.save(appDevice);
|
|
|
@@ -109,6 +106,12 @@ public class AppDeviceController extends JeecgController<AppDevice, IAppDeviceSe
|
|
|
@Transactional
|
|
|
public Result<String> edit(@RequestBody AppDevice appDevice) {
|
|
|
appDevice.setOrgCode(appSiteMapper.selectById(appDevice.getSiteId()).getOrgCode());
|
|
|
+ if(AppDeviceService.getOne(Wrappers.<AppDevice>lambdaQuery()
|
|
|
+ .eq(AppDevice::getDeviceSerial,appDevice.getDeviceSerial())
|
|
|
+ .eq(AppDevice::getDeviceNo,appDevice.getDeviceNo())
|
|
|
+ .eq(AppDevice::getDeviceType,appDevice.getDeviceType())) != null) {
|
|
|
+ return Result.error("设备已存在!");
|
|
|
+ }
|
|
|
AppDeviceService.updateById(appDevice);
|
|
|
if(appDevice.getDeviceSerial() != null && appDevice.getValidateCode() != null && appDevice.getSiteId() != null){
|
|
|
String addDevice = addDevice(appDevice.getDeviceSerial(), appDevice.getValidateCode());
|
|
|
@@ -200,7 +203,8 @@ public class AppDeviceController extends JeecgController<AppDevice, IAppDeviceSe
|
|
|
}
|
|
|
|
|
|
@PostMapping(value = "/notice")
|
|
|
- public Result<String> doorOpeningNotice(@RequestBody EventRequestDTO eventRequestDTO) {
|
|
|
+ public Result<String> doorOpeningNotice(@RequestBody Object json) {
|
|
|
+ System.out.println("海康回调通知: " + json);
|
|
|
return Result.OK(null);
|
|
|
}
|
|
|
|