Commit 3b2a8cd1951c6101d9e1699b3411fed4f42b7870

Authored by 王彪总
1 parent d20fdcef

feat(garden): 添加员工打卡记录功能并修复道路查询部门字段

- 新增 DeviceClockRecordController 控制器,提供员工打卡记录的增删改查接口
- 新增 DeviceClockRecordDO 数据对象,定义员工打卡记录的数据结构
- 新增 DeviceClockRecordMapper 数据访问层,实现打卡记录的数据库操作
- 新增 DeviceClockRecordService 服务层,封装打卡记录的业务逻辑
- 新增 DeviceClockRecordSaveReqVO、DeviceClockRecordPageReqVO、DeviceClockRecordRespVO 等数据传输对象
- 修复 RoadController 中部门字段映射错误,将 deptCode 映射到 deptId
- 为 RoadListReqVO 添加 deptId 字段,并在 RoadServiceImpl 中添加对应的查询条件
- 生成员工打卡记录的错误码常量定义模板
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/device/DeviceClockRecordController.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.admin.device;
  2 +
  3 +import org.springframework.web.bind.annotation.*;
  4 +import jakarta.annotation.Resource;
  5 +import org.springframework.validation.annotation.Validated;
  6 +import org.springframework.security.access.prepost.PreAuthorize;
  7 +import io.swagger.v3.oas.annotations.tags.Tag;
  8 +import io.swagger.v3.oas.annotations.Parameter;
  9 +import io.swagger.v3.oas.annotations.Operation;
  10 +
  11 +import jakarta.validation.constraints.*;
  12 +import jakarta.validation.*;
  13 +import jakarta.servlet.http.*;
  14 +import java.util.*;
  15 +import java.io.IOException;
  16 +
  17 +import com.zteits.urbanops.framework.common.pojo.PageParam;
  18 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  19 +import com.zteits.urbanops.framework.common.pojo.CommonResult;
  20 +import com.zteits.urbanops.framework.common.util.object.BeanUtils;
  21 +import static com.zteits.urbanops.framework.common.pojo.CommonResult.success;
  22 +
  23 +import com.zteits.urbanops.framework.excel.core.util.ExcelUtils;
  24 +
  25 +import com.zteits.urbanops.framework.apilog.core.annotation.ApiAccessLog;
  26 +import static com.zteits.urbanops.framework.apilog.core.enums.OperateTypeEnum.*;
  27 +
  28 +import com.zteits.urbanops.module.garden.controller.admin.device.vo.*;
  29 +import com.zteits.urbanops.module.garden.dal.dataobject.device.DeviceClockRecordDO;
  30 +import com.zteits.urbanops.module.garden.service.device.DeviceClockRecordService;
  31 +
  32 +@Tag(name = "管理后台 - 员工打卡记录")
  33 +@RestController
  34 +@RequestMapping("/garden/device-clock-record")
  35 +@Validated
  36 +public class DeviceClockRecordController {
  37 +
  38 + @Resource
  39 + private DeviceClockRecordService deviceClockRecordService;
  40 +
  41 + @PostMapping("/create")
  42 + @Operation(summary = "创建员工打卡记录")
  43 + @PreAuthorize("@ss.hasPermission('garden:device-clock-record:create')")
  44 + public CommonResult<Integer> createDeviceClockRecord(@Valid @RequestBody DeviceClockRecordSaveReqVO createReqVO) {
  45 + return success(deviceClockRecordService.createDeviceClockRecord(createReqVO));
  46 + }
  47 +
  48 + @PutMapping("/update")
  49 + @Operation(summary = "更新员工打卡记录")
  50 + @PreAuthorize("@ss.hasPermission('garden:device-clock-record:update')")
  51 + public CommonResult<Boolean> updateDeviceClockRecord(@Valid @RequestBody DeviceClockRecordSaveReqVO updateReqVO) {
  52 + deviceClockRecordService.updateDeviceClockRecord(updateReqVO);
  53 + return success(true);
  54 + }
  55 +
  56 + @DeleteMapping("/delete")
  57 + @Operation(summary = "删除员工打卡记录")
  58 + @Parameter(name = "id", description = "编号", required = true)
  59 + @PreAuthorize("@ss.hasPermission('garden:device-clock-record:delete')")
  60 + public CommonResult<Boolean> deleteDeviceClockRecord(@RequestParam("id") Integer id) {
  61 + deviceClockRecordService.deleteDeviceClockRecord(id);
  62 + return success(true);
  63 + }
  64 +
  65 + @DeleteMapping("/delete-list")
  66 + @Parameter(name = "ids", description = "编号", required = true)
  67 + @Operation(summary = "批量删除员工打卡记录")
  68 + @PreAuthorize("@ss.hasPermission('garden:device-clock-record:delete')")
  69 + public CommonResult<Boolean> deleteDeviceClockRecordList(@RequestParam("ids") List<Integer> ids) {
  70 + deviceClockRecordService.deleteDeviceClockRecordListByIds(ids);
  71 + return success(true);
  72 + }
  73 +
  74 + @GetMapping("/get")
  75 + @Operation(summary = "获得员工打卡记录")
  76 + @Parameter(name = "id", description = "编号", required = true, example = "1024")
  77 + @PreAuthorize("@ss.hasPermission('garden:device-clock-record:query')")
  78 + public CommonResult<DeviceClockRecordRespVO> getDeviceClockRecord(@RequestParam("id") Integer id) {
  79 + DeviceClockRecordDO deviceClockRecord = deviceClockRecordService.getDeviceClockRecord(id);
  80 + return success(BeanUtils.toBean(deviceClockRecord, DeviceClockRecordRespVO.class));
  81 + }
  82 +
  83 + @GetMapping("/page")
  84 + @Operation(summary = "获得员工打卡记录分页")
  85 + @PreAuthorize("@ss.hasPermission('garden:device-clock-record:query')")
  86 + public CommonResult<PageResult<DeviceClockRecordRespVO>> getDeviceClockRecordPage(@Valid DeviceClockRecordPageReqVO pageReqVO) {
  87 + PageResult<DeviceClockRecordDO> pageResult = deviceClockRecordService.getDeviceClockRecordPage(pageReqVO);
  88 + return success(BeanUtils.toBean(pageResult, DeviceClockRecordRespVO.class));
  89 + }
  90 +
  91 + @GetMapping("/export-excel")
  92 + @Operation(summary = "导出员工打卡记录 Excel")
  93 + @PreAuthorize("@ss.hasPermission('garden:device-clock-record:export')")
  94 + @ApiAccessLog(operateType = EXPORT)
  95 + public void exportDeviceClockRecordExcel(@Valid DeviceClockRecordPageReqVO pageReqVO,
  96 + HttpServletResponse response) throws IOException {
  97 + pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
  98 + List<DeviceClockRecordDO> list = deviceClockRecordService.getDeviceClockRecordPage(pageReqVO).getList();
  99 + // 导出 Excel
  100 + ExcelUtils.write(response, "员工打卡记录.xls", "数据", DeviceClockRecordRespVO.class,
  101 + BeanUtils.toBean(list, DeviceClockRecordRespVO.class));
  102 + }
  103 +
  104 +}
