dev
luotaiqian 2026-07-14 09:23:11 +08:00
parent aee4735db7
commit 8382ce41a2
25 changed files with 1132 additions and 0 deletions

View File

@ -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();
}
}

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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);
}
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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);
/**
* DOCo
*
* @param orgBusinessScopeDeviceRefDo DO
* @return
*/
OrgBusinessScopeDeviceRefCo converDoToCo(OrgBusinessScopeDeviceRefDO orgBusinessScopeDeviceRefDo);
/**
* qry TO DO
*
* @param orgBusinessScopeDeviceRefPageQry
* @return
*/
OrgBusinessScopeDeviceRefDO convertQryToDo(OrgBusinessScopeDeviceRefPageQry orgBusinessScopeDeviceRefPageQry);
/**
* DOsCos
*
* @param orgBusinessScopeDeviceRefDos dos
* @return
*/
List<OrgBusinessScopeDeviceRefCo> converDosToCos(List<OrgBusinessScopeDeviceRefDO> orgBusinessScopeDeviceRefDos);
}

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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> {
}

View File

@ -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);
}

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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));
}
}

View File

@ -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>