提交修改

This commit is contained in:
LEED
2025-03-27 17:15:27 +08:00
parent 6a8cbff440
commit 988e68bdc7
47 changed files with 1051 additions and 255 deletions

View File

@@ -108,6 +108,33 @@ public class DeviceController extends BaseController
return getDataTable(deviceService.selectDeviceListByGroup(device));
}
/**
* 查询设备简短列表,主页列表数据
*/
@PreAuthorize("@ss.hasPermi('iot:device:list')")
@GetMapping("/gshortList")
@ApiOperation("设备分页简短列表")
public TableDataInfo gshortList1(Device device)
{
startPage();
LoginUser loginUser = getLoginUser();
if (null == loginUser.getDeptId()) {
// 终端用户查询设备
device.setTenantId(loginUser.getUserId());
return getDataTable(deviceService.listTerminalUser(device));
}
if (null == device.getDeptId()) {
device.setDeptId(getLoginUser().getDeptId());
}
if (Objects.isNull(device.getTenantId())){
device.setTenantId(getLoginUser().getUserId());
}
if (null == device.getShowChild()) {
device.setShowChild(false);
}
return getDataTable(deviceService.selectGDeviceShortList(device));
}
/**
* 查询设备简短列表,主页列表数据
*/
@@ -189,6 +216,8 @@ public class DeviceController extends BaseController
return AjaxResult.success(device);
}
/**
* 设备数据同步
*/

View File

@@ -111,4 +111,15 @@ public class FunctionLogController extends BaseController
{
return toAjax(functionLogService.deleteFunctionLogByIds(ids));
}
@ApiOperation("清空日志")
@Log(title = "清空日志", businessType = BusinessType.CLEAN)
@PreAuthorize("@ss.hasPermi('iot:log:remove')")
@DeleteMapping("/clean/{serialNumber}")
public AjaxResult clean(@PathVariable("serialNumber") String serialNumber)
{
functionLogService.cleanOperLog(serialNumber);
return success();
}
}

View File

@@ -10,6 +10,7 @@ import com.xinda.common.utils.StringUtils;
import com.xinda.common.utils.poi.ExcelUtil;
import com.xinda.iot.cache.ITSLCache;
import com.xinda.iot.domain.ThingsModel;
import com.xinda.iot.model.ImportCategoryModelInput;
import com.xinda.iot.model.ImportStandardModelInput;
import com.xinda.iot.model.ImportThingsModelInput;
import com.xinda.iot.model.ThingsModelPerm;
@@ -126,6 +127,18 @@ public class ThingsModelController extends BaseController
}
}
@PostMapping("/importCategory")
@ApiOperation("导入产品分类")
public AjaxResult ImportByCategoryId(@RequestBody ImportCategoryModelInput input){
int repeatCount=thingsModelService.importBytCategoryId(input);
if(repeatCount==0){
return AjaxResult.success(MessageUtils.message("import.success"));
}else{
return AjaxResult.success(StringUtils.format(MessageUtils.message("things.model.import.failed.identifier.repeat"), repeatCount));
}
}
/**
* 修改物模型
*/
@@ -157,6 +170,19 @@ public class ThingsModelController extends BaseController
return toAjax(thingsModelService.deleteThingsModelByModelIds(modelIds));
}
/**
* 删除物模型
*/
@PreAuthorize("@ss.hasPermi('iot:model:remove')")
@Log(title = "清空物模型", businessType = BusinessType.DELETE)
@DeleteMapping("delAll/{productId}")
@ApiOperation("清空物模型")
public AjaxResult removeAll(@PathVariable Long productId)
{
thingsModelService.deleteProductThingsModelAndCacheByProductId(productId);
return toAjax(1);
}
/**
* 获取缓存的JSON物模型
*/

View File

@@ -74,18 +74,26 @@ public class ThingsModelStandardController extends BaseController {
@PostMapping
@ApiOperation("添加通用物模型")
public AjaxResult add(@RequestBody ThingsModelStandard thingsModelStandard) {
return toAjax(thingsModelStandardService.insertThingsModelStandard(thingsModelStandard));
if(thingsModelStandardService.checkUnique(thingsModelStandard)){
return error("模板下存在重复标识符,请重新输入");
}else{
return toAjax(thingsModelStandardService.insertThingsModelStandard(thingsModelStandard));
}
}
/**
* 修改通用物模型
*/
@PreAuthorize("@ss.hasPermi('iot:standard:edit')")
// @PreAuthorize("@ss.hasPermi('iot:standard:edit')")
@Log(title = "通用物模型", businessType = BusinessType.UPDATE)
@PutMapping
@ApiOperation("修改通用物模型")
public AjaxResult edit(@RequestBody ThingsModelStandard thingsModelStandard) {
return toAjax(thingsModelStandardService.updateThingsModelStandard(thingsModelStandard));
if(thingsModelStandardService.checkUnique(thingsModelStandard)){
return error("模板下存在重复标识符,请重新输入");
}else{
return toAjax(thingsModelStandardService.updateThingsModelStandard(thingsModelStandard));
}
}
/**