0 \ No newline at end of file 105 \ No newline at end of file
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/device/vo/DeviceClockRecordPageReqVO.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.admin.device.vo;
  2 +
  3 +import lombok.*;
  4 +import java.util.*;
  5 +import io.swagger.v3.oas.annotations.media.Schema;
  6 +import com.zteits.urbanops.framework.common.pojo.PageParam;
  7 +import java.math.BigDecimal;
  8 +import org.springframework.format.annotation.DateTimeFormat;
  9 +import java.time.LocalDateTime;
  10 +
  11 +import static com.zteits.urbanops.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
  12 +
  13 +@Schema(description = "管理后台 - 员工打卡记录分页 Request VO")
  14 +@Data
  15 +public class DeviceClockRecordPageReqVO extends PageParam {
  16 +
  17 + @Schema(description = "设备编码")
  18 + private String deviceCode;
  19 +
  20 + @Schema(description = "设备名称", example = "李四")
  21 + private String deviceName;
  22 +
  23 + @Schema(description = "打卡类型:上班/下班", example = "2")
  24 + private String punchType;
  25 +
  26 + @Schema(description = "高德GCJ02坐标系纬度")
  27 + private BigDecimal latGcj02;
  28 +
  29 + @Schema(description = "高德GCJ02坐标系经度")
  30 + private BigDecimal lngGcj02;
  31 +
  32 + @Schema(description = "详细地址")
  33 + private String address;
  34 +
  35 + @Schema(description = "84坐标经度")
  36 + private BigDecimal lng;
  37 +
  38 + @Schema(description = "84坐标纬度")
  39 + private BigDecimal lat;
  40 +
  41 + @Schema(description = "状态位")
  42 + private Integer statusBit;
  43 +
  44 + @Schema(description = "警告位")
  45 + private Integer warnBit;
  46 +
  47 + @Schema(description = "提交人用户ID", example = "20708")
  48 + private Long userId;
  49 +
  50 + @Schema(description = "用户昵称", example = "张三")
  51 + private String nickname;
  52 +
  53 + @Schema(description = "归属(一级部门id)", example = "10917")
  54 + private Long companyId;
  55 +
  56 + @Schema(description = "部门ID", example = "126")
  57 + private Long deptId;
  58 +
  59 + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政;例如:yl,wy")
  60 + private String busiLine;
  61 +
  62 + @Schema(description = "创建时间")
  63 + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
  64 + private LocalDateTime[] createTime;
  65 +
  66 +}
0 \ No newline at end of file 67 \ No newline at end of file
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/device/vo/DeviceClockRecordRespVO.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.admin.device.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.util.*;
  6 +import java.math.BigDecimal;
  7 +import org.springframework.format.annotation.DateTimeFormat;
  8 +import java.time.LocalDateTime;
  9 +import cn.idev.excel.annotation.*;
  10 +
  11 +@Schema(description = "管理后台 - 员工打卡记录 Response VO")
  12 +@Data
  13 +@ExcelIgnoreUnannotated
  14 +public class DeviceClockRecordRespVO {
  15 +
  16 + @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10971")
  17 + @ExcelProperty("主键ID")
  18 + private Integer id;
  19 +
  20 + @Schema(description = "设备编码", requiredMode = Schema.RequiredMode.REQUIRED)
  21 + @ExcelProperty("设备编码")
  22 + private String deviceCode;
  23 +
  24 + @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
  25 + @ExcelProperty("设备名称")
  26 + private String deviceName;
  27 +
  28 + @Schema(description = "打卡类型:上班/下班", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
  29 + @ExcelProperty("打卡类型:上班/下班")
  30 + private String punchType;
  31 +
  32 + @Schema(description = "高德GCJ02坐标系纬度")
  33 + @ExcelProperty("高德GCJ02坐标系纬度")
  34 + private BigDecimal latGcj02;
  35 +
  36 + @Schema(description = "高德GCJ02坐标系经度")
  37 + @ExcelProperty("高德GCJ02坐标系经度")
  38 + private BigDecimal lngGcj02;
  39 +
  40 + @Schema(description = "详细地址")
  41 + @ExcelProperty("详细地址")
  42 + private String address;
  43 +
  44 + @Schema(description = "84坐标经度")
  45 + @ExcelProperty("84坐标经度")
  46 + private BigDecimal lng;
  47 +
  48 + @Schema(description = "84坐标纬度")
  49 + @ExcelProperty("84坐标纬度")
  50 + private BigDecimal lat;
  51 +
  52 + @Schema(description = "状态位")
  53 + @ExcelProperty("状态位")
  54 + private Integer statusBit;
  55 +
  56 + @Schema(description = "警告位")
  57 + @ExcelProperty("警告位")
  58 + private Integer warnBit;
  59 +
  60 + @Schema(description = "提交人用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20708")
  61 + @ExcelProperty("提交人用户ID")
  62 + private Long userId;
  63 +
  64 + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
  65 + @ExcelProperty("用户昵称")
  66 + private String nickname;
  67 +
  68 + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "10917")
  69 + @ExcelProperty("归属(一级部门id)")
  70 + private Long companyId;
  71 +
  72 + @Schema(description = "部门ID", example = "126")
  73 + @ExcelProperty("部门ID")
  74 + private Long deptId;
  75 +
  76 + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政;例如:yl,wy", requiredMode = Schema.RequiredMode.REQUIRED)
  77 + @ExcelProperty("业务线: yl-园林;wy-物业:sz-市政;例如:yl,wy")
  78 + private String busiLine;
  79 +
  80 + @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
  81 + @ExcelProperty("创建时间")
  82 + private LocalDateTime createTime;
  83 +
  84 +}
