|
|
@ -370,6 +370,12 @@ func doSth(ctx context.Context) { |
|
|
|
time2, _ := utils.TimeParseyyyyMMdd(t2) |
|
|
|
timelen := int(time1.Unix()) - int(time2.Unix()) |
|
|
|
timeunit := task.PmService.Duedateinterval |
|
|
|
glog.InfoExtln("维护工单A","Mainservicenr:", task.PmService.Mainserviceid) |
|
|
|
glog.InfoExtln("维护工单A","t1:", t1) |
|
|
|
glog.InfoExtln("维护工单A","t2:", task.PmService.Duedateon) |
|
|
|
glog.InfoExtln("维护工单A","timelen:", timelen) |
|
|
|
glog.InfoExtln("维护工单A","timeunit:", timeunit) |
|
|
|
glog.InfoExtln("维护工单A","res:", ((timelen / 86400) % timeunit)) |
|
|
|
if res := ((timelen / 86400) % timeunit); res == 0 { |
|
|
|
|
|
|
|
//判断是否已经生成了维护工单,如果生成了,跳过
|
|
|
@ -377,7 +383,8 @@ func doSth(ctx context.Context) { |
|
|
|
pms.Finr = task.PmService.Finr |
|
|
|
pms.Mainservicenr = task.PmService.Mainserviceid |
|
|
|
tem, err := pms.SelectPmWoOne() |
|
|
|
if !utils.ValueIsEmpty(tem.Mainservicenr) || err != nil { |
|
|
|
if err != nil { |
|
|
|
glog.InfoExtln("维护工单A","tem.Mainservicenr:", tem.Mainservicenr) |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
@ -387,8 +394,10 @@ func doSth(ctx context.Context) { |
|
|
|
//先把时间字符串格式化成相同的时间类型
|
|
|
|
nowtime, _ := utils.TimeParseyyyyMMdd(t1) |
|
|
|
|
|
|
|
if err == nil && nowtime.Before(endtime) { |
|
|
|
if nowtime.Before(endtime) { |
|
|
|
//处理逻辑
|
|
|
|
glog.InfoExtln("维护工单A","nowtime:", nowtime) |
|
|
|
glog.InfoExtln("维护工单A","endtime:", endtime) |
|
|
|
continue |
|
|
|
} |
|
|
|
|
|
|
|