|
|
|
@ -33,6 +33,7 @@ import lombok.EqualsAndHashCode; |
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
import org.springblade.core.tenant.mp.TenantEntity; |
|
|
|
import org.springblade.core.tenant.mp.TenantEntity; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
import org.springblade.core.tool.utils.DateUtil; |
|
|
|
|
|
|
|
import org.springblade.desk.energy.util.TimeSpan; |
|
|
|
import org.springframework.format.annotation.DateTimeFormat; |
|
|
|
import org.springframework.format.annotation.DateTimeFormat; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.Serial; |
|
|
|
import java.io.Serial; |
|
|
|
@ -161,4 +162,31 @@ public class BsSafePatrolInspectionEntity extends BaseEntity { |
|
|
|
taskStatusMap.put(NOT_ON_TIME, "未准时完成"); |
|
|
|
taskStatusMap.put(NOT_ON_TIME, "未准时完成"); |
|
|
|
taskStatusMap.put(NO_CHECK, "缺卡"); |
|
|
|
taskStatusMap.put(NO_CHECK, "缺卡"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getWaitCycle() { |
|
|
|
|
|
|
|
if(this.taskStatus.equals(CHECKED)) { |
|
|
|
|
|
|
|
return ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
TimeSpan ts = dateDiff(this.launchTime, new Date()); |
|
|
|
|
|
|
|
int days = ts.getDays(); |
|
|
|
|
|
|
|
int hours = ts.getHours(); |
|
|
|
|
|
|
|
int minutes = ts.getMinutes(); |
|
|
|
|
|
|
|
String rtnV = ts.getSeconds() + "秒"; |
|
|
|
|
|
|
|
if (days > 0) { |
|
|
|
|
|
|
|
rtnV = days + "天" + hours + "时" + minutes + "分"; |
|
|
|
|
|
|
|
} else if (hours > 0) { |
|
|
|
|
|
|
|
rtnV = hours + "时" + minutes + "分"; |
|
|
|
|
|
|
|
} else if (minutes > 0) { |
|
|
|
|
|
|
|
rtnV = minutes + "分"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return rtnV; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public static final TimeSpan dateDiff(Date date1, Date date2) { |
|
|
|
|
|
|
|
long diff = 0L; |
|
|
|
|
|
|
|
if (date1 != null && date2 != null) { |
|
|
|
|
|
|
|
diff = date2.getTime() - date1.getTime(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return new TimeSpan(diff); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|