feat:设备接口开发:业务配置、维护等
This commit is contained in:
@@ -105,7 +105,7 @@ public class RedisSessionComponent {
|
||||
context.setDeviceType(deviceType);
|
||||
context.setDeviceCode(deviceCode);
|
||||
if(deviceInfo != null){
|
||||
context.setDeviceName(deviceInfo.getProductName());
|
||||
context.setDeviceName(deviceInfo.getDeviceName());
|
||||
context.setTenantId(deviceInfo.getTenantId().toString());
|
||||
deviceInfo.setIsConnect("1");
|
||||
deviceInfo.setLastConnectTime(LocalDateTime.now());
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,7 +37,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceAffiliationRelativit
|
||||
|
||||
@Tag(name = "管理后台 - 附属设备关系")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-affiliation-relativity")
|
||||
@RequestMapping("/qms/resource/device-affiliation-relativity")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.deviceaffiliationrelativity")
|
||||
public class DeviceAffiliationRelativityController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceApplyService;
|
||||
|
||||
@Tag(name = "管理后台 - 设备通用流程,验收、降级、停用、报废、还原、启用")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-apply")
|
||||
@RequestMapping("/qms/resource/device-apply")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.deviceapply")
|
||||
public class DeviceApplyController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceApplyDetailService;
|
||||
|
||||
@Tag(name = "管理后台 - 设备通用流程明细")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-apply-detail")
|
||||
@RequestMapping("/qms/resource/device-apply-detail")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.deviceapplydetail")
|
||||
public class DeviceApplyDetailController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceCalibrationService;
|
||||
|
||||
@Tag(name = "管理后台 - 设备-检定校准")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-calibration")
|
||||
@RequestMapping("/qms/resource/device-calibration")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.devicecalibration")
|
||||
public class DeviceCalibrationController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceCalibrationPlanServi
|
||||
|
||||
@Tag(name = "管理后台 - 设备-检定校准计划")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-calibration-plan")
|
||||
@RequestMapping("/qms/resource/device-calibration-plan")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.devicecalibrationplan")
|
||||
public class DeviceCalibrationPlanController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
@@ -37,7 +37,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceConfigBusinessItemSe
|
||||
|
||||
@Tag(name = "管理后台 - 设备-检查项目配置")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-config-business-item")
|
||||
@RequestMapping("/qms/resource/device-config-business-item")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.deviceconfigbusinessitem")
|
||||
public class DeviceConfigBusinessItemController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.admin;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRulePageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRuleRespVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRuleSaveReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceConfigBusinessRuleMapper;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -37,7 +39,7 @@ import com.zt.plat.module.qms.resource.device.service.DeviceConfigBusinessRuleSe
|
||||
|
||||
@Tag(name = "管理后台 - 设备-业务配置")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-config-business-rule")
|
||||
@RequestMapping("/qms/resource/device-config-business-rule")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.deviceconfigbusinessrule")
|
||||
public class DeviceConfigBusinessRuleController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
@@ -49,8 +51,8 @@ public class DeviceConfigBusinessRuleController extends AbstractFileUploadContro
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private DeviceConfigBusinessRuleService deviceConfigBusinessRuleService;
|
||||
@Resource private DeviceConfigBusinessRuleService deviceConfigBusinessRuleService;
|
||||
@Resource private DeviceConfigBusinessRuleMapper deviceConfigBusinessRuleMapper;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备-业务配置")
|
||||
@@ -59,6 +61,17 @@ public class DeviceConfigBusinessRuleController extends AbstractFileUploadContro
|
||||
return success(deviceConfigBusinessRuleService.createDeviceConfigBusinessRule(createReqVO));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getByProductId")
|
||||
@Operation(summary = "获得设备-业务配置")
|
||||
@Parameter(name = "productId", description = "设备大类id", required = true, example = "1024")
|
||||
public CommonResult<DeviceConfigBusinessRuleRespVO> getByProductId(@RequestParam("productId") Long productId) {
|
||||
DeviceConfigBusinessRuleDO entity = deviceConfigBusinessRuleService.getByProductId(productId);
|
||||
if(entity == null)
|
||||
return success(null);
|
||||
return success(BeanUtils.toBean(entity, DeviceConfigBusinessRuleRespVO.class));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备-业务配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:update')")
|
||||
|
||||
@@ -51,6 +51,13 @@ public class DeviceInfomationController extends AbstractFileUploadController imp
|
||||
@Resource private DeviceInfomationService deviceInfomationService;
|
||||
@Resource private DeviceProductService deviceProductService;
|
||||
|
||||
@PostMapping("/saveDevice")
|
||||
@Operation(summary = "创建设备-设备信息")
|
||||
// @PreAuthorize("@ss.hasPermission('resource:device-infomation:create')")
|
||||
public CommonResult<DeviceInfomationRespVO> saveDevice(@Valid @RequestBody DeviceInfomationSaveReqVO reqVO) {
|
||||
return deviceInfomationService.saveDevice(reqVO);
|
||||
}
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备-设备信息")
|
||||
@PreAuthorize("@ss.hasPermission('resource:device-infomation:create')")
|
||||
@@ -99,10 +106,11 @@ public class DeviceInfomationController extends AbstractFileUploadController imp
|
||||
public CommonResult<PageResult<DeviceInfomationRespVO>> getDeviceInfomationPage(@Valid DeviceInfomationPageReqVO pageReqVO) {
|
||||
Long productId = pageReqVO.getProductId();
|
||||
if(productId != null){
|
||||
List<DeviceProductDO> productDOList = deviceProductService.listByIdPath(productId, DataTypeConstant.DATA_TYPE_DATA);
|
||||
List<Long> productIds = productDOList.stream().map(DeviceProductDO::getId).toList();
|
||||
pageReqVO.setProductIds(productIds);
|
||||
pageReqVO.setProductId(null);
|
||||
List<Long> productIds = deviceProductService.getIdListByIdPath(productId);
|
||||
if(!productIds.isEmpty()){
|
||||
pageReqVO.setProductIds(productIds);
|
||||
pageReqVO.setProductId(null);
|
||||
}
|
||||
}
|
||||
PageResult<DeviceInfomationDO> pageResult = deviceInfomationService.getDeviceInfomationPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceInfomationRespVO.class));
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user