version
parent
aee4735db7
commit
8382ce41a2
|
|
@ -0,0 +1,74 @@
|
|||
package org.qinan.safetyeval.adapter.controller.web;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.alibaba.cola.dto.Response;
|
||||
import com.alibaba.cola.dto.SingleResponse;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.app.ref.service.OrgBusinessScopeDeviceRefServiceI;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefAddCmd;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefPageQry;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefUpdateCmd;
|
||||
import org.qinan.safetyeval.client.ref.response.OrgBusinessScopeDeviceRefCo;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @Author: ltq
|
||||
* @Date: 2026-07-14 09:20:11
|
||||
*/
|
||||
@RestController
|
||||
@AllArgsConstructor
|
||||
@Api(tags = "安全评价机构业务范围与设备参照")
|
||||
@RequestMapping("/ref")
|
||||
public class OrgBusinessScopeDeviceRefController implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final OrgBusinessScopeDeviceRefServiceI orgBusinessScopeDeviceRefServiceI;
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询安全评价机构业务范围与设备参照列表-分页")
|
||||
public PageResponse<OrgBusinessScopeDeviceRefCo> list(@Validated OrgBusinessScopeDeviceRefPageQry qry) {
|
||||
return orgBusinessScopeDeviceRefServiceI.listOrgBusinessScopeDeviceRefPage(qry);
|
||||
}
|
||||
|
||||
@GetMapping("/{id}")
|
||||
@ApiOperation("查询安全评价机构业务范围与设备参照详情页面")
|
||||
public SingleResponse<OrgBusinessScopeDeviceRefCo> getInfo(@PathVariable("id") Long id) {
|
||||
return SingleResponse.of(orgBusinessScopeDeviceRefServiceI.getOrgBusinessScopeDeviceRefById(id));
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增安全评价机构业务范围与设备参照")
|
||||
public Response save(@Validated @RequestBody OrgBusinessScopeDeviceRefAddCmd orgBusinessScopeDeviceRefAddCmd) {
|
||||
orgBusinessScopeDeviceRefServiceI.saveOrgBusinessScopeDeviceRef(orgBusinessScopeDeviceRefAddCmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改安全评价机构业务范围与设备参照")
|
||||
public Response update(@Validated @RequestBody OrgBusinessScopeDeviceRefUpdateCmd orgBusinessScopeDeviceRefUpdateCmd) {
|
||||
orgBusinessScopeDeviceRefServiceI.updateOrgBusinessScopeDeviceRef(orgBusinessScopeDeviceRefUpdateCmd);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
@ApiOperation("删除安全评价机构业务范围与设备参照(单个)")
|
||||
public Response deletedById(@PathVariable("id") Long id) {
|
||||
orgBusinessScopeDeviceRefServiceI.deletedOrgBusinessScopeDeviceRefById(id);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
@DeleteMapping("/ids")
|
||||
@ApiOperation("删除安全评价机构业务范围与设备参照(多个)")
|
||||
public Response deletedByIds(@RequestParam Long[] ids) {
|
||||
orgBusinessScopeDeviceRefServiceI.deletedOrgBusinessScopeDeviceRefByIds(ids);
|
||||
return Response.buildSuccess();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package org.qinan.safetyeval.app.ref.convertor;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.Mapping;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefAddCmd;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefUpdateCmd;
|
||||
import org.qinan.safetyeval.domain.ref.model.OrgBusinessScopeDeviceRefE;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照转换
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface OrgBusinessScopeDeviceRefCmdConvertor {
|
||||
/**
|
||||
* cmd_add转领域模型
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefAddCmd
|
||||
* @return
|
||||
*/
|
||||
@Mapping(target = "orgBusinessScopeDeviceRefGateway", ignore = true)
|
||||
OrgBusinessScopeDeviceRefE convertCmdToE(OrgBusinessScopeDeviceRefAddCmd orgBusinessScopeDeviceRefAddCmd);
|
||||
|
||||
/**
|
||||
* cmd_update转领域模型
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefUpdateCmd
|
||||
* @return
|
||||
*/
|
||||
@Mapping(target = "orgBusinessScopeDeviceRefGateway", ignore = true)
|
||||
OrgBusinessScopeDeviceRefE convertCmdToE(OrgBusinessScopeDeviceRefUpdateCmd orgBusinessScopeDeviceRefUpdateCmd);
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package org.qinan.safetyeval.app.ref.executor.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.app.ref.convertor.OrgBusinessScopeDeviceRefCmdConvertor;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefAddCmd;
|
||||
import org.qinan.safetyeval.domain.ref.ability.OrgBusinessScopeDeviceRefAbility;
|
||||
import org.qinan.safetyeval.domain.ref.model.OrgBusinessScopeDeviceRefE;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.queryservice.OrgBusinessScopeDeviceRefQueryService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 新增安全评价机构业务范围与设备参照执行器
|
||||
*
|
||||
* @author ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefAddCmdExe {
|
||||
|
||||
private final OrgBusinessScopeDeviceRefQueryService orgBusinessScopeDeviceRefQueryService;
|
||||
private final OrgBusinessScopeDeviceRefCmdConvertor orgBusinessScopeDeviceRefCmdConvertor;
|
||||
private final OrgBusinessScopeDeviceRefAbility orgBusinessScopeDeviceRefAbility;
|
||||
|
||||
/**
|
||||
* 新增安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefAddCmd 新增安全评价机构业务范围与设备参照对象
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(OrgBusinessScopeDeviceRefAddCmd orgBusinessScopeDeviceRefAddCmd) {
|
||||
OrgBusinessScopeDeviceRefE orgBusinessScopeDeviceRefE = orgBusinessScopeDeviceRefCmdConvertor.convertCmdToE(orgBusinessScopeDeviceRefAddCmd);
|
||||
boolean res = orgBusinessScopeDeviceRefE.add();
|
||||
if (!res) {
|
||||
throw new BizException("保存失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
package org.qinan.safetyeval.app.ref.executor.command;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.domain.ref.ability.OrgBusinessScopeDeviceRefAbility;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 删除安全评价机构业务范围与设备参照询执行器
|
||||
*
|
||||
* @author ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefDelCmdExe {
|
||||
private final OrgBusinessScopeDeviceRefAbility orgBusinessScopeDeviceRefAbility;
|
||||
|
||||
/**
|
||||
* 根据IDS删除安全评价机构业务范围与设备参照对象
|
||||
*
|
||||
* @param ids 安全评价机构业务范围与设备参照ID数组
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long[] ids) {
|
||||
if (ObjectUtil.isEmpty(ids)) {
|
||||
throw new BizException("请传入正确的ID");
|
||||
}
|
||||
boolean deleteRes = orgBusinessScopeDeviceRefAbility.deletedOrgBusinessScopeDeviceRefByIds(ids);
|
||||
if (!deleteRes) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID删除安全评价机构业务范围与设备参照对象
|
||||
*
|
||||
* @param id 删除安全评价机构业务范围与设备参照对象ID
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(Long id) {
|
||||
boolean deleteRes = orgBusinessScopeDeviceRefAbility.deletedOrgBusinessScopeDeviceRefById(id);
|
||||
if (!deleteRes) {
|
||||
throw new BizException("删除失败");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package org.qinan.safetyeval.app.ref.executor.command;
|
||||
|
||||
import com.alibaba.cola.exception.BizException;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.app.ref.convertor.OrgBusinessScopeDeviceRefCmdConvertor;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefUpdateCmd;
|
||||
import org.qinan.safetyeval.domain.ref.ability.OrgBusinessScopeDeviceRefAbility;
|
||||
import org.qinan.safetyeval.domain.ref.model.OrgBusinessScopeDeviceRefE;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.queryservice.OrgBusinessScopeDeviceRefQueryService;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 修改安全评价机构业务范围与设备参照资源执行器
|
||||
*
|
||||
* @author ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefUpdateCmdExe {
|
||||
private final OrgBusinessScopeDeviceRefQueryService orgBusinessScopeDeviceRefQueryService;
|
||||
private final OrgBusinessScopeDeviceRefCmdConvertor orgBusinessScopeDeviceRefCmdConvertor;
|
||||
private final OrgBusinessScopeDeviceRefAbility orgBusinessScopeDeviceRefAbility;
|
||||
|
||||
/**
|
||||
* 修改安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefUpdateCmd 修改安全评价机构业务范围与设备参照对象
|
||||
* @return
|
||||
*/
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean execute(OrgBusinessScopeDeviceRefUpdateCmd orgBusinessScopeDeviceRefUpdateCmd) {
|
||||
OrgBusinessScopeDeviceRefE orgBusinessScopeDeviceRefE = orgBusinessScopeDeviceRefCmdConvertor.convertCmdToE(orgBusinessScopeDeviceRefUpdateCmd);
|
||||
Boolean updateRes = orgBusinessScopeDeviceRefE.update();
|
||||
if (!updateRes) {
|
||||
throw new BizException("数据已被更新,请刷新重试");
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
package org.qinan.safetyeval.app.ref.executor.query;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.client.ref.response.OrgBusinessScopeDeviceRefCo;
|
||||
import org.qinan.safetyeval.infrastructure.convertor.OrgBusinessScopeDeviceRefDoConvertor;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgBusinessScopeDeviceRefDO;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.queryservice.OrgBusinessScopeDeviceRefQueryService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照查询执行器
|
||||
*
|
||||
* @author ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefListQueryExe {
|
||||
|
||||
private final OrgBusinessScopeDeviceRefQueryService orgBusinessScopeDeviceRefQueryService;
|
||||
private final OrgBusinessScopeDeviceRefDoConvertor orgBusinessScopeDeviceRefDoConvertor;
|
||||
|
||||
/**
|
||||
* 根据ID查找安全评价机构业务范围与设备参照对象
|
||||
*
|
||||
* @param id 安全评价机构业务范围与设备参照ID
|
||||
* @return
|
||||
*/
|
||||
public OrgBusinessScopeDeviceRefCo execute(Long id) {
|
||||
OrgBusinessScopeDeviceRefDO orgBusinessScopeDeviceRefDO = orgBusinessScopeDeviceRefQueryService.getById(id);
|
||||
return orgBusinessScopeDeviceRefDoConvertor.converDoToCo(orgBusinessScopeDeviceRefDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package org.qinan.safetyeval.app.ref.executor.query;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefPageQry;
|
||||
import org.qinan.safetyeval.client.ref.response.OrgBusinessScopeDeviceRefCo;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.queryservice.OrgBusinessScopeDeviceRefQueryService;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照分页查询执行器
|
||||
*
|
||||
* @author ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Component
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefPageQueryExe {
|
||||
|
||||
private final OrgBusinessScopeDeviceRefQueryService orgBusinessScopeDeviceRefQueryService;
|
||||
|
||||
/**
|
||||
* 分页查找安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefPageQry
|
||||
* @return
|
||||
*/
|
||||
public PageResponse<OrgBusinessScopeDeviceRefCo> execute(OrgBusinessScopeDeviceRefPageQry orgBusinessScopeDeviceRefPageQry) {
|
||||
return orgBusinessScopeDeviceRefQueryService.listOrgBusinessScopeDeviceRefPage(orgBusinessScopeDeviceRefPageQry);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package org.qinan.safetyeval.app.ref.service;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefAddCmd;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefPageQry;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefUpdateCmd;
|
||||
import org.qinan.safetyeval.client.ref.response.OrgBusinessScopeDeviceRefCo;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
public interface OrgBusinessScopeDeviceRefServiceI {
|
||||
/**
|
||||
* 分页获取安全评价机构业务范围与设备参照列表
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefPageQry 查找条件对象
|
||||
* @return 结果集
|
||||
*/
|
||||
PageResponse<OrgBusinessScopeDeviceRefCo> listOrgBusinessScopeDeviceRefPage(OrgBusinessScopeDeviceRefPageQry orgBusinessScopeDeviceRefPageQry);
|
||||
|
||||
/**
|
||||
* 根据ID获取安全评价机构业务范围与设备参照详情
|
||||
*
|
||||
* @param id 安全评价机构业务范围与设备参照ID
|
||||
* @return 结果集
|
||||
*/
|
||||
OrgBusinessScopeDeviceRefCo getOrgBusinessScopeDeviceRefById(Long id);
|
||||
|
||||
/**
|
||||
* 新增安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefAddCmd 安全评价机构业务范围与设备参照
|
||||
* @return 结果
|
||||
*/
|
||||
boolean saveOrgBusinessScopeDeviceRef(OrgBusinessScopeDeviceRefAddCmd orgBusinessScopeDeviceRefAddCmd);
|
||||
|
||||
/**
|
||||
* 修改安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefUpdateCmd 安全评价机构业务范围与设备参照
|
||||
* @return 结果
|
||||
*/
|
||||
boolean updateOrgBusinessScopeDeviceRef(OrgBusinessScopeDeviceRefUpdateCmd orgBusinessScopeDeviceRefUpdateCmd);
|
||||
|
||||
/**
|
||||
* 删除安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param id 安全评价机构业务范围与设备参照ID
|
||||
* @return 结果
|
||||
*/
|
||||
boolean deletedOrgBusinessScopeDeviceRefById(Long id);
|
||||
|
||||
/**
|
||||
* 删除安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param ids 安全评价机构业务范围与设备参照IDs
|
||||
* @return 结果
|
||||
*/
|
||||
boolean deletedOrgBusinessScopeDeviceRefByIds(Long[] ids);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
package org.qinan.safetyeval.app.ref.service.impl;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.app.ref.executor.command.OrgBusinessScopeDeviceRefAddCmdExe;
|
||||
import org.qinan.safetyeval.app.ref.executor.command.OrgBusinessScopeDeviceRefDelCmdExe;
|
||||
import org.qinan.safetyeval.app.ref.executor.command.OrgBusinessScopeDeviceRefUpdateCmdExe;
|
||||
import org.qinan.safetyeval.app.ref.executor.query.OrgBusinessScopeDeviceRefListQueryExe;
|
||||
import org.qinan.safetyeval.app.ref.executor.query.OrgBusinessScopeDeviceRefPageQueryExe;
|
||||
import org.qinan.safetyeval.app.ref.service.OrgBusinessScopeDeviceRefServiceI;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefAddCmd;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefPageQry;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefUpdateCmd;
|
||||
import org.qinan.safetyeval.client.ref.response.OrgBusinessScopeDeviceRefCo;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefServiceImpl implements OrgBusinessScopeDeviceRefServiceI {
|
||||
|
||||
private final OrgBusinessScopeDeviceRefListQueryExe orgBusinessScopeDeviceRefListQueryExe;
|
||||
private final OrgBusinessScopeDeviceRefUpdateCmdExe orgBusinessScopeDeviceRefUpdateCommandExe;
|
||||
private final OrgBusinessScopeDeviceRefAddCmdExe orgBusinessScopeDeviceRefAddCommandExe;
|
||||
private final OrgBusinessScopeDeviceRefDelCmdExe orgBusinessScopeDeviceRefDelCommandExe;
|
||||
private final OrgBusinessScopeDeviceRefPageQueryExe orgBusinessScopeDeviceRefPageQueryExe;
|
||||
|
||||
@Override
|
||||
public PageResponse<OrgBusinessScopeDeviceRefCo> listOrgBusinessScopeDeviceRefPage(OrgBusinessScopeDeviceRefPageQry orgBusinessScopeDeviceRefPageQry) {
|
||||
return orgBusinessScopeDeviceRefPageQueryExe.execute(orgBusinessScopeDeviceRefPageQry);
|
||||
}
|
||||
|
||||
@Override
|
||||
public OrgBusinessScopeDeviceRefCo getOrgBusinessScopeDeviceRefById(Long id) {
|
||||
return orgBusinessScopeDeviceRefListQueryExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean saveOrgBusinessScopeDeviceRef(OrgBusinessScopeDeviceRefAddCmd orgBusinessScopeDeviceRefAddCmd) {
|
||||
return orgBusinessScopeDeviceRefAddCommandExe.execute(orgBusinessScopeDeviceRefAddCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateOrgBusinessScopeDeviceRef(OrgBusinessScopeDeviceRefUpdateCmd orgBusinessScopeDeviceRefUpdateCmd) {
|
||||
return orgBusinessScopeDeviceRefUpdateCommandExe.execute(orgBusinessScopeDeviceRefUpdateCmd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deletedOrgBusinessScopeDeviceRefById(Long id) {
|
||||
return orgBusinessScopeDeviceRefDelCommandExe.execute(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean deletedOrgBusinessScopeDeviceRefByIds(Long[] ids) {
|
||||
return orgBusinessScopeDeviceRefDelCommandExe.execute(ids);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package org.qinan.safetyeval.client.ref.request;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照新增Cmd
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Data
|
||||
public class OrgBusinessScopeDeviceRefAddCmd implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 行业code ("COAL_MINING", "煤炭开采业"), ("METAL_NONMETAL_MINING", "金属、非金属矿及其他矿采选业"),("ONSHORE_OIL_GAS", "陆地石油和天然气开采业"),("ONSHORE_OIL_GAS_PIPELINE", "陆上油气管道运输业"),("PETROCHEMICAL_CHEMICAL_PHARMACEUTICAL", "石油加工业,化学原料、化学品及医药制造业"),("FIREWORKS_FIRECRACKERS", "烟花爆竹制造业"),("METAL_SMELTING", "金属冶炼"); */
|
||||
@ApiModelProperty(value = "看 IndustryEnum")
|
||||
private String industryCode;
|
||||
/**
|
||||
* 设备code
|
||||
*/
|
||||
@ApiModelProperty(value = "设备code")
|
||||
private String deviceCode;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ApiModelProperty(value = "设备名称", required = true)
|
||||
@NotBlank(message = "设备名称不能为空")
|
||||
private String deviceName;
|
||||
/**
|
||||
* 环境
|
||||
*/
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package org.qinan.safetyeval.client.ref.request;
|
||||
|
||||
import com.alibaba.cola.dto.PageQuery;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照分页查询Qry
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Data
|
||||
public class OrgBusinessScopeDeviceRefPageQry extends PageQuery {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 行业code ("COAL_MINING", "煤炭开采业"), ("METAL_NONMETAL_MINING", "金属、非金属矿及其他矿采选业"),("ONSHORE_OIL_GAS", "陆地石油和天然气开采业"),("ONSHORE_OIL_GAS_PIPELINE", "陆上油气管道运输业"),("PETROCHEMICAL_CHEMICAL_PHARMACEUTICAL", "石油加工业,化学原料、化学品及医药制造业"),("FIREWORKS_FIRECRACKERS", "烟花爆竹制造业"),("METAL_SMELTING", "金属冶炼"); */
|
||||
@ApiModelProperty(value = "行业code 看 IndustryEnum")
|
||||
private String industryCode;
|
||||
/**
|
||||
* 设备code
|
||||
*/
|
||||
@ApiModelProperty(value = "设备code")
|
||||
private String deviceCode;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
/**
|
||||
* 环境
|
||||
*/
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package org.qinan.safetyeval.client.ref.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照修改Cmd
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Data
|
||||
public class OrgBusinessScopeDeviceRefUpdateCmd implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long id;
|
||||
/** 行业code ("COAL_MINING", "煤炭开采业"), ("METAL_NONMETAL_MINING", "金属、非金属矿及其他矿采选业"),("ONSHORE_OIL_GAS", "陆地石油和天然气开采业"),("ONSHORE_OIL_GAS_PIPELINE", "陆上油气管道运输业"),("PETROCHEMICAL_CHEMICAL_PHARMACEUTICAL", "石油加工业,化学原料、化学品及医药制造业"),("FIREWORKS_FIRECRACKERS", "烟花爆竹制造业"),("METAL_SMELTING", "金属冶炼"); */
|
||||
@ApiModelProperty(value = "看 IndustryEnum")
|
||||
private String industryCode;
|
||||
/**
|
||||
* 设备code
|
||||
*/
|
||||
@ApiModelProperty(value = "设备code")
|
||||
private String deviceCode;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ApiModelProperty(value = "设备名称", required = true)
|
||||
@NotBlank(message = "设备名称不能为空")
|
||||
private String deviceName;
|
||||
/**
|
||||
* 环境
|
||||
*/
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
@NotNull(message = "version不能为空")
|
||||
@ApiModelProperty(value = "version")
|
||||
private Integer version;
|
||||
}
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
package org.qinan.safetyeval.client.ref.response;
|
||||
|
||||
import com.alibaba.cola.dto.ClientObject;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照Co
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Data
|
||||
public class OrgBusinessScopeDeviceRefCo extends ClientObject {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING)
|
||||
private Long id;
|
||||
/** 行业code ("COAL_MINING", "煤炭开采业"), ("METAL_NONMETAL_MINING", "金属、非金属矿及其他矿采选业"),("ONSHORE_OIL_GAS", "陆地石油和天然气开采业"),("ONSHORE_OIL_GAS_PIPELINE", "陆上油气管道运输业"),("PETROCHEMICAL_CHEMICAL_PHARMACEUTICAL", "石油加工业,化学原料、化学品及医药制造业"),("FIREWORKS_FIRECRACKERS", "烟花爆竹制造业"),("METAL_SMELTING", "金属冶炼"); */
|
||||
@ApiModelProperty(value = "行业code 看 IndustryEnum")
|
||||
private String industryCode;
|
||||
/**
|
||||
* 设备code
|
||||
*/
|
||||
@ApiModelProperty(value = "设备code")
|
||||
private String deviceCode;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
@ApiModelProperty(value = "设备名称")
|
||||
private String deviceName;
|
||||
/**
|
||||
* 环境
|
||||
*/
|
||||
@ApiModelProperty(value = "环境")
|
||||
private String env;
|
||||
@ApiModelProperty(value = "version")
|
||||
private Integer version;
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
package org.qinan.safetyeval.domain.ref.ability;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.domain.ref.gateway.OrgBusinessScopeDeviceRefGateway;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefAbility {
|
||||
/**
|
||||
* 网关
|
||||
**/
|
||||
private final OrgBusinessScopeDeviceRefGateway orgBusinessScopeDeviceRefGateway;
|
||||
|
||||
|
||||
public boolean deletedOrgBusinessScopeDeviceRefById(Long id) {
|
||||
return orgBusinessScopeDeviceRefGateway.deletedOrgBusinessScopeDeviceRefById(id);
|
||||
}
|
||||
|
||||
public boolean deletedOrgBusinessScopeDeviceRefByIds(Long[] ids) {
|
||||
return orgBusinessScopeDeviceRefGateway.deletedOrgBusinessScopeDeviceRefByIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
package org.qinan.safetyeval.domain.ref.gateway;
|
||||
|
||||
import org.qinan.safetyeval.domain.ref.model.OrgBusinessScopeDeviceRefE;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照网关
|
||||
*
|
||||
* @Author: WGG
|
||||
* @Date: 2022/3/22 16:49
|
||||
*/
|
||||
public interface OrgBusinessScopeDeviceRefGateway {
|
||||
|
||||
/**
|
||||
* 新增安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefE 安全评价机构业务范围与设备参照
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean add(OrgBusinessScopeDeviceRefE orgBusinessScopeDeviceRefE);
|
||||
|
||||
/**
|
||||
* 修改安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefE 安全评价机构业务范围与设备参照
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean update(OrgBusinessScopeDeviceRefE orgBusinessScopeDeviceRefE);
|
||||
|
||||
/**
|
||||
* 删除安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param id
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean deletedOrgBusinessScopeDeviceRefById(Long id);
|
||||
|
||||
/**
|
||||
* 删除安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param ids
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean deletedOrgBusinessScopeDeviceRefByIds(Long[] ids);
|
||||
}
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
package org.qinan.safetyeval.domain.ref.model;
|
||||
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.alibaba.cola.domain.DomainFactory;
|
||||
import com.alibaba.cola.domain.Entity;
|
||||
import com.jjb.saas.framework.domain.model.BaseE;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.qinan.safetyeval.domain.ref.gateway.OrgBusinessScopeDeviceRefGateway;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照领域模型
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Data
|
||||
@Entity
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class OrgBusinessScopeDeviceRefE extends BaseE {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 行业code ("COAL_MINING", "煤炭开采业"), ("METAL_NONMETAL_MINING", "金属、非金属矿及其他矿采选业"),("ONSHORE_OIL_GAS", "陆地石油和天然气开采业"),("ONSHORE_OIL_GAS_PIPELINE", "陆上油气管道运输业"),("PETROCHEMICAL_CHEMICAL_PHARMACEUTICAL", "石油加工业,化学原料、化学品及医药制造业"),("FIREWORKS_FIRECRACKERS", "烟花爆竹制造业"),("METAL_SMELTING", "金属冶炼");
|
||||
*/
|
||||
private String industryCode;
|
||||
/**
|
||||
* 设备code
|
||||
*/
|
||||
private String deviceCode;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
/**
|
||||
* 环境
|
||||
*/
|
||||
private String env;
|
||||
private transient OrgBusinessScopeDeviceRefGateway orgBusinessScopeDeviceRefGateway;
|
||||
|
||||
public OrgBusinessScopeDeviceRefE() {
|
||||
this.orgBusinessScopeDeviceRefGateway = SpringUtil.getBean(OrgBusinessScopeDeviceRefGateway.class);
|
||||
}
|
||||
|
||||
public static OrgBusinessScopeDeviceRefE of() {
|
||||
return DomainFactory.create(OrgBusinessScopeDeviceRefE.class);
|
||||
}
|
||||
|
||||
public boolean add() {
|
||||
return orgBusinessScopeDeviceRefGateway.add(this);
|
||||
}
|
||||
|
||||
public boolean update() {
|
||||
return orgBusinessScopeDeviceRefGateway.update(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package org.qinan.safetyeval.infrastructure.convertor;
|
||||
|
||||
import org.mapstruct.Mapper;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefPageQry;
|
||||
import org.qinan.safetyeval.client.ref.response.OrgBusinessScopeDeviceRefCo;
|
||||
import org.qinan.safetyeval.domain.ref.model.OrgBusinessScopeDeviceRefE;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgBusinessScopeDeviceRefDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照对象转换
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Mapper(componentModel = "spring")
|
||||
public interface OrgBusinessScopeDeviceRefDoConvertor {
|
||||
/**
|
||||
* 领域对象转DO
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefE
|
||||
* @return
|
||||
*/
|
||||
OrgBusinessScopeDeviceRefDO convertEeToDo(OrgBusinessScopeDeviceRefE orgBusinessScopeDeviceRefE);
|
||||
|
||||
/**
|
||||
* DO转Co
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefDo DO
|
||||
* @return
|
||||
*/
|
||||
|
||||
OrgBusinessScopeDeviceRefCo converDoToCo(OrgBusinessScopeDeviceRefDO orgBusinessScopeDeviceRefDo);
|
||||
|
||||
/**
|
||||
* qry TO DO
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefPageQry
|
||||
* @return
|
||||
*/
|
||||
|
||||
OrgBusinessScopeDeviceRefDO convertQryToDo(OrgBusinessScopeDeviceRefPageQry orgBusinessScopeDeviceRefPageQry);
|
||||
|
||||
/**
|
||||
* DOs转Cos
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefDos dos
|
||||
* @return
|
||||
*/
|
||||
List<OrgBusinessScopeDeviceRefCo> converDosToCos(List<OrgBusinessScopeDeviceRefDO> orgBusinessScopeDeviceRefDos);
|
||||
}
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
package org.qinan.safetyeval.infrastructure.gateway;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.domain.ref.gateway.OrgBusinessScopeDeviceRefGateway;
|
||||
import org.qinan.safetyeval.domain.ref.model.OrgBusinessScopeDeviceRefE;
|
||||
import org.qinan.safetyeval.infrastructure.convertor.OrgBusinessScopeDeviceRefDoConvertor;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgBusinessScopeDeviceRefDO;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.repository.OrgBusinessScopeDeviceRefRepository;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照网关实现
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefGatewayImpl implements OrgBusinessScopeDeviceRefGateway {
|
||||
private final OrgBusinessScopeDeviceRefRepository orgBusinessScopeDeviceRefRepository;
|
||||
private final OrgBusinessScopeDeviceRefDoConvertor orgBusinessScopeDeviceRefDoConvertor;
|
||||
|
||||
@Override
|
||||
public Boolean add(OrgBusinessScopeDeviceRefE orgBusinessScopeDeviceRefE) {
|
||||
OrgBusinessScopeDeviceRefDO orgBusinessScopeDeviceRefDO = orgBusinessScopeDeviceRefDoConvertor.convertEeToDo(orgBusinessScopeDeviceRefE);
|
||||
boolean res = orgBusinessScopeDeviceRefRepository.addOrgBusinessScopeDeviceRef(orgBusinessScopeDeviceRefDO);
|
||||
if (res) {
|
||||
orgBusinessScopeDeviceRefE.setId(orgBusinessScopeDeviceRefDO.getId());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean update(OrgBusinessScopeDeviceRefE orgBusinessScopeDeviceRefE) {
|
||||
boolean res = orgBusinessScopeDeviceRefRepository.updateOrgBusinessScopeDeviceRef(orgBusinessScopeDeviceRefDoConvertor.convertEeToDo(orgBusinessScopeDeviceRefE));
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedOrgBusinessScopeDeviceRefById(Long id) {
|
||||
return orgBusinessScopeDeviceRefRepository.deletedOrgBusinessScopeDeviceRefById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedOrgBusinessScopeDeviceRefByIds(Long[] ids) {
|
||||
return orgBusinessScopeDeviceRefRepository.deletedOrgBusinessScopeDeviceRefByIds(ids);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
package org.qinan.safetyeval.infrastructure.persistence.domainobject;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jjb.saas.framework.repository.basedo.BaseDO;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照领域模型
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("org_business_scope_device_ref")
|
||||
public class OrgBusinessScopeDeviceRefDO extends BaseDO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 行业code ("COAL_MINING", "煤炭开采业"), ("METAL_NONMETAL_MINING", "金属、非金属矿及其他矿采选业"),("ONSHORE_OIL_GAS", "陆地石油和天然气开采业"),("ONSHORE_OIL_GAS_PIPELINE", "陆上油气管道运输业"),("PETROCHEMICAL_CHEMICAL_PHARMACEUTICAL", "石油加工业,化学原料、化学品及医药制造业"),("FIREWORKS_FIRECRACKERS", "烟花爆竹制造业"),("METAL_SMELTING", "金属冶炼");
|
||||
*/
|
||||
private String industryCode;
|
||||
/**
|
||||
* 设备code
|
||||
*/
|
||||
private String deviceCode;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String deviceName;
|
||||
/**
|
||||
* 环境
|
||||
*/
|
||||
private String env;
|
||||
}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package org.qinan.safetyeval.infrastructure.persistence.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgBusinessScopeDeviceRefDO;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照Mapper
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Mapper
|
||||
public interface OrgBusinessScopeDeviceRefMapper extends BaseMapper<OrgBusinessScopeDeviceRefDO> {
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package org.qinan.safetyeval.infrastructure.persistence.queryservice;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefPageQry;
|
||||
import org.qinan.safetyeval.client.ref.response.OrgBusinessScopeDeviceRefCo;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgBusinessScopeDeviceRefDO;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
public interface OrgBusinessScopeDeviceRefQueryService {
|
||||
|
||||
/**
|
||||
* 根据ID查找
|
||||
*
|
||||
* @param id 安全评价机构业务范围与设备参照ID
|
||||
* @return
|
||||
*/
|
||||
OrgBusinessScopeDeviceRefDO getById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查询安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefPageQry 分页Qry
|
||||
* @return
|
||||
*/
|
||||
PageResponse<OrgBusinessScopeDeviceRefCo> listOrgBusinessScopeDeviceRefPage(OrgBusinessScopeDeviceRefPageQry orgBusinessScopeDeviceRefPageQry);
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package org.qinan.safetyeval.infrastructure.persistence.queryservice.impl;
|
||||
|
||||
import com.alibaba.cola.dto.PageResponse;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.common.PageHelper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefPageQry;
|
||||
import org.qinan.safetyeval.client.ref.response.OrgBusinessScopeDeviceRefCo;
|
||||
import org.qinan.safetyeval.infrastructure.convertor.OrgBusinessScopeDeviceRefDoConvertor;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgBusinessScopeDeviceRefDO;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.queryservice.OrgBusinessScopeDeviceRefQueryService;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.repository.OrgBusinessScopeDeviceRefRepository;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefQueryServiceImpl implements OrgBusinessScopeDeviceRefQueryService {
|
||||
|
||||
private final OrgBusinessScopeDeviceRefRepository orgBusinessScopeDeviceRefRepository;
|
||||
private final OrgBusinessScopeDeviceRefDoConvertor orgBusinessScopeDeviceRefDoConvertor;
|
||||
|
||||
@Override
|
||||
public OrgBusinessScopeDeviceRefDO getById(Long id) {
|
||||
return orgBusinessScopeDeviceRefRepository.getById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResponse<OrgBusinessScopeDeviceRefCo> listOrgBusinessScopeDeviceRefPage(OrgBusinessScopeDeviceRefPageQry orgBusinessScopeDeviceRefPageQry) {
|
||||
IPage<OrgBusinessScopeDeviceRefDO> orgBusinessScopeDeviceRefDoPage = orgBusinessScopeDeviceRefRepository.listOrgBusinessScopeDeviceRefPage(PageHelper.queryToPage(orgBusinessScopeDeviceRefPageQry), orgBusinessScopeDeviceRefPageQry);
|
||||
List<OrgBusinessScopeDeviceRefCo> orgBusinessScopeDeviceRefCoS = orgBusinessScopeDeviceRefDoConvertor.converDosToCos(orgBusinessScopeDeviceRefDoPage.getRecords());
|
||||
return PageHelper.pageToResponse(orgBusinessScopeDeviceRefDoPage, orgBusinessScopeDeviceRefCoS);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
package org.qinan.safetyeval.infrastructure.persistence.repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.repository.repo.BaseRepository;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefPageQry;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgBusinessScopeDeviceRefDO;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
public interface OrgBusinessScopeDeviceRefRepository extends BaseRepository<OrgBusinessScopeDeviceRefDO> {
|
||||
/**
|
||||
* 根据ID查找
|
||||
*
|
||||
* @param id 安全评价机构业务范围与设备参照ID
|
||||
* @return
|
||||
*/
|
||||
OrgBusinessScopeDeviceRefDO getById(Long id);
|
||||
|
||||
/**
|
||||
* 分页查找安全评价机构业务范围与设备参照对象
|
||||
*
|
||||
* @param iPage 分页对象
|
||||
* @param orgBusinessScopeDeviceRefPageQry 条件对象
|
||||
* @return ipage
|
||||
*/
|
||||
IPage<OrgBusinessScopeDeviceRefDO> listOrgBusinessScopeDeviceRefPage(IPage iPage, OrgBusinessScopeDeviceRefPageQry orgBusinessScopeDeviceRefPageQry);
|
||||
|
||||
/**
|
||||
* 新增安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefDO 安全评价机构业务范围与设备参照
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean addOrgBusinessScopeDeviceRef(OrgBusinessScopeDeviceRefDO orgBusinessScopeDeviceRefDO);
|
||||
|
||||
/**
|
||||
* 修改安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param orgBusinessScopeDeviceRefDO 安全评价机构业务范围与设备参照
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean updateOrgBusinessScopeDeviceRef(OrgBusinessScopeDeviceRefDO orgBusinessScopeDeviceRefDO);
|
||||
|
||||
|
||||
/**
|
||||
* 删除安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param id
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean deletedOrgBusinessScopeDeviceRefById(Long id);
|
||||
|
||||
/**
|
||||
* 删除安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @param ids
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean deletedOrgBusinessScopeDeviceRefByIds(Long[] ids);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
package org.qinan.safetyeval.infrastructure.persistence.repository.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jjb.saas.framework.enums.enums.BooleanEnum;
|
||||
import com.jjb.saas.framework.repository.repo.impl.BaseRepositoryImpl;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.qinan.safetyeval.client.ref.request.OrgBusinessScopeDeviceRefPageQry;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgBusinessScopeDeviceRefDO;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.mapper.OrgBusinessScopeDeviceRefMapper;
|
||||
import org.qinan.safetyeval.infrastructure.persistence.repository.OrgBusinessScopeDeviceRefRepository;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 安全评价机构业务范围与设备参照
|
||||
*
|
||||
* @Author: ltq
|
||||
* @date 2026-07-14 09:20:11
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
public class OrgBusinessScopeDeviceRefRepositoryImpl extends BaseRepositoryImpl<OrgBusinessScopeDeviceRefMapper, OrgBusinessScopeDeviceRefDO> implements OrgBusinessScopeDeviceRefRepository {
|
||||
|
||||
private final OrgBusinessScopeDeviceRefMapper orgBusinessScopeDeviceRefMapper;
|
||||
|
||||
@Override
|
||||
public OrgBusinessScopeDeviceRefDO getById(Long id) {
|
||||
return super.lambdaQuery().eq(OrgBusinessScopeDeviceRefDO::getId, id).eq(OrgBusinessScopeDeviceRefDO::getDeleteEnum, BooleanEnum.FALSE.getValue()).one();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<OrgBusinessScopeDeviceRefDO> listOrgBusinessScopeDeviceRefPage(IPage iPage, OrgBusinessScopeDeviceRefPageQry orgBusinessScopeDeviceRefPageQry) {
|
||||
QueryWrapper<OrgBusinessScopeDeviceRefDO> orgBusinessScopeDeviceRefDoQueryWrapper = new QueryWrapper<>();
|
||||
if (ObjectUtil.isNotEmpty(orgBusinessScopeDeviceRefPageQry.getIndustryCode())) {
|
||||
orgBusinessScopeDeviceRefDoQueryWrapper.eq("industry_code", orgBusinessScopeDeviceRefPageQry.getIndustryCode());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(orgBusinessScopeDeviceRefPageQry.getDeviceCode())) {
|
||||
orgBusinessScopeDeviceRefDoQueryWrapper.eq("device_code", orgBusinessScopeDeviceRefPageQry.getDeviceCode());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(orgBusinessScopeDeviceRefPageQry.getDeviceName())) {
|
||||
orgBusinessScopeDeviceRefDoQueryWrapper.like("device_name", orgBusinessScopeDeviceRefPageQry.getDeviceName());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(orgBusinessScopeDeviceRefPageQry.getEnv())) {
|
||||
orgBusinessScopeDeviceRefDoQueryWrapper.eq("env", orgBusinessScopeDeviceRefPageQry.getEnv());
|
||||
}
|
||||
orgBusinessScopeDeviceRefDoQueryWrapper.eq("delete_enum", BooleanEnum.FALSE.getValue());
|
||||
return orgBusinessScopeDeviceRefMapper.selectPage(iPage, orgBusinessScopeDeviceRefDoQueryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean addOrgBusinessScopeDeviceRef(OrgBusinessScopeDeviceRefDO orgBusinessScopeDeviceRefDO) {
|
||||
return super.save(orgBusinessScopeDeviceRefDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean updateOrgBusinessScopeDeviceRef(OrgBusinessScopeDeviceRefDO orgBusinessScopeDeviceRefDO) {
|
||||
return super.updateById(orgBusinessScopeDeviceRefDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedOrgBusinessScopeDeviceRefById(Long id) {
|
||||
return super.removeEnById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean deletedOrgBusinessScopeDeviceRefByIds(Long[] ids) {
|
||||
return super.removeBatchEnByIds(Arrays.asList(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<?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="org.qinan.safetyeval.infrastructure.persistence.mapper.OrgBusinessScopeDeviceRefMapper">
|
||||
<resultMap type="org.qinan.safetyeval.infrastructure.persistence.domainobject.OrgBusinessScopeDeviceRefDO"
|
||||
id="OrgBusinessScopeDeviceRefResult">
|
||||
<id property="id" column="id"/>
|
||||
<result property="industryCode" column="industry_code"/>
|
||||
<result property="deviceCode" column="device_code"/>
|
||||
<result property="deviceName" column="device_name"/>
|
||||
<result property="deleteEnum" column="delete_enum"/>
|
||||
<result property="remarks" column="remarks"/>
|
||||
<result property="createName" column="create_name"/>
|
||||
<result property="updateName" column="update_name"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="version" column="version"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="createId" column="create_id"/>
|
||||
<result property="updateId" column="update_id"/>
|
||||
<result property="env" column="env"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOrgBusinessScopeDeviceRef">
|
||||
select id,
|
||||
industry_code,
|
||||
device_code,
|
||||
device_name,
|
||||
delete_enum,
|
||||
remarks,
|
||||
create_name,
|
||||
update_name,
|
||||
tenant_id,
|
||||
version,
|
||||
create_time,
|
||||
update_time,
|
||||
create_id,
|
||||
update_id,
|
||||
env
|
||||
from org_business_scope_device_ref
|
||||
</sql>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue