| | |
| | | |
| | | import jakarta.validation.constraints.NotBlank; |
| | | import jakarta.validation.constraints.NotNull; |
| | | import jakarta.validation.constraints.AssertTrue; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalTime; |
| | | |
| | |
| | | @Schema(description = "加班起算时长(小时)", example = "1") |
| | | private BigDecimal overtimeThreshold; |
| | | |
| | | @Schema(description = "打卡地点名称") |
| | | private String locationName; |
| | | @Schema(description = "打卡地点地址") |
| | | private String locationAddress; |
| | | @Schema(description = "地点经度(WGS84)") |
| | | private BigDecimal longitude; |
| | | @Schema(description = "地点纬度(WGS84)") |
| | | private BigDecimal latitude; |
| | | @Schema(description = "允许打卡半径,单位米") |
| | | private Integer radiusMeters; |
| | | @Schema(description = "是否启用位置限制") |
| | | private Boolean locationRequired; |
| | | @Schema(description = "坐标系,仅支持 WGS84") |
| | | private String coordinateSystem; |
| | | |
| | | @AssertTrue(message = "启用定位打卡时,地点名称、经纬度和10~5000米打卡半径必须完整配置") |
| | | public boolean isLocationConfigValid() { |
| | | if (!Boolean.TRUE.equals(locationRequired)) { |
| | | return true; |
| | | } |
| | | return locationName != null && !locationName.isBlank() |
| | | && longitude != null && latitude != null && radiusMeters != null |
| | | && radiusMeters >= 10 && radiusMeters <= 5000 |
| | | && "WGS84".equalsIgnoreCase(coordinateSystem); |
| | | } |
| | | |
| | | @Schema(description = "状态:0-启用,1-禁用", example = "0") |
| | | private Integer status; |
| | | |
| | | @Schema(description = "备注", example = "适用于研发部门") |
| | | private String remark; |
| | | |
| | | } |
| | | } |