feat: 设备模块部分代码生成;报告接口;
This commit is contained in:
@@ -3,6 +3,8 @@ package com.zt.plat.module.qms.business.reportdoc.controller.admin;
|
||||
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFilePageReqVO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileRespVO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFileSaveReqVO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentMainDO;
|
||||
import com.zt.plat.module.qms.business.reportdoc.service.ReportDocumentMainService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -49,8 +51,8 @@ public class ReportDocumentFileController extends AbstractFileUploadController i
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private ReportDocumentFileService reportDocumentFileService;
|
||||
@Resource private ReportDocumentFileService reportDocumentFileService;
|
||||
@Resource private ReportDocumentMainService reportDocumentMainService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建检测报告附件")
|
||||
@@ -94,6 +96,23 @@ public class ReportDocumentFileController extends AbstractFileUploadController i
|
||||
return success(BeanUtils.toBean(reportDocumentFile, ReportDocumentFileRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/getPdfFileObjByMainId")
|
||||
@Operation(summary = "获得检测报告附件")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
public CommonResult<ReportDocumentFileRespVO> getPdfFileObjByMainId(ReportDocumentFileSaveReqVO vo) {
|
||||
Long mainId = vo.getMainId();
|
||||
Integer version = vo.getVersion();
|
||||
if(version == null){
|
||||
ReportDocumentMainDO mainDO = reportDocumentMainService.getReportDocumentMain(mainId);
|
||||
version = mainDO.getDocumentVersion();
|
||||
}
|
||||
ReportDocumentFileDO entity = reportDocumentFileService.getByMainIdAndVersion(mainId, version);
|
||||
if(entity == null){
|
||||
return CommonResult.success(null);
|
||||
}
|
||||
return success(BeanUtils.toBean(entity, ReportDocumentFileRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得检测报告附件分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:report-document-file:query')")
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.zt.plat.module.qms.business.reportdoc.controller.vo.ReportDocumentFil
|
||||
import com.zt.plat.module.qms.business.reportdoc.dal.dataobject.ReportDocumentFileDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 检测报告附件 Mapper
|
||||
*
|
||||
@@ -30,4 +32,19 @@ public interface ReportDocumentFileMapper extends BaseMapperX<ReportDocumentFile
|
||||
.orderByDesc(ReportDocumentFileDO::getId));
|
||||
}
|
||||
|
||||
default List<ReportDocumentFileDO> selectList(ReportDocumentFileDO reqVO) {
|
||||
LambdaQueryWrapperX<ReportDocumentFileDO> query = new LambdaQueryWrapperX<>();
|
||||
query.eqIfPresent(ReportDocumentFileDO::getMainId, reqVO.getMainId())
|
||||
.eqIfPresent(ReportDocumentFileDO::getFileId, reqVO.getFileId())
|
||||
.likeIfPresent(ReportDocumentFileDO::getName, reqVO.getName())
|
||||
.eqIfPresent(ReportDocumentFileDO::getPath, reqVO.getPath())
|
||||
.eqIfPresent(ReportDocumentFileDO::getUrl, reqVO.getUrl())
|
||||
.eqIfPresent(ReportDocumentFileDO::getType, reqVO.getType())
|
||||
.eqIfPresent(ReportDocumentFileDO::getVersion, reqVO.getVersion())
|
||||
.eqIfPresent(ReportDocumentFileDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(ReportDocumentFileDO::getRemark, reqVO.getRemark())
|
||||
.orderByDesc(ReportDocumentFileDO::getId);
|
||||
return selectList(query);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyRespVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplySaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDO;
|
||||
import com.zt.plat.module.qms.resource.device.service.DeviceApplyService;
|
||||
|
||||
@Tag(name = "管理后台 - 设备通用流程,验收、降级、停用、报废、还原、启用")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-apply")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.deviceapply")
|
||||
public class DeviceApplyController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = DeviceApplyController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private DeviceApplyService deviceApplyService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备通用流程,验收、降级、停用、报废、还原、启用")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-apply:create')")
|
||||
public CommonResult<DeviceApplyRespVO> createDeviceApply(@Valid @RequestBody DeviceApplySaveReqVO createReqVO) {
|
||||
return success(deviceApplyService.createDeviceApply(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备通用流程,验收、降级、停用、报废、还原、启用")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-apply:update')")
|
||||
public CommonResult<Boolean> updateDeviceApply(@Valid @RequestBody DeviceApplySaveReqVO updateReqVO) {
|
||||
deviceApplyService.updateDeviceApply(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备通用流程,验收、降级、停用、报废、还原、启用")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-apply:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceApply(@RequestParam("id") Long id) {
|
||||
deviceApplyService.deleteDeviceApply(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除设备通用流程,验收、降级、停用、报废、还原、启用")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-apply:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceApplyList(@RequestBody BatchDeleteReqVO req) {
|
||||
deviceApplyService.deleteDeviceApplyListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备通用流程,验收、降级、停用、报废、还原、启用")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-apply:query')")
|
||||
public CommonResult<DeviceApplyRespVO> getDeviceApply(@RequestParam("id") Long id) {
|
||||
DeviceApplyDO deviceApply = deviceApplyService.getDeviceApply(id);
|
||||
return success(BeanUtils.toBean(deviceApply, DeviceApplyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备通用流程,验收、降级、停用、报废、还原、启用分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-apply:query')")
|
||||
public CommonResult<PageResult<DeviceApplyRespVO>> getDeviceApplyPage(@Valid DeviceApplyPageReqVO pageReqVO) {
|
||||
PageResult<DeviceApplyDO> pageResult = deviceApplyService.getDeviceApplyPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceApplyRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备通用流程,验收、降级、停用、报废、还原、启用 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-apply:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceApplyExcel(@Valid DeviceApplyPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DeviceApplyDO> list = deviceApplyService.getDeviceApplyPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "设备通用流程,验收、降级、停用、报废、还原、启用.xls", "数据", DeviceApplyRespVO.class,
|
||||
BeanUtils.toBean(list, DeviceApplyRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.admin;
|
||||
|
||||
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 org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO;
|
||||
import com.zt.plat.module.qms.resource.device.service.DeviceConfigBusinessRuleService;
|
||||
|
||||
@Tag(name = "管理后台 - 设备-业务配置")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-config-business-rule")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.deviceconfigbusinessrule")
|
||||
public class DeviceConfigBusinessRuleController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = DeviceConfigBusinessRuleController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private DeviceConfigBusinessRuleService deviceConfigBusinessRuleService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备-业务配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:create')")
|
||||
public CommonResult<DeviceConfigBusinessRuleRespVO> createDeviceConfigBusinessRule(@Valid @RequestBody DeviceConfigBusinessRuleSaveReqVO createReqVO) {
|
||||
return success(deviceConfigBusinessRuleService.createDeviceConfigBusinessRule(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备-业务配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:update')")
|
||||
public CommonResult<Boolean> updateDeviceConfigBusinessRule(@Valid @RequestBody DeviceConfigBusinessRuleSaveReqVO updateReqVO) {
|
||||
deviceConfigBusinessRuleService.updateDeviceConfigBusinessRule(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备-业务配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceConfigBusinessRule(@RequestParam("id") Long id) {
|
||||
deviceConfigBusinessRuleService.deleteDeviceConfigBusinessRule(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除设备-业务配置")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceConfigBusinessRuleList(@RequestBody BatchDeleteReqVO req) {
|
||||
deviceConfigBusinessRuleService.deleteDeviceConfigBusinessRuleListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备-业务配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:query')")
|
||||
public CommonResult<DeviceConfigBusinessRuleRespVO> getDeviceConfigBusinessRule(@RequestParam("id") Long id) {
|
||||
DeviceConfigBusinessRuleDO deviceConfigBusinessRule = deviceConfigBusinessRuleService.getDeviceConfigBusinessRule(id);
|
||||
return success(BeanUtils.toBean(deviceConfigBusinessRule, DeviceConfigBusinessRuleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备-业务配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:query')")
|
||||
public CommonResult<PageResult<DeviceConfigBusinessRuleRespVO>> getDeviceConfigBusinessRulePage(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO) {
|
||||
PageResult<DeviceConfigBusinessRuleDO> pageResult = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceConfigBusinessRuleRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备-业务配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-config-business-rule:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceConfigBusinessRuleExcel(@Valid DeviceConfigBusinessRulePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DeviceConfigBusinessRuleDO> list = deviceConfigBusinessRuleService.getDeviceConfigBusinessRulePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "设备-业务配置.xls", "数据", DeviceConfigBusinessRuleRespVO.class,
|
||||
BeanUtils.toBean(list, DeviceConfigBusinessRuleRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.admin;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtRespVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceRepairAtSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.zt.plat.framework.business.interceptor.BusinessControllerMarker;
|
||||
import com.zt.plat.framework.business.annotation.FileUploadController;
|
||||
import com.zt.plat.framework.business.controller.AbstractFileUploadController;
|
||||
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.vo.BatchDeleteReqVO;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.pojo.CommonResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
import static com.zt.plat.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import com.zt.plat.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.zt.plat.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.zt.plat.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceRepairAtDO;
|
||||
import com.zt.plat.module.qms.resource.device.service.DeviceRepairAtService;
|
||||
|
||||
@Tag(name = "管理后台 - 故障与处理关系")
|
||||
@RestController
|
||||
@RequestMapping("/qms/device-repair-at")
|
||||
@Validated
|
||||
@FileUploadController(source = "qms.devicerepairat")
|
||||
public class DeviceRepairAtController extends AbstractFileUploadController implements BusinessControllerMarker{
|
||||
|
||||
static {
|
||||
FileUploadController annotation = DeviceRepairAtController.class.getAnnotation(FileUploadController.class);
|
||||
if (annotation != null) {
|
||||
setFileUploadInfo(annotation);
|
||||
}
|
||||
}
|
||||
|
||||
@Resource
|
||||
private DeviceRepairAtService deviceRepairAtService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建故障与处理关系")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-repair-at:create')")
|
||||
public CommonResult<DeviceRepairAtRespVO> createDeviceRepairAt(@Valid @RequestBody DeviceRepairAtSaveReqVO createReqVO) {
|
||||
return success(deviceRepairAtService.createDeviceRepairAt(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新故障与处理关系")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-repair-at:update')")
|
||||
public CommonResult<Boolean> updateDeviceRepairAt(@Valid @RequestBody DeviceRepairAtSaveReqVO updateReqVO) {
|
||||
deviceRepairAtService.updateDeviceRepairAt(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除故障与处理关系")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-repair-at:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceRepairAt(@RequestParam("id") Long id) {
|
||||
deviceRepairAtService.deleteDeviceRepairAt(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除故障与处理关系")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-repair-at:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceRepairAtList(@RequestBody BatchDeleteReqVO req) {
|
||||
deviceRepairAtService.deleteDeviceRepairAtListByIds(req.getIds());
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得故障与处理关系")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-repair-at:query')")
|
||||
public CommonResult<DeviceRepairAtRespVO> getDeviceRepairAt(@RequestParam("id") Long id) {
|
||||
DeviceRepairAtDO deviceRepairAt = deviceRepairAtService.getDeviceRepairAt(id);
|
||||
return success(BeanUtils.toBean(deviceRepairAt, DeviceRepairAtRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得故障与处理关系分页")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-repair-at:query')")
|
||||
public CommonResult<PageResult<DeviceRepairAtRespVO>> getDeviceRepairAtPage(@Valid DeviceRepairAtPageReqVO pageReqVO) {
|
||||
PageResult<DeviceRepairAtDO> pageResult = deviceRepairAtService.getDeviceRepairAtPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, DeviceRepairAtRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出故障与处理关系 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('qms:device-repair-at:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceRepairAtExcel(@Valid DeviceRepairAtPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DeviceRepairAtDO> list = deviceRepairAtService.getDeviceRepairAtPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "故障与处理关系.xls", "数据", DeviceRepairAtRespVO.class,
|
||||
BeanUtils.toBean(list, DeviceRepairAtRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备通用流程,验收、降级、停用、报废、还原、启用分页 Request VO")
|
||||
@Data
|
||||
public class DeviceApplyPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "ZT")
|
||||
private String businessName;
|
||||
|
||||
@Schema(description = "申请部门", example = "王五")
|
||||
private String applyDepartmentName;
|
||||
|
||||
@Schema(description = "申请部门ID")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请人", example = "王五")
|
||||
private String applyUserName;
|
||||
|
||||
@Schema(description = "申请人ID")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "业务日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] businessDate;
|
||||
|
||||
@Schema(description = "业务原因")
|
||||
private String businessReason;
|
||||
|
||||
@Schema(description = "业务状态", example = "1")
|
||||
private String businessStatus;
|
||||
|
||||
@Schema(description = "借用人")
|
||||
private String businessUser;
|
||||
|
||||
@Schema(description = "借用人id", example = "14524")
|
||||
private Long businessUserId;
|
||||
|
||||
@Schema(description = "借用部门")
|
||||
private String businessDepartment;
|
||||
|
||||
@Schema(description = "借用部门id", example = "894")
|
||||
private Long businessDepartmentId;
|
||||
|
||||
@Schema(description = "计划归还日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] planGivebackDate;
|
||||
|
||||
@Schema(description = "归还接收人")
|
||||
private String givebackReceiveUser;
|
||||
|
||||
@Schema(description = "归还接收人id", example = "1528")
|
||||
private Long givebackReceiveUserId;
|
||||
|
||||
@Schema(description = "数据集配置ID", example = "12435")
|
||||
private Long dataCollectionId;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "流程实例id", example = "15634")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备通用流程,验收、降级、停用、报废、还原、启用 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceApplyRespVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20295")
|
||||
@ExcelProperty("ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "ZT")
|
||||
@ExcelProperty("业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等")
|
||||
private String businessName;
|
||||
|
||||
@Schema(description = "申请部门", example = "王五")
|
||||
@ExcelProperty("申请部门")
|
||||
private String applyDepartmentName;
|
||||
|
||||
@Schema(description = "申请部门ID")
|
||||
@ExcelProperty("申请部门ID")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请人", example = "王五")
|
||||
@ExcelProperty("申请人")
|
||||
private String applyUserName;
|
||||
|
||||
@Schema(description = "申请人ID")
|
||||
@ExcelProperty("申请人ID")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
@ExcelProperty("业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "业务日期")
|
||||
@ExcelProperty("业务日期")
|
||||
private LocalDateTime businessDate;
|
||||
|
||||
@Schema(description = "业务原因")
|
||||
@ExcelProperty("业务原因")
|
||||
private String businessReason;
|
||||
|
||||
@Schema(description = "业务状态", example = "1")
|
||||
@ExcelProperty("业务状态")
|
||||
private String businessStatus;
|
||||
|
||||
@Schema(description = "借用人")
|
||||
@ExcelProperty("借用人")
|
||||
private String businessUser;
|
||||
|
||||
@Schema(description = "借用人id", example = "14524")
|
||||
@ExcelProperty("借用人id")
|
||||
private Long businessUserId;
|
||||
|
||||
@Schema(description = "借用部门")
|
||||
@ExcelProperty("借用部门")
|
||||
private String businessDepartment;
|
||||
|
||||
@Schema(description = "借用部门id", example = "894")
|
||||
@ExcelProperty("借用部门id")
|
||||
private Long businessDepartmentId;
|
||||
|
||||
@Schema(description = "计划归还日期")
|
||||
@ExcelProperty("计划归还日期")
|
||||
private LocalDateTime planGivebackDate;
|
||||
|
||||
@Schema(description = "归还接收人")
|
||||
@ExcelProperty("归还接收人")
|
||||
private String givebackReceiveUser;
|
||||
|
||||
@Schema(description = "归还接收人id", example = "1528")
|
||||
@ExcelProperty("归还接收人id")
|
||||
private Long givebackReceiveUserId;
|
||||
|
||||
@Schema(description = "数据集配置ID", example = "12435")
|
||||
@ExcelProperty("数据集配置ID")
|
||||
private Long dataCollectionId;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
@ExcelProperty("表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "流程实例id", example = "15634")
|
||||
@ExcelProperty("流程实例id")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 设备通用流程,验收、降级、停用、报废、还原、启用新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceApplySaveReqVO {
|
||||
|
||||
@Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20295")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等", example = "ZT")
|
||||
private String businessName;
|
||||
|
||||
@Schema(description = "申请部门", example = "王五")
|
||||
private String applyDepartmentName;
|
||||
|
||||
@Schema(description = "申请部门ID")
|
||||
private String applyDepartment;
|
||||
|
||||
@Schema(description = "申请人", example = "王五")
|
||||
private String applyUserName;
|
||||
|
||||
@Schema(description = "申请人ID")
|
||||
private String applyUser;
|
||||
|
||||
@Schema(description = "业务编码")
|
||||
private String businessCode;
|
||||
|
||||
@Schema(description = "业务日期")
|
||||
private LocalDateTime businessDate;
|
||||
|
||||
@Schema(description = "业务原因")
|
||||
private String businessReason;
|
||||
|
||||
@Schema(description = "业务状态", example = "1")
|
||||
private String businessStatus;
|
||||
|
||||
@Schema(description = "借用人")
|
||||
private String businessUser;
|
||||
|
||||
@Schema(description = "借用人id", example = "14524")
|
||||
private Long businessUserId;
|
||||
|
||||
@Schema(description = "借用部门")
|
||||
private String businessDepartment;
|
||||
|
||||
@Schema(description = "借用部门id", example = "894")
|
||||
private Long businessDepartmentId;
|
||||
|
||||
@Schema(description = "计划归还日期")
|
||||
private LocalDateTime planGivebackDate;
|
||||
|
||||
@Schema(description = "归还接收人")
|
||||
private String givebackReceiveUser;
|
||||
|
||||
@Schema(description = "归还接收人id", example = "1528")
|
||||
private Long givebackReceiveUserId;
|
||||
|
||||
@Schema(description = "数据集配置ID", example = "12435")
|
||||
private Long dataCollectionId;
|
||||
|
||||
@Schema(description = "表单数据")
|
||||
private String formData;
|
||||
|
||||
@Schema(description = "流程实例id", example = "15634")
|
||||
private String flowInstanceId;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备-业务配置分页 Request VO")
|
||||
@Data
|
||||
public class DeviceConfigBusinessRulePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "产品id", example = "28944")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "业务领域")
|
||||
private String businessDomain;
|
||||
|
||||
@Schema(description = "是否需要")
|
||||
private String requireFlag;
|
||||
|
||||
@Schema(description = "子业务类型", example = "2")
|
||||
private String subitemDomainType;
|
||||
|
||||
@Schema(description = "频次类型", example = "2")
|
||||
private String frequencyType;
|
||||
|
||||
@Schema(description = "频次")
|
||||
private String frequency;
|
||||
|
||||
@Schema(description = "频次说明")
|
||||
private String frequencyRemark;
|
||||
|
||||
@Schema(description = "报表模板")
|
||||
private String reportTemplateKey;
|
||||
|
||||
@Schema(description = "表单组件")
|
||||
private String formComponent;
|
||||
|
||||
@Schema(description = "处理方法")
|
||||
private String treatmentMethod;
|
||||
|
||||
@Schema(description = "处理人")
|
||||
private String treatmentUser;
|
||||
|
||||
@Schema(description = "检定/校准类型", example = "1")
|
||||
private String calibrationCheckType;
|
||||
|
||||
@Schema(description = "标准/规范")
|
||||
private String standard;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备-业务配置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceConfigBusinessRuleRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2207")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品id", example = "28944")
|
||||
@ExcelProperty("产品id")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "业务领域")
|
||||
@ExcelProperty("业务领域")
|
||||
private String businessDomain;
|
||||
|
||||
@Schema(description = "是否需要")
|
||||
@ExcelProperty("是否需要")
|
||||
private String requireFlag;
|
||||
|
||||
@Schema(description = "子业务类型", example = "2")
|
||||
@ExcelProperty("子业务类型")
|
||||
private String subitemDomainType;
|
||||
|
||||
@Schema(description = "频次类型", example = "2")
|
||||
@ExcelProperty("频次类型")
|
||||
private String frequencyType;
|
||||
|
||||
@Schema(description = "频次")
|
||||
@ExcelProperty("频次")
|
||||
private String frequency;
|
||||
|
||||
@Schema(description = "频次说明")
|
||||
@ExcelProperty("频次说明")
|
||||
private String frequencyRemark;
|
||||
|
||||
@Schema(description = "报表模板")
|
||||
@ExcelProperty("报表模板")
|
||||
private String reportTemplateKey;
|
||||
|
||||
@Schema(description = "表单组件")
|
||||
@ExcelProperty("表单组件")
|
||||
private String formComponent;
|
||||
|
||||
@Schema(description = "处理方法")
|
||||
@ExcelProperty("处理方法")
|
||||
private String treatmentMethod;
|
||||
|
||||
@Schema(description = "处理人")
|
||||
@ExcelProperty("处理人")
|
||||
private String treatmentUser;
|
||||
|
||||
@Schema(description = "检定/校准类型", example = "1")
|
||||
@ExcelProperty("检定/校准类型")
|
||||
private String calibrationCheckType;
|
||||
|
||||
@Schema(description = "标准/规范")
|
||||
@ExcelProperty("标准/规范")
|
||||
private String standard;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备-业务配置新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceConfigBusinessRuleSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "2207")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "产品id", example = "28944")
|
||||
private Long productId;
|
||||
|
||||
@Schema(description = "业务领域")
|
||||
private String businessDomain;
|
||||
|
||||
@Schema(description = "是否需要")
|
||||
private String requireFlag;
|
||||
|
||||
@Schema(description = "子业务类型", example = "2")
|
||||
private String subitemDomainType;
|
||||
|
||||
@Schema(description = "频次类型", example = "2")
|
||||
private String frequencyType;
|
||||
|
||||
@Schema(description = "频次")
|
||||
private String frequency;
|
||||
|
||||
@Schema(description = "频次说明")
|
||||
private String frequencyRemark;
|
||||
|
||||
@Schema(description = "报表模板")
|
||||
private String reportTemplateKey;
|
||||
|
||||
@Schema(description = "表单组件")
|
||||
private String formComponent;
|
||||
|
||||
@Schema(description = "处理方法")
|
||||
private String treatmentMethod;
|
||||
|
||||
@Schema(description = "处理人")
|
||||
private String treatmentUser;
|
||||
|
||||
@Schema(description = "检定/校准类型", example = "1")
|
||||
private String calibrationCheckType;
|
||||
|
||||
@Schema(description = "标准/规范")
|
||||
private String standard;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
package com.zt.plat.module.qms.resource.device.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 设备通用流程,验收、降级、停用、报废、还原、启用 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("t_dev_apl")
|
||||
@KeySequence("t_dev_apl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class DeviceApplyDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* ID
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 业务名称,【字典】【jy_device_lifecycle_bsn_type】验收、降级、停用、报废、还原、启用等
|
||||
*/
|
||||
@TableField("BSN_NAME")
|
||||
private String businessName;
|
||||
/**
|
||||
* 申请部门
|
||||
*/
|
||||
@TableField("APL_DEPT_NAME")
|
||||
private String applyDepartmentName;
|
||||
/**
|
||||
* 申请部门ID
|
||||
*/
|
||||
@TableField("APL_DEPT")
|
||||
private String applyDepartment;
|
||||
/**
|
||||
* 申请人
|
||||
*/
|
||||
@TableField("APL_USER_NAME")
|
||||
private String applyUserName;
|
||||
/**
|
||||
* 申请人ID
|
||||
*/
|
||||
@TableField("APL_USER")
|
||||
private String applyUser;
|
||||
/**
|
||||
* 业务编码
|
||||
*/
|
||||
@TableField("BSN_CD")
|
||||
private String businessCode;
|
||||
/**
|
||||
* 业务日期
|
||||
*/
|
||||
@TableField("BSN_DT")
|
||||
private LocalDateTime businessDate;
|
||||
/**
|
||||
* 业务原因
|
||||
*/
|
||||
@TableField("BSN_RSN")
|
||||
private String businessReason;
|
||||
/**
|
||||
* 业务状态
|
||||
*/
|
||||
@TableField("BSN_STS")
|
||||
private String businessStatus;
|
||||
/**
|
||||
* 借用人
|
||||
*/
|
||||
@TableField("BSN_USER")
|
||||
private String businessUser;
|
||||
/**
|
||||
* 借用人id
|
||||
*/
|
||||
@TableField("BSN_USER_ID")
|
||||
private Long businessUserId;
|
||||
/**
|
||||
* 借用部门
|
||||
*/
|
||||
@TableField("BSN_DEPT")
|
||||
private String businessDepartment;
|
||||
/**
|
||||
* 借用部门id
|
||||
*/
|
||||
@TableField("BSN_DEPT_ID")
|
||||
private Long businessDepartmentId;
|
||||
/**
|
||||
* 计划归还日期
|
||||
*/
|
||||
@TableField("PLN_GIV_DT")
|
||||
private LocalDateTime planGivebackDate;
|
||||
/**
|
||||
* 归还接收人
|
||||
*/
|
||||
@TableField("GIV_RCV_USER")
|
||||
private String givebackReceiveUser;
|
||||
/**
|
||||
* 归还接收人id
|
||||
*/
|
||||
@TableField("GIV_RCV_USER_ID")
|
||||
private Long givebackReceiveUserId;
|
||||
/**
|
||||
* 数据集配置ID
|
||||
*/
|
||||
@TableField("DAT_COLT_ID")
|
||||
private Long dataCollectionId;
|
||||
/**
|
||||
* 表单数据
|
||||
*/
|
||||
@TableField("FORM_DAT")
|
||||
private String formData;
|
||||
/**
|
||||
* 流程实例id
|
||||
*/
|
||||
@TableField("FLW_INSC_ID")
|
||||
private String flowInstanceId;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
package com.zt.plat.module.qms.resource.device.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 设备-业务配置 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("t_dev_cfg_bsn_rul")
|
||||
@KeySequence("t_dev_cfg_bsn_rul_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class DeviceConfigBusinessRuleDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 产品id
|
||||
*/
|
||||
@TableField("PDT_ID")
|
||||
private Long productId;
|
||||
/**
|
||||
* 业务领域
|
||||
*/
|
||||
@TableField("BSN_DMN")
|
||||
private String businessDomain;
|
||||
/**
|
||||
* 是否需要
|
||||
*/
|
||||
@TableField("REQR_FLG")
|
||||
private String requireFlag;
|
||||
/**
|
||||
* 子业务类型
|
||||
*/
|
||||
@TableField("SUB_DMN_TP")
|
||||
private String subitemDomainType;
|
||||
/**
|
||||
* 频次类型
|
||||
*/
|
||||
@TableField("FREQ_TP")
|
||||
private String frequencyType;
|
||||
/**
|
||||
* 频次
|
||||
*/
|
||||
@TableField("FREQ")
|
||||
private String frequency;
|
||||
/**
|
||||
* 频次说明
|
||||
*/
|
||||
@TableField("FREQ_RMK")
|
||||
private String frequencyRemark;
|
||||
/**
|
||||
* 报表模板
|
||||
*/
|
||||
@TableField("RPT_TMPL_KY")
|
||||
private String reportTemplateKey;
|
||||
/**
|
||||
* 表单组件
|
||||
*/
|
||||
@TableField("FORM_CPNT")
|
||||
private String formComponent;
|
||||
/**
|
||||
* 处理方法
|
||||
*/
|
||||
@TableField("TMT_MTHD")
|
||||
private String treatmentMethod;
|
||||
/**
|
||||
* 处理人
|
||||
*/
|
||||
@TableField("TMT_USER")
|
||||
private String treatmentUser;
|
||||
/**
|
||||
* 检定/校准类型
|
||||
*/
|
||||
@TableField("CLB_CHK_TP")
|
||||
private String calibrationCheckType;
|
||||
/**
|
||||
* 标准/规范
|
||||
*/
|
||||
@TableField("STD")
|
||||
private String standard;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.zt.plat.module.qms.resource.device.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 设备通用流程,验收、降级、停用、报废、还原、启用 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceApplyMapper extends BaseMapperX<DeviceApplyDO> {
|
||||
|
||||
default PageResult<DeviceApplyDO> selectPage(DeviceApplyPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceApplyDO>()
|
||||
.likeIfPresent(DeviceApplyDO::getBusinessName, reqVO.getBusinessName())
|
||||
.likeIfPresent(DeviceApplyDO::getApplyDepartmentName, reqVO.getApplyDepartmentName())
|
||||
.eqIfPresent(DeviceApplyDO::getApplyDepartment, reqVO.getApplyDepartment())
|
||||
.likeIfPresent(DeviceApplyDO::getApplyUserName, reqVO.getApplyUserName())
|
||||
.eqIfPresent(DeviceApplyDO::getApplyUser, reqVO.getApplyUser())
|
||||
.eqIfPresent(DeviceApplyDO::getBusinessCode, reqVO.getBusinessCode())
|
||||
.betweenIfPresent(DeviceApplyDO::getBusinessDate, reqVO.getBusinessDate())
|
||||
.eqIfPresent(DeviceApplyDO::getBusinessReason, reqVO.getBusinessReason())
|
||||
.eqIfPresent(DeviceApplyDO::getBusinessStatus, reqVO.getBusinessStatus())
|
||||
.eqIfPresent(DeviceApplyDO::getBusinessUser, reqVO.getBusinessUser())
|
||||
.eqIfPresent(DeviceApplyDO::getBusinessUserId, reqVO.getBusinessUserId())
|
||||
.eqIfPresent(DeviceApplyDO::getBusinessDepartment, reqVO.getBusinessDepartment())
|
||||
.eqIfPresent(DeviceApplyDO::getBusinessDepartmentId, reqVO.getBusinessDepartmentId())
|
||||
.betweenIfPresent(DeviceApplyDO::getPlanGivebackDate, reqVO.getPlanGivebackDate())
|
||||
.eqIfPresent(DeviceApplyDO::getGivebackReceiveUser, reqVO.getGivebackReceiveUser())
|
||||
.eqIfPresent(DeviceApplyDO::getGivebackReceiveUserId, reqVO.getGivebackReceiveUserId())
|
||||
.eqIfPresent(DeviceApplyDO::getDataCollectionId, reqVO.getDataCollectionId())
|
||||
.eqIfPresent(DeviceApplyDO::getFormData, reqVO.getFormData())
|
||||
.eqIfPresent(DeviceApplyDO::getFlowInstanceId, reqVO.getFlowInstanceId())
|
||||
.eqIfPresent(DeviceApplyDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(DeviceApplyDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DeviceApplyDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceApplyDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.zt.plat.module.qms.resource.device.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceConfigBusinessRulePageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 设备-业务配置 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceConfigBusinessRuleMapper extends BaseMapperX<DeviceConfigBusinessRuleDO> {
|
||||
|
||||
default PageResult<DeviceConfigBusinessRuleDO> selectPage(DeviceConfigBusinessRulePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceConfigBusinessRuleDO>()
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getProductId, reqVO.getProductId())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getBusinessDomain, reqVO.getBusinessDomain())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getRequireFlag, reqVO.getRequireFlag())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getSubitemDomainType, reqVO.getSubitemDomainType())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getFrequencyType, reqVO.getFrequencyType())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getFrequency, reqVO.getFrequency())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getFrequencyRemark, reqVO.getFrequencyRemark())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getReportTemplateKey, reqVO.getReportTemplateKey())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getFormComponent, reqVO.getFormComponent())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getTreatmentMethod, reqVO.getTreatmentMethod())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getTreatmentUser, reqVO.getTreatmentUser())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getCalibrationCheckType, reqVO.getCalibrationCheckType())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getStandard, reqVO.getStandard())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(DeviceConfigBusinessRuleDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DeviceConfigBusinessRuleDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceConfigBusinessRuleDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.resource.device.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyRespVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplySaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 设备通用流程,验收、降级、停用、报废、还原、启用 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface DeviceApplyService {
|
||||
|
||||
/**
|
||||
* 创建设备通用流程,验收、降级、停用、报废、还原、启用
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
DeviceApplyRespVO createDeviceApply(@Valid DeviceApplySaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新设备通用流程,验收、降级、停用、报废、还原、启用
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDeviceApply(@Valid DeviceApplySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除设备通用流程,验收、降级、停用、报废、还原、启用
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDeviceApply(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除设备通用流程,验收、降级、停用、报废、还原、启用
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDeviceApplyListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得设备通用流程,验收、降级、停用、报废、还原、启用
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 设备通用流程,验收、降级、停用、报废、还原、启用
|
||||
*/
|
||||
DeviceApplyDO getDeviceApply(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备通用流程,验收、降级、停用、报废、还原、启用分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 设备通用流程,验收、降级、停用、报废、还原、启用分页
|
||||
*/
|
||||
PageResult<DeviceApplyDO> getDeviceApplyPage(DeviceApplyPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.resource.device.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplyRespVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceApplySaveReqVO;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceApplyDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceApplyMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_APPLY_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 设备通用流程,验收、降级、停用、报废、还原、启用 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DeviceApplyServiceImpl implements DeviceApplyService {
|
||||
|
||||
@Resource
|
||||
private DeviceApplyMapper deviceApplyMapper;
|
||||
|
||||
@Override
|
||||
public DeviceApplyRespVO createDeviceApply(DeviceApplySaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DeviceApplyDO deviceApply = BeanUtils.toBean(createReqVO, DeviceApplyDO.class);
|
||||
deviceApplyMapper.insert(deviceApply);
|
||||
// 返回
|
||||
return BeanUtils.toBean(deviceApply, DeviceApplyRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceApply(DeviceApplySaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDeviceApplyExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DeviceApplyDO updateObj = BeanUtils.toBean(updateReqVO, DeviceApplyDO.class);
|
||||
deviceApplyMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDeviceApply(Long id) {
|
||||
// 校验存在
|
||||
validateDeviceApplyExists(id);
|
||||
// 删除
|
||||
deviceApplyMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDeviceApplyListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDeviceApplyExists(ids);
|
||||
// 删除
|
||||
deviceApplyMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateDeviceApplyExists(List<Long> ids) {
|
||||
List<DeviceApplyDO> list = deviceApplyMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(DEVICE_APPLY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateDeviceApplyExists(Long id) {
|
||||
if (deviceApplyMapper.selectById(id) == null) {
|
||||
throw exception(DEVICE_APPLY_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceApplyDO getDeviceApply(Long id) {
|
||||
return deviceApplyMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceApplyDO> getDeviceApplyPage(DeviceApplyPageReqVO pageReqVO) {
|
||||
return deviceApplyMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
package com.zt.plat.module.qms.resource.device.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
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 jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 设备-业务配置 Service 接口
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
public interface DeviceConfigBusinessRuleService {
|
||||
|
||||
/**
|
||||
* 创建设备-业务配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
DeviceConfigBusinessRuleRespVO createDeviceConfigBusinessRule(@Valid DeviceConfigBusinessRuleSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新设备-业务配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDeviceConfigBusinessRule(@Valid DeviceConfigBusinessRuleSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除设备-业务配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDeviceConfigBusinessRule(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除设备-业务配置
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDeviceConfigBusinessRuleListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得设备-业务配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 设备-业务配置
|
||||
*/
|
||||
DeviceConfigBusinessRuleDO getDeviceConfigBusinessRule(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备-业务配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 设备-业务配置分页
|
||||
*/
|
||||
PageResult<DeviceConfigBusinessRuleDO> getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.zt.plat.module.qms.resource.device.service;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
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 org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceConfigBusinessRuleDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.common.util.object.BeanUtils;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.dal.mapper.DeviceConfigBusinessRuleMapper;
|
||||
|
||||
import static com.zt.plat.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static com.zt.plat.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static com.zt.plat.module.qms.enums.ErrorCodeConstants.DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS;
|
||||
|
||||
/**
|
||||
* 设备-业务配置 Service 实现类
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DeviceConfigBusinessRuleServiceImpl implements DeviceConfigBusinessRuleService {
|
||||
|
||||
@Resource
|
||||
private DeviceConfigBusinessRuleMapper deviceConfigBusinessRuleMapper;
|
||||
|
||||
@Override
|
||||
public DeviceConfigBusinessRuleRespVO createDeviceConfigBusinessRule(DeviceConfigBusinessRuleSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
DeviceConfigBusinessRuleDO deviceConfigBusinessRule = BeanUtils.toBean(createReqVO, DeviceConfigBusinessRuleDO.class);
|
||||
deviceConfigBusinessRuleMapper.insert(deviceConfigBusinessRule);
|
||||
// 返回
|
||||
return BeanUtils.toBean(deviceConfigBusinessRule, DeviceConfigBusinessRuleRespVO.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeviceConfigBusinessRule(DeviceConfigBusinessRuleSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateDeviceConfigBusinessRuleExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DeviceConfigBusinessRuleDO updateObj = BeanUtils.toBean(updateReqVO, DeviceConfigBusinessRuleDO.class);
|
||||
deviceConfigBusinessRuleMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDeviceConfigBusinessRule(Long id) {
|
||||
// 校验存在
|
||||
validateDeviceConfigBusinessRuleExists(id);
|
||||
// 删除
|
||||
deviceConfigBusinessRuleMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDeviceConfigBusinessRuleListByIds(List<Long> ids) {
|
||||
// 校验存在
|
||||
validateDeviceConfigBusinessRuleExists(ids);
|
||||
// 删除
|
||||
deviceConfigBusinessRuleMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
private void validateDeviceConfigBusinessRuleExists(List<Long> ids) {
|
||||
List<DeviceConfigBusinessRuleDO> list = deviceConfigBusinessRuleMapper.selectByIds(ids);
|
||||
if (CollUtil.isEmpty(list) || list.size() != ids.size()) {
|
||||
throw exception(DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
private void validateDeviceConfigBusinessRuleExists(Long id) {
|
||||
if (deviceConfigBusinessRuleMapper.selectById(id) == null) {
|
||||
throw exception(DEVICE_CONFIG_BUSINESS_RULE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeviceConfigBusinessRuleDO getDeviceConfigBusinessRule(Long id) {
|
||||
return deviceConfigBusinessRuleMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceConfigBusinessRuleDO> getDeviceConfigBusinessRulePage(DeviceConfigBusinessRulePageReqVO pageReqVO) {
|
||||
return deviceConfigBusinessRuleMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.zt.plat.module.qms.resource.device.dal.mapper.DeviceApplyMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user