0 \ No newline at end of file 85 \ No newline at end of file
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/device/vo/DeviceClockRecordSaveReqVO.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.controller.admin.device.vo;
  2 +
  3 +import io.swagger.v3.oas.annotations.media.Schema;
  4 +import lombok.*;
  5 +import java.util.*;
  6 +import jakarta.validation.constraints.*;
  7 +import java.math.BigDecimal;
  8 +
  9 +@Schema(description = "管理后台 - 员工打卡记录新增/修改 Request VO")
  10 +@Data
  11 +public class DeviceClockRecordSaveReqVO {
  12 +
  13 + @Schema(description = "主键ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "10971")
  14 + private Integer id;
  15 +
  16 + @Schema(description = "设备编码", requiredMode = Schema.RequiredMode.REQUIRED)
  17 + @NotEmpty(message = "设备编码不能为空")
  18 + private String deviceCode;
  19 +
  20 + @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
  21 + @NotEmpty(message = "设备名称不能为空")
  22 + private String deviceName;
  23 +
  24 + @Schema(description = "打卡类型:上班/下班", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
  25 + @NotEmpty(message = "打卡类型:上班/下班不能为空")
  26 + private String punchType;
  27 +
  28 + @Schema(description = "高德GCJ02坐标系纬度")
  29 + private BigDecimal latGcj02;
  30 +
  31 + @Schema(description = "高德GCJ02坐标系经度")
  32 + private BigDecimal lngGcj02;
  33 +
  34 + @Schema(description = "详细地址")
  35 + private String address;
  36 +
  37 + @Schema(description = "84坐标经度")
  38 + private BigDecimal lng;
  39 +
  40 + @Schema(description = "84坐标纬度")
  41 + private BigDecimal lat;
  42 +
  43 + @Schema(description = "状态位")
  44 + private Integer statusBit;
  45 +
  46 + @Schema(description = "警告位")
  47 + private Integer warnBit;
  48 +
  49 + @Schema(description = "提交人用户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "20708")
  50 + @NotNull(message = "提交人用户ID不能为空")
  51 + private Long userId;
  52 +
  53 + @Schema(description = "用户昵称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
  54 + @NotEmpty(message = "用户昵称不能为空")
  55 + private String nickname;
  56 +
  57 + @Schema(description = "归属(一级部门id)", requiredMode = Schema.RequiredMode.REQUIRED, example = "10917")
  58 + @NotNull(message = "归属(一级部门id)不能为空")
  59 + private Long companyId;
  60 +
  61 + @Schema(description = "部门ID", example = "126")
  62 + private Long deptId;
  63 +
  64 + @Schema(description = "业务线: yl-园林;wy-物业:sz-市政;例如:yl,wy", requiredMode = Schema.RequiredMode.REQUIRED)
  65 + @NotEmpty(message = "业务线: yl-园林;wy-物业:sz-市政;例如:yl,wy不能为空")
  66 + private String busiLine;
  67 +
  68 +}
0 \ No newline at end of file 69 \ No newline at end of file
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/RoadController.java
@@ -139,7 +139,7 @@ public class RoadController { @@ -139,7 +139,7 @@ public class RoadController {
139 reqVO.setRoadName(roadName); 139 reqVO.setRoadName(roadName);
140 // 处理deptCode为空的情况 140 // 处理deptCode为空的情况
141 if (deptCode != null && !deptCode.isEmpty()) { 141 if (deptCode != null && !deptCode.isEmpty()) {
142 - reqVO.setCompanyId(Long.valueOf(deptCode)); 142 + reqVO.setDeptId(Long.valueOf(deptCode));
143 } 143 }
144 reqVO.setBusiLine(companyCode); 144 reqVO.setBusiLine(companyCode);
145 List<RoadDO> roadList = roadService.getRoadList(reqVO); 145 List<RoadDO> roadList = roadService.getRoadList(reqVO);
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/controller/admin/road/vo/RoadListReqVO.java
@@ -26,8 +26,11 @@ public class RoadListReqVO { @@ -26,8 +26,11 @@ public class RoadListReqVO {
26 @NotNull(message = "归属(一级部门id)不能为空") 26 @NotNull(message = "归属(一级部门id)不能为空")
27 private Long companyId; 27 private Long companyId;
28 28
  29 + @Schema(description = "部门ID", example = "126")
  30 + private Long deptId;
  31 +
29 @Schema(description = "业务看", example = "yl") 32 @Schema(description = "业务看", example = "yl")
30 @NotEmpty(message = "创建者不能为空") 33 @NotEmpty(message = "创建者不能为空")
31 private String busiLine; 34 private String busiLine;
32 35
33 -}  
34 \ No newline at end of file 36 \ No newline at end of file
  37 +}
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/dataobject/device/DeviceClockRecordDO.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.dal.dataobject.device;
  2 +
  3 +import lombok.*;
  4 +import java.util.*;
  5 +import java.math.BigDecimal;
  6 +import java.math.BigDecimal;
  7 +import java.math.BigDecimal;
  8 +import java.math.BigDecimal;
  9 +import java.time.LocalDateTime;
  10 +import java.time.LocalDateTime;
  11 +import com.baomidou.mybatisplus.annotation.*;
  12 +import com.zteits.urbanops.framework.mybatis.core.dataobject.BaseDO;
  13 +
  14 +/**
  15 + * 员工打卡记录 DO
  16 + *
  17 + * @author 超级管理员
  18 + */
  19 +@TableName("garden_device_clock_record")
  20 +@KeySequence("garden_device_clock_record_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
  21 +@Data
  22 +@EqualsAndHashCode(callSuper = true)
  23 +@ToString(callSuper = true)
  24 +@Builder
  25 +@NoArgsConstructor
  26 +@AllArgsConstructor
  27 +public class DeviceClockRecordDO extends BaseDO {
  28 +
  29 + /**
  30 + * 主键ID
  31 + */
  32 + @TableId
  33 + private Integer id;
  34 + /**
  35 + * 设备编码
  36 + */
  37 + private String deviceCode;
  38 + /**
  39 + * 设备名称
  40 + */
  41 + private String deviceName;
  42 + /**
  43 + * 打卡类型:上班/下班
  44 + */
  45 + private String punchType;
  46 + /**
  47 + * 高德GCJ02坐标系纬度
  48 + */
  49 + private BigDecimal latGcj02;
  50 + /**
  51 + * 高德GCJ02坐标系经度
  52 + */
  53 + private BigDecimal lngGcj02;
  54 + /**
  55 + * 详细地址
  56 + */
  57 + private String address;
  58 + /**
  59 + * 84坐标经度
  60 + */
  61 + private BigDecimal lng;
  62 + /**
  63 + * 84坐标纬度
  64 + */
  65 + private BigDecimal lat;
  66 + /**
  67 + * 状态位
  68 + */
  69 + private Integer statusBit;
  70 + /**
  71 + * 警告位
  72 + */
  73 + private Integer warnBit;
  74 + /**
  75 + * 提交人用户ID
  76 + */
  77 + private Long userId;
  78 + /**
  79 + * 用户昵称
  80 + */
  81 + private String nickname;
  82 + /**
  83 + * 归属(一级部门id)
  84 + */
  85 + private Long companyId;
  86 + /**
  87 + * 部门ID
  88 + */
  89 + private Long deptId;
  90 + /**
  91 + * 业务线: yl-园林;wy-物业:sz-市政;例如:yl,wy
  92 + */
  93 + private String busiLine;
  94 +
  95 +
  96 +}
0 \ No newline at end of file 97 \ No newline at end of file
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/dal/mysql/device/DeviceClockRecordMapper.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.dal.mysql.device;
  2 +
  3 +import java.util.*;
  4 +
  5 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  6 +import com.zteits.urbanops.framework.mybatis.core.query.LambdaQueryWrapperX;
  7 +import com.zteits.urbanops.framework.mybatis.core.mapper.BaseMapperX;
  8 +import com.zteits.urbanops.module.garden.dal.dataobject.device.DeviceClockRecordDO;
  9 +import org.apache.ibatis.annotations.Mapper;
  10 +import com.zteits.urbanops.module.garden.controller.admin.device.vo.*;
  11 +
  12 +/**
  13 + * 员工打卡记录 Mapper
  14 + *
  15 + * @author 超级管理员
  16 + */
  17 +@Mapper
  18 +public interface DeviceClockRecordMapper extends BaseMapperX<DeviceClockRecordDO> {
  19 +
  20 + default PageResult<DeviceClockRecordDO> selectPage(DeviceClockRecordPageReqVO reqVO) {
  21 + return selectPage(reqVO, new LambdaQueryWrapperX<DeviceClockRecordDO>()
  22 + .eqIfPresent(DeviceClockRecordDO::getDeviceCode, reqVO.getDeviceCode())
  23 + .likeIfPresent(DeviceClockRecordDO::getDeviceName, reqVO.getDeviceName())
  24 + .eqIfPresent(DeviceClockRecordDO::getPunchType, reqVO.getPunchType())
  25 + .eqIfPresent(DeviceClockRecordDO::getLatGcj02, reqVO.getLatGcj02())
  26 + .eqIfPresent(DeviceClockRecordDO::getLngGcj02, reqVO.getLngGcj02())
  27 + .eqIfPresent(DeviceClockRecordDO::getAddress, reqVO.getAddress())
  28 + .eqIfPresent(DeviceClockRecordDO::getLng, reqVO.getLng())
  29 + .eqIfPresent(DeviceClockRecordDO::getLat, reqVO.getLat())
  30 + .eqIfPresent(DeviceClockRecordDO::getStatusBit, reqVO.getStatusBit())
  31 + .eqIfPresent(DeviceClockRecordDO::getWarnBit, reqVO.getWarnBit())
  32 + .eqIfPresent(DeviceClockRecordDO::getUserId, reqVO.getUserId())
  33 + .likeIfPresent(DeviceClockRecordDO::getNickname, reqVO.getNickname())
  34 + .eqIfPresent(DeviceClockRecordDO::getCompanyId, reqVO.getCompanyId())
  35 + .eqIfPresent(DeviceClockRecordDO::getDeptId, reqVO.getDeptId())
  36 + .eqIfPresent(DeviceClockRecordDO::getBusiLine, reqVO.getBusiLine())
  37 + .betweenIfPresent(DeviceClockRecordDO::getCreateTime, reqVO.getCreateTime())
  38 + .orderByDesc(DeviceClockRecordDO::getId));
  39 + }
  40 +
  41 +}
0 \ No newline at end of file 42 \ No newline at end of file
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/device/DeviceClockRecordService.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.service.device;
  2 +
  3 +import java.util.*;
  4 +import jakarta.validation.*;
  5 +import com.zteits.urbanops.module.garden.controller.admin.device.vo.*;
  6 +import com.zteits.urbanops.module.garden.dal.dataobject.device.DeviceClockRecordDO;
  7 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  8 +import com.zteits.urbanops.framework.common.pojo.PageParam;
  9 +
  10 +/**
  11 + * 员工打卡记录 Service 接口
  12 + *
  13 + * @author 超级管理员
  14 + */
  15 +public interface DeviceClockRecordService {
  16 +
  17 + /**
  18 + * 创建员工打卡记录
  19 + *
  20 + * @param createReqVO 创建信息
  21 + * @return 编号
  22 + */
  23 + Integer createDeviceClockRecord(@Valid DeviceClockRecordSaveReqVO createReqVO);
  24 +
  25 + /**
  26 + * 更新员工打卡记录
  27 + *
  28 + * @param updateReqVO 更新信息
  29 + */
  30 + void updateDeviceClockRecord(@Valid DeviceClockRecordSaveReqVO updateReqVO);
  31 +
  32 + /**
  33 + * 删除员工打卡记录
  34 + *
  35 + * @param id 编号
  36 + */
  37 + void deleteDeviceClockRecord(Integer id);
  38 +
  39 + /**
  40 + * 批量删除员工打卡记录
  41 + *
  42 + * @param ids 编号
  43 + */
  44 + void deleteDeviceClockRecordListByIds(List<Integer> ids);
  45 +
  46 + /**
  47 + * 获得员工打卡记录
  48 + *
  49 + * @param id 编号
  50 + * @return 员工打卡记录
  51 + */
  52 + DeviceClockRecordDO getDeviceClockRecord(Integer id);
  53 +
  54 + /**
  55 + * 获得员工打卡记录分页
  56 + *
  57 + * @param pageReqVO 分页查询
  58 + * @return 员工打卡记录分页
  59 + */
  60 + PageResult<DeviceClockRecordDO> getDeviceClockRecordPage(DeviceClockRecordPageReqVO pageReqVO);
  61 +
  62 +}
0 \ No newline at end of file 63 \ No newline at end of file
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/device/DeviceClockRecordServiceImpl.java 0 → 100644
  1 +package com.zteits.urbanops.module.garden.service.device;
  2 +
  3 +import cn.hutool.core.collection.CollUtil;
  4 +import org.springframework.stereotype.Service;
  5 +import jakarta.annotation.Resource;
  6 +import org.springframework.validation.annotation.Validated;
  7 +import org.springframework.transaction.annotation.Transactional;
  8 +
  9 +import java.util.*;
  10 +import com.zteits.urbanops.module.garden.controller.admin.device.vo.*;
  11 +import com.zteits.urbanops.module.garden.dal.dataobject.device.DeviceClockRecordDO;
  12 +import com.zteits.urbanops.framework.common.pojo.PageResult;
  13 +import com.zteits.urbanops.framework.common.pojo.PageParam;
  14 +import com.zteits.urbanops.framework.common.util.object.BeanUtils;
  15 +
  16 +import com.zteits.urbanops.module.garden.dal.mysql.device.DeviceClockRecordMapper;
  17 +
  18 +import static com.zteits.urbanops.framework.common.exception.util.ServiceExceptionUtil.exception;
  19 +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.convertList;
  20 +import static com.zteits.urbanops.framework.common.util.collection.CollectionUtils.diffList;
  21 +import static com.zteits.urbanops.module.garden.enums.ErrorCodeConstants.*;
  22 +
  23 +/**
  24 + * 员工打卡记录 Service 实现类
  25 + *
  26 + * @author 超级管理员
  27 + */
  28 +@Service
  29 +@Validated
  30 +public class DeviceClockRecordServiceImpl implements DeviceClockRecordService {
  31 +
  32 + @Resource
  33 + private DeviceClockRecordMapper deviceClockRecordMapper;
  34 +
  35 + @Override
  36 + public Integer createDeviceClockRecord(DeviceClockRecordSaveReqVO createReqVO) {
  37 + // 插入
  38 + DeviceClockRecordDO deviceClockRecord = BeanUtils.toBean(createReqVO, DeviceClockRecordDO.class);
  39 + deviceClockRecordMapper.insert(deviceClockRecord);
  40 +
  41 + // 返回
  42 + return deviceClockRecord.getId();
  43 + }
  44 +
  45 + @Override
  46 + public void updateDeviceClockRecord(DeviceClockRecordSaveReqVO updateReqVO) {
  47 + // 校验存在
  48 + validateDeviceClockRecordExists(updateReqVO.getId());
  49 + // 更新
  50 + DeviceClockRecordDO updateObj = BeanUtils.toBean(updateReqVO, DeviceClockRecordDO.class);
  51 + deviceClockRecordMapper.updateById(updateObj);
  52 + }
  53 +
  54 + @Override
  55 + public void deleteDeviceClockRecord(Integer id) {
  56 + // 校验存在
  57 + validateDeviceClockRecordExists(id);
  58 + // 删除
  59 + deviceClockRecordMapper.deleteById(id);
  60 + }
  61 +
  62 + @Override
  63 + public void deleteDeviceClockRecordListByIds(List<Integer> ids) {
  64 + // 删除
  65 + deviceClockRecordMapper.deleteByIds(ids);
  66 + }
  67 +
  68 +
  69 + private void validateDeviceClockRecordExists(Integer id) {
  70 + if (deviceClockRecordMapper.selectById(id) == null) {
  71 + throw exception(DEVICE_CLOCK_RECORD_NOT_EXISTS);
  72 + }
  73 + }
  74 +
  75 + @Override
  76 + public DeviceClockRecordDO getDeviceClockRecord(Integer id) {
  77 + return deviceClockRecordMapper.selectById(id);
  78 + }
  79 +
  80 + @Override
  81 + public PageResult<DeviceClockRecordDO> getDeviceClockRecordPage(DeviceClockRecordPageReqVO pageReqVO) {
  82 + return deviceClockRecordMapper.selectPage(pageReqVO);
  83 + }
  84 +
  85 +}
0 \ No newline at end of file 86 \ No newline at end of file
urbanops-module-garden/src/main/java/com/zteits/urbanops/module/garden/service/road/RoadServiceImpl.java
@@ -162,6 +162,9 @@ public class RoadServiceImpl implements RoadService { @@ -162,6 +162,9 @@ public class RoadServiceImpl implements RoadService {
162 if (reqVO.getCompanyId() != null) { 162 if (reqVO.getCompanyId() != null) {
163 sql.lambda().eq(RoadDO::getCompanyId, reqVO.getCompanyId()); 163 sql.lambda().eq(RoadDO::getCompanyId, reqVO.getCompanyId());
164 } 164 }
  165 + if (reqVO.getDeptId() != null) {
  166 + sql.lambda().eq(RoadDO::getDeptId, reqVO.getDeptId());
  167 + }
165 if (reqVO.getLevelId() != null) { 168 if (reqVO.getLevelId() != null) {
166 sql.lambda().eq(RoadDO::getLevelId, reqVO.getLevelId()); 169 sql.lambda().eq(RoadDO::getLevelId, reqVO.getLevelId());
167 } 170 }
@@ -176,4 +179,4 @@ public class RoadServiceImpl implements RoadService { @@ -176,4 +179,4 @@ public class RoadServiceImpl implements RoadService {
176 179
177 180
178 181
179 -}  
180 \ No newline at end of file 182 \ No newline at end of file
  183 +}
urbanops-module-garden/src/main/resources/mapper/device/DeviceClockRecordMapper.xml 0 → 100644
  1 +<?xml version="1.0" encoding="UTF-8"?>
  2 +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3 +<mapper namespace="com.zteits.urbanops.module.garden.dal.mysql.device.DeviceClockRecordMapper">
  4 +
  5 + <!--
  6 + 一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
  7 + 无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
  8 + 代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
  9 + 文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
  10 + -->
  11 +
  12 +</mapper>
0 \ No newline at end of file 13 \ No newline at end of file