|
@@ -31,6 +31,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
|
import org.jeecg.common.system.base.controller.JeecgController;
|
|
|
+import org.jeecg.modules.watch.s7gatherWatch;
|
|
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
|
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
|
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
|
@@ -63,6 +64,8 @@ public class DeviceInformationController extends JeecgController<DeviceInformati
|
|
|
private IDeviceInformationService deviceInformationService;
|
|
|
@Autowired
|
|
|
private IDeviceRegionService deviceRegionService;
|
|
|
+ @Autowired
|
|
|
+ private s7gatherWatch s7gatherWatch;
|
|
|
|
|
|
/**
|
|
|
* 分页列表查询
|
|
@@ -113,6 +116,7 @@ public class DeviceInformationController extends JeecgController<DeviceInformati
|
|
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
|
|
public Result<String> edit(@RequestBody DeviceInformation deviceInformation) {
|
|
|
deviceInformationService.updateById(deviceInformation);
|
|
|
+ s7gatherWatch.closeS7(deviceInformation.getId());
|
|
|
return Result.OK("编辑成功!");
|
|
|
}
|
|
|
|
|
@@ -128,6 +132,7 @@ public class DeviceInformationController extends JeecgController<DeviceInformati
|
|
|
@DeleteMapping(value = "/delete")
|
|
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
|
|
deviceInformationService.removeById(id);
|
|
|
+ s7gatherWatch.closeS7(id);
|
|
|
return Result.OK("删除成功!");
|
|
|
}
|
|
|
|
|
@@ -143,6 +148,9 @@ public class DeviceInformationController extends JeecgController<DeviceInformati
|
|
|
@DeleteMapping(value = "/deleteBatch")
|
|
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
|
|
this.deviceInformationService.removeByIds(Arrays.asList(ids.split(",")));
|
|
|
+ Arrays.asList(ids.split(",")).forEach(id->{
|
|
|
+ s7gatherWatch.closeS7(id);
|
|
|
+ });
|
|
|
return Result.OK("批量删除成功!");
|
|
|
}
|
|
|
|