| | |
| | | import javax.validation.constraints.NotBlank;
|
| | | import javax.validation.constraints.NotNull;
|
| | | import java.io.Serializable;
|
| | | import java.math.BigDecimal;
|
| | | import java.sql.Timestamp;
|
| | |
|
| | | /**
|
| | |
| | | @ApiModelProperty(value = "备注")
|
| | | private String remarks;
|
| | |
|
| | | @Column(name = "`remaining_duration`")
|
| | | @ApiModelProperty(value = "调休可用时长")
|
| | | private Double remainingDuration;
|
| | |
|
| | | @Column(name = "`wecom_sp_no`")
|
| | | @ApiModelProperty(value = "企微审批单号")
|
| | | private String wecomSpNo;
|
| | |
| | | public void copy(AttendanceOvertime source){
|
| | | BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
| | | }
|
| | |
|
| | | /**
|
| | | * 扣减额度
|
| | | * @param amount / 扣除数额
|
| | | * @return 剩余待扣除数额
|
| | | */
|
| | | public double subtractDuration(double amount) {
|
| | | BigDecimal amountBigDecimal = new BigDecimal(amount);
|
| | | BigDecimal remainingBigDecimal = new BigDecimal(this.remainingDuration);
|
| | | BigDecimal subtractBigDecimal = remainingBigDecimal.subtract(amountBigDecimal);
|
| | | this.remainingDuration = subtractBigDecimal.max(BigDecimal.ZERO).doubleValue();
|
| | | return subtractBigDecimal.compareTo(BigDecimal.ZERO) > 0 ? BigDecimal.ZERO.doubleValue() : subtractBigDecimal.abs().doubleValue();
|
| | | }
|
| | | }
|