feat: 权限标识

master
李小林 7 months ago
parent 50d9e23c3e
commit 52f15a571a
  1. 2
      src/main/java/com/bellmann/controller/DeviceStaticController.java
  2. 10
      src/main/java/com/bellmann/controller/DeviceTypeVerController.java
  3. 2
      src/main/java/com/bellmann/controller/OperateTask2Controller.java
  4. 1
      src/main/java/com/bellmann/controller/OrderInfoController.java
  5. 2
      src/main/java/com/bellmann/controller/TypeVerExtController.java
  6. 7
      src/main/java/com/bellmann/service/impl/DeviceStaticServiceImpl.java

@ -22,6 +22,7 @@ import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -133,6 +134,7 @@ public class DeviceStaticController {
@GetMapping("/remote/check-dev-online/{devId}")
@Operation(summary = "远程操作-查询设备状态")
@PreAuthorize("@ss.hasPerm('remote:detail:device:online')")
@PreventDuplicateSubmit
public Result<RemoteOperateResult> checkDevOnline(@PathVariable Long devId) {
Long count = remoteOperateTaskService.sendTaskByDevId(devId, SecurityUtils.getUsername(), RemoteOperateMsgEnum.TOUCH_DEVICE.getValue());

@ -17,6 +17,7 @@ import com.bellmann.service.DeviceTypeVerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
@ -39,6 +40,7 @@ public class DeviceTypeVerController {
}
@Operation(summary = "审核设备类型版本")
@PreAuthorize("@ss.hasPerm('device:type:ver:status')")
@PutMapping("/audit-soft-state/{typeAndVerId}")
public Result<String> updateTypeAndVersionState(@PathVariable @Valid @NotNull(message = "设备类型软件版本ID为空") Long typeAndVerId){
return deviceTypeVerService.updateTypeAndVersionState(typeAndVerId);
@ -47,12 +49,14 @@ public class DeviceTypeVerController {
@Operation(summary = "审核最新软件版本")
@PutMapping("/audit-new-soft-state/{typeAndVerId}")
@PreAuthorize("@ss.hasPerm('device:type:soft:ver:audit')")
public Result<String> updateTypeNewSoftState(
@PathVariable @Valid @NotNull(message = "设备类型软件版本ID为空") Long typeAndVerId){
return deviceTypeVerService.updateTypeNewSoftState(typeAndVerId);
}
@Operation(summary = "复制设备类型软件版本信息")
@PreAuthorize("@ss.hasPerm('device:type:ver:copy')")
@PutMapping("/audit-new-soft-state/{typeAndVerId}/{devTypeId}")
public Result<String> copySoftVerToOtherOui(
@PathVariable @Valid @NotNull(message = "设备类型软件版本ID为空") Long typeAndVerId,
@ -63,12 +67,14 @@ public class DeviceTypeVerController {
}
@Operation(summary = "删除设备类型软件版本")
@PreAuthorize("@ss.hasPerm('device:type:ver:delete')")
@DeleteMapping("/delete-device-type/{typeAndVerId}")
public Result<String> deleteDeviceTypeVersionById(
@PathVariable @Valid @NotNull(message = "设备类型软件版本ID为空") Long typeAndVerId){
return deviceTypeVerService.deleteDeviceTypeVersionById(typeAndVerId);
}
@Operation(summary = "删除软件版本文件")
@PreAuthorize("@ss.hasPerm('device:type:ver:delete:file')")
@DeleteMapping("/delete-device-ver-file/{typeAndVerId}/{fileId}")
public Result<String> deleteDeviceTypeVersionFile(
@PathVariable @Valid @NotNull(message = "设备类型软件版本ID为空") Long typeAndVerId,
@ -83,12 +89,14 @@ public class DeviceTypeVerController {
}
@Operation(summary = "修改设备类型软件版本信息 ")
@PostMapping("/edit-dev-type-ver-form")
@PreAuthorize("@ss.hasPerm('device:type:ver:update:info')")
public Result<Integer> editDevTypeVerForm(@RequestBody DeviceTypeVerForm deviceTypeVerForm){
int rows = deviceTypeVerService.editDevTypeVerForm(deviceTypeVerForm);
return Result.success(rows);
}
@Operation(summary = "新增厂商配置文件信息")
@PostMapping("/add-vendor-profile")
@PreAuthorize("@ss.hasPerm('device:type:ver:add:profile')")
public Result<String> addVendorProfile(@RequestBody VendorProfileForm form){
return deviceTypeVerService.addVendorProfile(form);
}
@ -101,6 +109,7 @@ public class DeviceTypeVerController {
}
@Operation(summary = "删除厂商配置文件信息")
@PreAuthorize("@ss.hasPerm('device:type:ver:delete:profile')")
@DeleteMapping("/delete-vendor-profile/{fileId}/{typeAndVerId}")
public Result<Integer> deleteVendorProfile(@PathVariable Long fileId, @PathVariable Long typeAndVerId){
int rows = deviceTypeVerService.deleteVendorProfile(fileId,typeAndVerId);
@ -121,6 +130,7 @@ public class DeviceTypeVerController {
}
@Operation(summary = "更新软件版本系统管理域数据")
@PostMapping("/edit-ver-domain/{typeAndVerId}")
@PreAuthorize("@ss.hasPerm('device:type:ver:add:domain')")
public Result<Integer> editVerDomain(@PathVariable Long typeAndVerId,@RequestBody List<Long> list){
int rows = deviceTypeVerService.editVerDomain(typeAndVerId,list);
return Result.success(rows);

@ -8,6 +8,7 @@ import com.bellmann.service.OperateTask2Service;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
/**
@ -27,6 +28,7 @@ public class OperateTask2Controller {
private final OperateTask2Service operateTask2Service;
@PostMapping("/page/{devId}")
@PreAuthorize("@ss.hasPerm('remote:detail:task:list')")
@Operation(summary = "远程操作-设备任务列表")
public PageResult<OperateTask2TableVO> page(@PathVariable Long devId, @RequestBody BasePageQuery query){
return operateTask2Service.page(devId,query);

@ -78,6 +78,7 @@ public class OrderInfoController {
}
@PostMapping("device-order/page")
@PreAuthorize("@ss.hasPerm('family:operate:order:execute')")
@Operation(summary = "设备工单表格分页")
public PageResult<OrderInfoTableVO> deviceOrderPage(@RequestBody DeviceOrderQuery query){

@ -7,6 +7,7 @@ import com.bellmann.service.TypeVerExtService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;
@Tag(name = "13.设备能力信息接口")
@ -26,6 +27,7 @@ public class TypeVerExtController {
}
@Operation(summary = "修改设备能力信息表单接口")
@PostMapping("/edit")
@PreAuthorize("@ss.hasPerm('device:type:ver:update:capability')")
public Result<String> editCapabilityForm(@RequestBody CapabilityForm form){
return typeVerExtService.editCapabilityForm(form);
}

@ -498,7 +498,6 @@ public class DeviceStaticServiceImpl implements DeviceStaticService {
argsStruct[0].argsName = "SERVICE_VERSION";
argsStruct[0].argsValue = serviceVerName;
argsStruct[0].operTaskId = Utils.LONG_NULL;
log.info("service-version: {}", serviceVerName);
DeviceServiceArgs deviceServiceArgs = new DeviceServiceArgs();
for (int i = 0; i < args.size(); i++) {
deviceServiceArgs = args.get(i);
@ -1239,7 +1238,11 @@ public class DeviceStaticServiceImpl implements DeviceStaticService {
if (result!=0){
throw new BusinessException(ResultCode.OAM_INTERFACE_ERROR);
}
return parseTreeOption(task2DetailStructHolder.value.operTask.operTaskId);
List<OptionTree<String>> optionTrees = parseTreeOption(task2DetailStructHolder.value.operTask.operTaskId);
optionTrees.forEach(obj->{
obj.setValue(StringUtilsConstants.STRING_BLANK);
});
return optionTrees;
}

Loading…
Cancel
Save