广汽安道拓Acura项目MES后台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
528 B

3 years ago
3 years ago
3 years ago
  1. package schedule
  2. import "time"
  3. // 用于日模型的线段,相对时间
  4. type LineSegementSrv struct {
  5. WorkShiftNr int // 人员班组编号
  6. StartSecond int // 基于0点的起始秒数
  7. EndSecond int // 基于0点的起始秒数
  8. Duration time.Duration
  9. }
  10. // 获取线段的持续时间
  11. func (lss *LineSegementSrv) GetDuration() time.Duration {
  12. if lss.StartSecond > lss.EndSecond {
  13. lss.Duration = time.Duration(0)
  14. } else {
  15. lss.Duration = time.Duration(lss.EndSecond - lss.StartSecond)
  16. }
  17. return lss.Duration
  18. }