parent
4a25b9f75b
commit
d3d94f468b
@ -0,0 +1,104 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.dustclearrecord;
|
||||||
|
|
||||||
|
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.dustclearrecord.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.dustclearrecord.DustClearrecordDO;
|
||||||
|
import cn.iocoder.yudao.module.system.service.dustclearrecord.DustClearrecordService;
|
||||||
|
|
||||||
|
@Tag(name = "管理后台 - 粉尘清扫打卡记录")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/system/dust-clearrecord")
|
||||||
|
@Validated
|
||||||
|
public class DustClearrecordController {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DustClearrecordService dustClearrecordService;
|
||||||
|
|
||||||
|
@PostMapping("/create")
|
||||||
|
@Operation(summary = "创建粉尘清扫打卡记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:dust-clearrecord:create')")
|
||||||
|
public CommonResult<String> createDustClearrecord(@Valid @RequestBody DustClearrecordSaveReqVO createReqVO) {
|
||||||
|
return success(dustClearrecordService.createDustClearrecord(createReqVO));
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping("/update")
|
||||||
|
@Operation(summary = "更新粉尘清扫打卡记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:dust-clearrecord:update')")
|
||||||
|
public CommonResult<Boolean> updateDustClearrecord(@Valid @RequestBody DustClearrecordSaveReqVO updateReqVO) {
|
||||||
|
dustClearrecordService.updateDustClearrecord(updateReqVO);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete")
|
||||||
|
@Operation(summary = "删除粉尘清扫打卡记录")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:dust-clearrecord:delete')")
|
||||||
|
public CommonResult<Boolean> deleteDustClearrecord(@RequestParam("id") String id) {
|
||||||
|
dustClearrecordService.deleteDustClearrecord(id);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@DeleteMapping("/delete-list")
|
||||||
|
@Parameter(name = "ids", description = "编号", required = true)
|
||||||
|
@Operation(summary = "批量删除粉尘清扫打卡记录")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:dust-clearrecord:delete')")
|
||||||
|
public CommonResult<Boolean> deleteDustClearrecordList(@RequestParam("ids") List<String> ids) {
|
||||||
|
dustClearrecordService.deleteDustClearrecordListByIds(ids);
|
||||||
|
return success(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get")
|
||||||
|
@Operation(summary = "获得粉尘清扫打卡记录")
|
||||||
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:dust-clearrecord:query')")
|
||||||
|
public CommonResult<DustClearrecordRespVO> getDustClearrecord(@RequestParam("id") String id) {
|
||||||
|
DustClearrecordDO dustClearrecord = dustClearrecordService.getDustClearrecord(id);
|
||||||
|
return success(BeanUtils.toBean(dustClearrecord, DustClearrecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/page")
|
||||||
|
@Operation(summary = "获得粉尘清扫打卡记录分页")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:dust-clearrecord:query')")
|
||||||
|
public CommonResult<PageResult<DustClearrecordRespVO>> getDustClearrecordPage(@Valid DustClearrecordPageReqVO pageReqVO) {
|
||||||
|
PageResult<DustClearrecordDO> pageResult = dustClearrecordService.getDustClearrecordPage(pageReqVO);
|
||||||
|
return success(BeanUtils.toBean(pageResult, DustClearrecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
@GetMapping("/export-excel")
|
||||||
|
@Operation(summary = "导出粉尘清扫打卡记录 Excel")
|
||||||
|
@PreAuthorize("@ss.hasPermission('system:dust-clearrecord:export')")
|
||||||
|
@ApiAccessLog(operateType = EXPORT)
|
||||||
|
public void exportDustClearrecordExcel(@Valid DustClearrecordPageReqVO pageReqVO,
|
||||||
|
HttpServletResponse response) throws IOException {
|
||||||
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
|
List<DustClearrecordDO> list = dustClearrecordService.getDustClearrecordPage(pageReqVO).getList();
|
||||||
|
// 导出 Excel
|
||||||
|
ExcelUtils.write(response, "粉尘清扫打卡记录.xls", "数据", DustClearrecordRespVO.class,
|
||||||
|
BeanUtils.toBean(list, DustClearrecordRespVO.class));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.dustclearrecord.vo;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
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 DustClearrecordPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
@Schema(description = "数据接入标识", example = "2822")
|
||||||
|
private String dataId;
|
||||||
|
|
||||||
|
@Schema(description = "清扫项目", example = "芋艿")
|
||||||
|
private String clearItemName;
|
||||||
|
|
||||||
|
@Schema(description = "完成情况 0:未完成;1:已完成")
|
||||||
|
private String taskProcess;
|
||||||
|
|
||||||
|
@Schema(description = "打卡人")
|
||||||
|
private String taskPerson;
|
||||||
|
|
||||||
|
@Schema(description = "打卡日期")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] taskTime;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间")
|
||||||
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
|
private LocalDateTime[] createTime;
|
||||||
|
|
||||||
|
@Schema(description = "图片", example = "15259")
|
||||||
|
private String picOssId;
|
||||||
|
|
||||||
|
@Schema(description = "图片", example = "https://www.iocoder.cn")
|
||||||
|
private String picOssUrl;
|
||||||
|
|
||||||
|
@Schema(description = "附件", example = "29669")
|
||||||
|
private String fileOssId;
|
||||||
|
|
||||||
|
@Schema(description = "附件", example = "https://www.iocoder.cn")
|
||||||
|
private String fileOssUrl;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,59 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.dustclearrecord.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import cn.idev.excel.annotation.*;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 粉尘清扫打卡记录 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class DustClearrecordRespVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "21496")
|
||||||
|
@ExcelProperty("主键")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "数据接入标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "2822")
|
||||||
|
@ExcelProperty("数据接入标识")
|
||||||
|
private String dataId;
|
||||||
|
|
||||||
|
@Schema(description = "清扫项目", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@ExcelProperty("清扫项目")
|
||||||
|
private String clearItemName;
|
||||||
|
|
||||||
|
@Schema(description = "完成情况 0:未完成;1:已完成", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("完成情况 0:未完成;1:已完成")
|
||||||
|
private String taskProcess;
|
||||||
|
|
||||||
|
@Schema(description = "打卡人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("打卡人")
|
||||||
|
private String taskPerson;
|
||||||
|
|
||||||
|
@Schema(description = "打卡日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("打卡日期")
|
||||||
|
private LocalDateTime taskTime;
|
||||||
|
|
||||||
|
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@ExcelProperty("创建时间")
|
||||||
|
private LocalDateTime createTime;
|
||||||
|
|
||||||
|
@Schema(description = "图片", example = "15259")
|
||||||
|
@ExcelProperty("图片")
|
||||||
|
private String picOssId;
|
||||||
|
|
||||||
|
@Schema(description = "图片", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("图片")
|
||||||
|
private String picOssUrl;
|
||||||
|
|
||||||
|
@Schema(description = "附件", example = "29669")
|
||||||
|
@ExcelProperty("附件")
|
||||||
|
private String fileOssId;
|
||||||
|
|
||||||
|
@Schema(description = "附件", example = "https://www.iocoder.cn")
|
||||||
|
@ExcelProperty("附件")
|
||||||
|
private String fileOssUrl;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.controller.admin.dustclearrecord.vo;
|
||||||
|
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.constraints.*;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 粉尘清扫打卡记录新增/修改 Request VO")
|
||||||
|
@Data
|
||||||
|
public class DustClearrecordSaveReqVO {
|
||||||
|
|
||||||
|
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "21496")
|
||||||
|
private String id;
|
||||||
|
|
||||||
|
@Schema(description = "数据接入标识", requiredMode = Schema.RequiredMode.REQUIRED, example = "2822")
|
||||||
|
@NotEmpty(message = "数据接入标识不能为空")
|
||||||
|
private String dataId;
|
||||||
|
|
||||||
|
@Schema(description = "清扫项目", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿")
|
||||||
|
@NotEmpty(message = "清扫项目不能为空")
|
||||||
|
private String clearItemName;
|
||||||
|
|
||||||
|
@Schema(description = "完成情况 0:未完成;1:已完成", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "完成情况 0:未完成;1:已完成不能为空")
|
||||||
|
private String taskProcess;
|
||||||
|
|
||||||
|
@Schema(description = "打卡人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotEmpty(message = "打卡人不能为空")
|
||||||
|
private String taskPerson;
|
||||||
|
|
||||||
|
@Schema(description = "打卡日期", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||||
|
@NotNull(message = "打卡日期不能为空")
|
||||||
|
private LocalDateTime taskTime;
|
||||||
|
|
||||||
|
@Schema(description = "图片", example = "15259")
|
||||||
|
private String picOssId;
|
||||||
|
|
||||||
|
@Schema(description = "图片", example = "https://www.iocoder.cn")
|
||||||
|
private String picOssUrl;
|
||||||
|
|
||||||
|
@Schema(description = "附件", example = "29669")
|
||||||
|
private String fileOssId;
|
||||||
|
|
||||||
|
@Schema(description = "附件", example = "https://www.iocoder.cn")
|
||||||
|
private String fileOssUrl;
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,69 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.dataobject.dustclearrecord;
|
||||||
|
|
||||||
|
import lombok.*;
|
||||||
|
import java.util.*;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉尘清扫打卡记录 DO
|
||||||
|
*
|
||||||
|
* @author 超级管理员
|
||||||
|
*/
|
||||||
|
@TableName("hazard_dust_clearrecord")
|
||||||
|
@KeySequence("hazard_dust_clearrecord_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class DustClearrecordDO extends BaseDO {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(type = IdType.INPUT)
|
||||||
|
private String id;
|
||||||
|
/**
|
||||||
|
* 数据接入标识
|
||||||
|
*/
|
||||||
|
private String dataId;
|
||||||
|
/**
|
||||||
|
* 清扫项目
|
||||||
|
*/
|
||||||
|
private String clearItemName;
|
||||||
|
/**
|
||||||
|
* 完成情况 0:未完成;1:已完成
|
||||||
|
*/
|
||||||
|
private String taskProcess;
|
||||||
|
/**
|
||||||
|
* 打卡人
|
||||||
|
*/
|
||||||
|
private String taskPerson;
|
||||||
|
/**
|
||||||
|
* 打卡日期
|
||||||
|
*/
|
||||||
|
private LocalDateTime taskTime;
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
private String picOssId;
|
||||||
|
/**
|
||||||
|
* 图片
|
||||||
|
*/
|
||||||
|
private String picOssUrl;
|
||||||
|
/**
|
||||||
|
* 附件
|
||||||
|
*/
|
||||||
|
private String fileOssId;
|
||||||
|
/**
|
||||||
|
* 附件
|
||||||
|
*/
|
||||||
|
private String fileOssUrl;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,35 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.dal.mysql.dustclearrecord;
|
||||||
|
|
||||||
|
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.dustclearrecord.DustClearrecordDO;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.dustclearrecord.vo.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉尘清扫打卡记录 Mapper
|
||||||
|
*
|
||||||
|
* @author 超级管理员
|
||||||
|
*/
|
||||||
|
@Mapper
|
||||||
|
public interface DustClearrecordMapper extends BaseMapperX<DustClearrecordDO> {
|
||||||
|
|
||||||
|
default PageResult<DustClearrecordDO> selectPage(DustClearrecordPageReqVO reqVO) {
|
||||||
|
return selectPage(reqVO, new LambdaQueryWrapperX<DustClearrecordDO>()
|
||||||
|
.eqIfPresent(DustClearrecordDO::getDataId, reqVO.getDataId())
|
||||||
|
.likeIfPresent(DustClearrecordDO::getClearItemName, reqVO.getClearItemName())
|
||||||
|
.eqIfPresent(DustClearrecordDO::getTaskProcess, reqVO.getTaskProcess())
|
||||||
|
.eqIfPresent(DustClearrecordDO::getTaskPerson, reqVO.getTaskPerson())
|
||||||
|
.betweenIfPresent(DustClearrecordDO::getTaskTime, reqVO.getTaskTime())
|
||||||
|
.betweenIfPresent(DustClearrecordDO::getCreateTime, reqVO.getCreateTime())
|
||||||
|
.eqIfPresent(DustClearrecordDO::getPicOssId, reqVO.getPicOssId())
|
||||||
|
.eqIfPresent(DustClearrecordDO::getPicOssUrl, reqVO.getPicOssUrl())
|
||||||
|
.eqIfPresent(DustClearrecordDO::getFileOssId, reqVO.getFileOssId())
|
||||||
|
.eqIfPresent(DustClearrecordDO::getFileOssUrl, reqVO.getFileOssUrl())
|
||||||
|
.orderByDesc(DustClearrecordDO::getId));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.dustclearrecord;
|
||||||
|
|
||||||
|
import java.util.*;
|
||||||
|
import jakarta.validation.*;
|
||||||
|
import cn.iocoder.yudao.module.system.controller.admin.dustclearrecord.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.dustclearrecord.DustClearrecordDO;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||||
|
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 粉尘清扫打卡记录 Service 接口
|
||||||
|
*
|
||||||
|
* @author 超级管理员
|
||||||
|
*/
|
||||||
|
public interface DustClearrecordService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建粉尘清扫打卡记录
|
||||||
|
*
|
||||||
|
* @param createReqVO 创建信息
|
||||||
|
* @return 编号
|
||||||
|
*/
|
||||||
|
String createDustClearrecord(@Valid DustClearrecordSaveReqVO createReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 更新粉尘清扫打卡记录
|
||||||
|
*
|
||||||
|
* @param updateReqVO 更新信息
|
||||||
|
*/
|
||||||
|
void updateDustClearrecord(@Valid DustClearrecordSaveReqVO updateReqVO);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除粉尘清扫打卡记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
*/
|
||||||
|
void deleteDustClearrecord(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除粉尘清扫打卡记录
|
||||||
|
*
|
||||||
|
* @param ids 编号
|
||||||
|
*/
|
||||||
|
void deleteDustClearrecordListByIds(List<String> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得粉尘清扫打卡记录
|
||||||
|
*
|
||||||
|
* @param id 编号
|
||||||
|
* @return 粉尘清扫打卡记录
|
||||||
|
*/
|
||||||
|
DustClearrecordDO getDustClearrecord(String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获得粉尘清扫打卡记录分页
|
||||||
|
*
|
||||||
|
* @param pageReqVO 分页查询
|
||||||
|
* @return 粉尘清扫打卡记录分页
|
||||||
|
*/
|
||||||
|
PageResult<DustClearrecordDO> getDustClearrecordPage(DustClearrecordPageReqVO pageReqVO);
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,85 @@
|
|||||||
|
package cn.iocoder.yudao.module.system.service.dustclearrecord;
|
||||||
|
|
||||||
|
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.dustclearrecord.vo.*;
|
||||||
|
import cn.iocoder.yudao.module.system.dal.dataobject.dustclearrecord.DustClearrecordDO;
|
||||||
|
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.dustclearrecord.DustClearrecordMapper;
|
||||||
|
|
||||||
|
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 超级管理员
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Validated
|
||||||
|
public class DustClearrecordServiceImpl implements DustClearrecordService {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DustClearrecordMapper dustClearrecordMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String createDustClearrecord(DustClearrecordSaveReqVO createReqVO) {
|
||||||
|
// 插入
|
||||||
|
DustClearrecordDO dustClearrecord = BeanUtils.toBean(createReqVO, DustClearrecordDO.class);
|
||||||
|
dustClearrecordMapper.insert(dustClearrecord);
|
||||||
|
|
||||||
|
// 返回
|
||||||
|
return dustClearrecord.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateDustClearrecord(DustClearrecordSaveReqVO updateReqVO) {
|
||||||
|
// 校验存在
|
||||||
|
validateDustClearrecordExists(updateReqVO.getId());
|
||||||
|
// 更新
|
||||||
|
DustClearrecordDO updateObj = BeanUtils.toBean(updateReqVO, DustClearrecordDO.class);
|
||||||
|
dustClearrecordMapper.updateById(updateObj);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteDustClearrecord(String id) {
|
||||||
|
// 校验存在
|
||||||
|
validateDustClearrecordExists(id);
|
||||||
|
// 删除
|
||||||
|
dustClearrecordMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteDustClearrecordListByIds(List<String> ids) {
|
||||||
|
// 删除
|
||||||
|
dustClearrecordMapper.deleteByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void validateDustClearrecordExists(String id) {
|
||||||
|
if (dustClearrecordMapper.selectById(id) == null) {
|
||||||
|
throw exception(DUST_CLEARRECORD_NOT_EXISTS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public DustClearrecordDO getDustClearrecord(String id) {
|
||||||
|
return dustClearrecordMapper.selectById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<DustClearrecordDO> getDustClearrecordPage(DustClearrecordPageReqVO pageReqVO) {
|
||||||
|
return dustClearrecordMapper.selectPage(pageReqVO);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in new issue