Browse Source

Merge pull request '按照实际时间生产工单' (#407) from fix_pm into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_GAAS_GFrame_BACKEND/pulls/407
Reviewed-by: zhangxin <xin.zhang@le-it.com.cn>
pull/408/head
zhangxin 3 years ago
parent
commit
5559cd4ebd
2 changed files with 7 additions and 7 deletions
  1. +3
    -3
      task/task.go
  2. +4
    -4
      web/models/pm_wo_model.go

+ 3
- 3
task/task.go View File

@ -125,7 +125,7 @@ func doSth(ctx context.Context) {
} }
//判断是否添加了服务 //判断是否添加了服务
t2now, _ := utils.TimeParse(tem.Schedbegtime)
t2now, _ := utils.TimeParse(tem.Actbegtime)
endtime := t2now.AddDate(0, 0, timeunit) endtime := t2now.AddDate(0, 0, timeunit)
//先把时间字符串格式化成相同的时间类型 //先把时间字符串格式化成相同的时间类型
nowtime, _ := utils.TimeParseyyyyMMdd(t1) nowtime, _ := utils.TimeParseyyyyMMdd(t1)
@ -241,7 +241,7 @@ func doSth(ctx context.Context) {
continue continue
} }
glog.InfoExtln("维护工单B", "tem:", tem) glog.InfoExtln("维护工单B", "tem:", tem)
time2, _ := utils.TimeParse(tem.Schedbegtime)
time2, _ := utils.TimeParse(tem.Actbegtime)
time1, _ := utils.TimeParse(t1) time1, _ := utils.TimeParse(t1)
timelen := int(time1.Unix()) - int(time2.Unix()) timelen := int(time1.Unix()) - int(time2.Unix())
timeunit := task.PmService.Duehourinterval timeunit := task.PmService.Duehourinterval
@ -517,7 +517,7 @@ func doSth(ctx context.Context) {
if err != nil { if err != nil {
continue continue
} }
time2, _ := utils.TimeParse(tem.Schedbegtime)
time2, _ := utils.TimeParse(tem.Actbegtime)
time1, _ := utils.TimeParseyyyyMMdd(today) time1, _ := utils.TimeParseyyyyMMdd(today)
timelen := int(time1.Unix()) - int(time2.Unix()) timelen := int(time1.Unix()) - int(time2.Unix())
if err != nil { if err != nil {


+ 4
- 4
web/models/pm_wo_model.go View File

@ -320,10 +320,10 @@ func (t *PmWo) GetPage(pageSize int, pageIndex int, searchtime string, mainttype
if !utils.ValueIsEmpty(searchtime) { if !utils.ValueIsEmpty(searchtime) {
searchtimes := strings.Split(searchtime, "-") searchtimes := strings.Split(searchtime, "-")
table = table.And("pm_wo.credatuz >= ?", searchtimes[0])
table = table.And("pm_wo.credatuz <= ?", searchtimes[1])
where += " and pm_wo.credatuz >= ? "
where += " and pm_wo.credatuz <= ? "
table = table.And("pm_wo.actbegtime >= ?", searchtimes[0])
table = table.And("pm_wo.actbegtime <= ?", searchtimes[1])
where += " and pm_wo.actbegtime >= ? "
where += " and pm_wo.actbegtime <= ? "
parameters = append(parameters, searchtimes[0], searchtimes[1]) parameters = append(parameters, searchtimes[0], searchtimes[1])
} }
if t.Assetid > 0 { if t.Assetid > 0 {


Loading…
Cancel
Save