parent
46222610b1
commit
0077a944bc
@ -0,0 +1,114 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dustequipinfo;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dustequipinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dustequipinfo.DustEquipinfoDO;
|
||||
import cn.iocoder.yudao.module.system.service.dustequipinfo.DustEquipinfoService;
|
||||
|
||||
@Tag(name = "管理后台 - 除尘系统信息")
|
||||
@RestController
|
||||
@RequestMapping("/system/dust-equipinfo")
|
||||
@Validated
|
||||
public class DustEquipinfoController {
|
||||
|
||||
@Resource
|
||||
private DustEquipinfoService dustEquipinfoService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建除尘系统信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:dust-equipinfo:create')")
|
||||
public CommonResult<String> createDustEquipinfo(@Valid @RequestBody DustEquipinfoSaveReqVO createReqVO) {
|
||||
return success(dustEquipinfoService.createDustEquipinfo(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新除尘系统信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:dust-equipinfo:update')")
|
||||
public CommonResult<Boolean> updateDustEquipinfo(@Valid @RequestBody DustEquipinfoSaveReqVO updateReqVO) {
|
||||
dustEquipinfoService.updateDustEquipinfo(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除除尘系统信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('system:dust-equipinfo:delete')")
|
||||
public CommonResult<Boolean> deleteDustEquipinfo(@RequestParam("id") String id) {
|
||||
dustEquipinfoService.deleteDustEquipinfo(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-list")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Operation(summary = "批量删除除尘系统信息")
|
||||
@PreAuthorize("@ss.hasPermission('system:dust-equipinfo:delete')")
|
||||
public CommonResult<Boolean> deleteDustEquipinfoList(@RequestParam("ids") List<String> ids) {
|
||||
dustEquipinfoService.deleteDustEquipinfoListByIds(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得除尘系统信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('system:dust-equipinfo:query')")
|
||||
public CommonResult<DustEquipinfoRespVO> getDustEquipinfo(@RequestParam("id") String id) {
|
||||
DustEquipinfoDO dustEquipinfo = dustEquipinfoService.getDustEquipinfo(id);
|
||||
DustEquipinfoRespVO respVO = BeanUtils.toBean(dustEquipinfo, DustEquipinfoRespVO.class);
|
||||
if (dustEquipinfo != null && dustEquipinfo.getDustTechnology()!= null) {
|
||||
List<String> list = Arrays.stream(dustEquipinfo.getDustTechnology().split(",")).toList();
|
||||
respVO.setDustTechnologys(list);
|
||||
}
|
||||
return success(respVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得除尘系统信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('system:dust-equipinfo:query')")
|
||||
public CommonResult<PageResult<DustEquipinfoRespVO>> getDustEquipinfoPage(@Valid DustEquipinfoPageReqVO pageReqVO) {
|
||||
PageResult<DustEquipinfoDO> pageResult = dustEquipinfoService.getDustEquipinfoPage(pageReqVO);
|
||||
PageResult<DustEquipinfoRespVO> result = BeanUtils.toBean(pageResult, DustEquipinfoRespVO.class);
|
||||
List<DustEquipinfoRespVO> list = result.getList();
|
||||
for (DustEquipinfoRespVO vo : list) {
|
||||
vo.setDustTechnologys(Arrays.stream(vo.getDustTechnology().split(",")).toList());
|
||||
}
|
||||
return success(result);
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出除尘系统信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('system:dust-equipinfo:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDustEquipinfoExcel(@Valid DustEquipinfoPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<DustEquipinfoDO> list = dustEquipinfoService.getDustEquipinfoPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "除尘系统信息.xls", "数据", DustEquipinfoRespVO.class,
|
||||
BeanUtils.toBean(list, DustEquipinfoRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dustequipinfo.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 除尘系统信息分页 Request VO")
|
||||
@Data
|
||||
public class DustEquipinfoPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "设备编码")
|
||||
private String equipCode;
|
||||
|
||||
@Schema(description = "设备名称", example = "张三")
|
||||
private String equipName;
|
||||
|
||||
@Schema(description = "数据接入标识", example = "4826")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "所属车间")
|
||||
private String placeCode;
|
||||
|
||||
@Schema(description = "设备类型", example = "1")
|
||||
private String equipType;
|
||||
|
||||
@Schema(description = "设备厂家")
|
||||
private String equipFactory;
|
||||
|
||||
@Schema(description = "安装日期")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] setDate;
|
||||
|
||||
@Schema(description = "相关控爆措施")
|
||||
private String bombControl;
|
||||
|
||||
@Schema(description = "安装区域")
|
||||
private String installArea;
|
||||
|
||||
@Schema(description = "除尘种类", example = "2")
|
||||
private String dustType;
|
||||
|
||||
@Schema(description = "涉粉作业人数")
|
||||
private Long workersNumber;
|
||||
|
||||
@Schema(description = "高风险工艺")
|
||||
private String dustTechnology;
|
||||
private List<String> dustTechnologys;
|
||||
|
||||
@Schema(description = "日产尘量Kg")
|
||||
private BigDecimal dailyDustOutput;
|
||||
|
||||
@Schema(description = "系统停用状态", example = "1")
|
||||
private String equipStatus;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,88 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dustequipinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import cn.idev.excel.annotation.*;
|
||||
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
|
||||
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
|
||||
|
||||
@Schema(description = "管理后台 - 除尘系统信息 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DustEquipinfoRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16898")
|
||||
@ExcelProperty("主键")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "设备编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("设备编码")
|
||||
private String equipCode;
|
||||
|
||||
@Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("设备名称")
|
||||
private String equipName;
|
||||
|
||||
@Schema(description = "数据接入标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "4826")
|
||||
@ExcelProperty("数据接入标识")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "所属车间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("所属车间")
|
||||
private String placeCode;
|
||||
|
||||
@Schema(description = "设备类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty(value = "设备类型", converter = DictConvert.class)
|
||||
@DictFormat("equip_type") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String equipType;
|
||||
|
||||
@Schema(description = "设备厂家", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("设备厂家")
|
||||
private String equipFactory;
|
||||
|
||||
@Schema(description = "安装日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("安装日期")
|
||||
private LocalDateTime setDate;
|
||||
|
||||
@Schema(description = "相关控爆措施", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty(value = "相关控爆措施", converter = DictConvert.class)
|
||||
@DictFormat("bomb_control") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String bombControl;
|
||||
|
||||
@Schema(description = "安装区域", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty(value = "安装区域", converter = DictConvert.class)
|
||||
@DictFormat("install_area") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String installArea;
|
||||
|
||||
@Schema(description = "除尘种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("除尘种类")
|
||||
private String dustType;
|
||||
|
||||
@Schema(description = "涉粉作业人数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("涉粉作业人数")
|
||||
private Long workersNumber;
|
||||
|
||||
@Schema(description = "高风险工艺", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty(value = "高风险工艺", converter = DictConvert.class)
|
||||
@DictFormat("dust_technology") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String dustTechnology;
|
||||
private List<String> dustTechnologys;
|
||||
|
||||
@Schema(description = "日产尘量Kg", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("日产尘量Kg")
|
||||
private BigDecimal dailyDustOutput;
|
||||
|
||||
@Schema(description = "系统停用状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@ExcelProperty(value = "系统停用状态", converter = DictConvert.class)
|
||||
@DictFormat("equip_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private String equipStatus;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,75 @@
|
||||
package cn.iocoder.yudao.module.system.controller.admin.dustequipinfo.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 除尘系统信息新增/修改 Request VO")
|
||||
@Data
|
||||
public class DustEquipinfoSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "16898")
|
||||
private String id;
|
||||
|
||||
@Schema(description = "设备编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "设备编码不能为空")
|
||||
private String equipCode;
|
||||
|
||||
@Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "设备名称不能为空")
|
||||
private String equipName;
|
||||
|
||||
@Schema(description = "数据接入标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "4826")
|
||||
@NotEmpty(message = "数据接入标识不能为空")
|
||||
private String dataId;
|
||||
|
||||
@Schema(description = "所属车间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "所属车间不能为空")
|
||||
private String placeCode;
|
||||
|
||||
@Schema(description = "设备类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "设备类型不能为空")
|
||||
private String equipType;
|
||||
|
||||
@Schema(description = "设备厂家", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "设备厂家不能为空")
|
||||
private String equipFactory;
|
||||
|
||||
@Schema(description = "安装日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "安装日期不能为空")
|
||||
private LocalDateTime setDate;
|
||||
|
||||
@Schema(description = "相关控爆措施", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "相关控爆措施不能为空")
|
||||
private String bombControl;
|
||||
|
||||
@Schema(description = "安装区域", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "安装区域不能为空")
|
||||
private String installArea;
|
||||
|
||||
@Schema(description = "除尘种类", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotEmpty(message = "除尘种类不能为空")
|
||||
private String dustType;
|
||||
|
||||
@Schema(description = "涉粉作业人数", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "涉粉作业人数不能为空")
|
||||
private Long workersNumber;
|
||||
|
||||
@Schema(description = "高风险工艺", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotEmpty(message = "高风险工艺不能为空")
|
||||
private String dustTechnology;
|
||||
private List<String> dustTechnologys;
|
||||
|
||||
@Schema(description = "日产尘量Kg", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "日产尘量Kg不能为空")
|
||||
private BigDecimal dailyDustOutput;
|
||||
|
||||
@Schema(description = "系统停用状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
|
||||
@NotEmpty(message = "系统停用状态不能为空")
|
||||
private String equipStatus;
|
||||
|
||||
}
|
||||
@ -0,0 +1,100 @@
|
||||
package cn.iocoder.yudao.module.system.dal.dataobject.dustequipinfo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 除尘系统信息 DO
|
||||
*
|
||||
* @author tnkj
|
||||
*/
|
||||
@TableName("hazard_dust_equipinfo")
|
||||
@KeySequence("hazard_dust_equipinfo_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DustEquipinfoDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String id;
|
||||
/**
|
||||
* 设备编码
|
||||
*/
|
||||
private String equipCode;
|
||||
/**
|
||||
* 设备名称
|
||||
*/
|
||||
private String equipName;
|
||||
/**
|
||||
* 数据接入标识
|
||||
*/
|
||||
private String dataId;
|
||||
/**
|
||||
* 所属车间
|
||||
*/
|
||||
private String placeCode;
|
||||
/**
|
||||
* 设备类型
|
||||
*
|
||||
* 枚举 {@link TODO equip_type 对应的类}
|
||||
*/
|
||||
private String equipType;
|
||||
/**
|
||||
* 设备厂家
|
||||
*/
|
||||
private String equipFactory;
|
||||
/**
|
||||
* 安装日期
|
||||
*/
|
||||
private LocalDateTime setDate;
|
||||
/**
|
||||
* 相关控爆措施
|
||||
*
|
||||
* 枚举 {@link TODO bomb_control 对应的类}
|
||||
*/
|
||||
private String bombControl;
|
||||
/**
|
||||
* 安装区域
|
||||
*
|
||||
* 枚举 {@link TODO install_area 对应的类}
|
||||
*/
|
||||
private String installArea;
|
||||
/**
|
||||
* 除尘种类
|
||||
*/
|
||||
private String dustType;
|
||||
/**
|
||||
* 涉粉作业人数
|
||||
*/
|
||||
private Long workersNumber;
|
||||
/**
|
||||
* 高风险工艺
|
||||
*
|
||||
* 枚举 {@link TODO dust_technology 对应的类}
|
||||
*/
|
||||
private String dustTechnology;
|
||||
/**
|
||||
* 日产尘量Kg
|
||||
*/
|
||||
private BigDecimal dailyDustOutput;
|
||||
/**
|
||||
* 系统停用状态
|
||||
*
|
||||
* 枚举 {@link TODO equip_status 对应的类}
|
||||
*/
|
||||
private String equipStatus;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.system.dal.mysql.dustequipinfo;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dustequipinfo.DustEquipinfoDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dustequipinfo.vo.*;
|
||||
|
||||
/**
|
||||
* 除尘系统信息 Mapper
|
||||
*
|
||||
* @author tnkj
|
||||
*/
|
||||
@Mapper
|
||||
public interface DustEquipinfoMapper extends BaseMapperX<DustEquipinfoDO> {
|
||||
|
||||
default PageResult<DustEquipinfoDO> selectPage(DustEquipinfoPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DustEquipinfoDO>()
|
||||
.eqIfPresent(DustEquipinfoDO::getEquipCode, reqVO.getEquipCode())
|
||||
.likeIfPresent(DustEquipinfoDO::getEquipName, reqVO.getEquipName())
|
||||
.eqIfPresent(DustEquipinfoDO::getDataId, reqVO.getDataId())
|
||||
.eqIfPresent(DustEquipinfoDO::getPlaceCode, reqVO.getPlaceCode())
|
||||
.eqIfPresent(DustEquipinfoDO::getEquipType, reqVO.getEquipType())
|
||||
.eqIfPresent(DustEquipinfoDO::getEquipFactory, reqVO.getEquipFactory())
|
||||
.betweenIfPresent(DustEquipinfoDO::getSetDate, reqVO.getSetDate())
|
||||
.eqIfPresent(DustEquipinfoDO::getBombControl, reqVO.getBombControl())
|
||||
.eqIfPresent(DustEquipinfoDO::getInstallArea, reqVO.getInstallArea())
|
||||
.eqIfPresent(DustEquipinfoDO::getDustType, reqVO.getDustType())
|
||||
.eqIfPresent(DustEquipinfoDO::getWorkersNumber, reqVO.getWorkersNumber())
|
||||
.eqIfPresent(DustEquipinfoDO::getDustTechnology, reqVO.getDustTechnology())
|
||||
.eqIfPresent(DustEquipinfoDO::getDailyDustOutput, reqVO.getDailyDustOutput())
|
||||
.eqIfPresent(DustEquipinfoDO::getEquipStatus, reqVO.getEquipStatus())
|
||||
.betweenIfPresent(DustEquipinfoDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DustEquipinfoDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,62 @@
|
||||
package cn.iocoder.yudao.module.system.service.dustequipinfo;
|
||||
|
||||
import java.util.*;
|
||||
import jakarta.validation.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dustequipinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dustequipinfo.DustEquipinfoDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 除尘系统信息 Service 接口
|
||||
*
|
||||
* @author tnkj
|
||||
*/
|
||||
public interface DustEquipinfoService {
|
||||
|
||||
/**
|
||||
* 创建除尘系统信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
String createDustEquipinfo(@Valid DustEquipinfoSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新除尘系统信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDustEquipinfo(@Valid DustEquipinfoSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除除尘系统信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDustEquipinfo(String id);
|
||||
|
||||
/**
|
||||
* 批量删除除尘系统信息
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDustEquipinfoListByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 获得除尘系统信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 除尘系统信息
|
||||
*/
|
||||
DustEquipinfoDO getDustEquipinfo(String id);
|
||||
|
||||
/**
|
||||
* 获得除尘系统信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 除尘系统信息分页
|
||||
*/
|
||||
PageResult<DustEquipinfoDO> getDustEquipinfoPage(DustEquipinfoPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@ -0,0 +1,89 @@
|
||||
package cn.iocoder.yudao.module.system.service.dustequipinfo;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import org.springframework.stereotype.Service;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.system.controller.admin.dustequipinfo.vo.*;
|
||||
import cn.iocoder.yudao.module.system.dal.dataobject.dustequipinfo.DustEquipinfoDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
|
||||
import cn.iocoder.yudao.module.system.dal.mysql.dustequipinfo.DustEquipinfoMapper;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.convertList;
|
||||
import static cn.iocoder.yudao.framework.common.util.collection.CollectionUtils.diffList;
|
||||
import static cn.iocoder.yudao.module.system.enums.ErrorCodeConstants.*;
|
||||
|
||||
/**
|
||||
* 除尘系统信息 Service 实现类
|
||||
*
|
||||
* @author tnkj
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class DustEquipinfoServiceImpl implements DustEquipinfoService {
|
||||
|
||||
@Resource
|
||||
private DustEquipinfoMapper dustEquipinfoMapper;
|
||||
|
||||
@Override
|
||||
public String createDustEquipinfo(DustEquipinfoSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
String join = String.join(",", createReqVO.getDustTechnologys());
|
||||
createReqVO.setDustTechnology(join);
|
||||
DustEquipinfoDO dustEquipinfo = BeanUtils.toBean(createReqVO, DustEquipinfoDO.class);
|
||||
dustEquipinfoMapper.insert(dustEquipinfo);
|
||||
|
||||
// 返回
|
||||
return dustEquipinfo.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDustEquipinfo(DustEquipinfoSaveReqVO updateReqVO) {
|
||||
String join = String.join(",", updateReqVO.getDustTechnologys());
|
||||
updateReqVO.setDustTechnology(join);
|
||||
// 校验存在
|
||||
validateDustEquipinfoExists(updateReqVO.getId());
|
||||
// 更新
|
||||
DustEquipinfoDO updateObj = BeanUtils.toBean(updateReqVO, DustEquipinfoDO.class);
|
||||
dustEquipinfoMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDustEquipinfo(String id) {
|
||||
// 校验存在
|
||||
validateDustEquipinfoExists(id);
|
||||
// 删除
|
||||
dustEquipinfoMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDustEquipinfoListByIds(List<String> ids) {
|
||||
// 删除
|
||||
dustEquipinfoMapper.deleteByIds(ids);
|
||||
}
|
||||
|
||||
|
||||
private void validateDustEquipinfoExists(String id) {
|
||||
if (dustEquipinfoMapper.selectById(id) == null) {
|
||||
throw exception(DUST_EQUIPINFO_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public DustEquipinfoDO getDustEquipinfo(String id) {
|
||||
return dustEquipinfoMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<DustEquipinfoDO> getDustEquipinfoPage(DustEquipinfoPageReqVO pageReqVO) {
|
||||
return dustEquipinfoMapper.selectPage(pageReqVO);
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Reference in new issue