Browse Source

Merge pull request '添加了单据状态常量' (#46) from feature_CommonConst into develop

Reviewed-on: http://101.201.121.115:3000/leo/LAPP_GAAS_GFrame_BACKEND/pulls/46
Reviewed-by: zhangxin <xin.zhang@le-it.com.cn>
pull/48/head
weichenglei 3 years ago
parent
commit
ca56e5ec38
2 changed files with 17 additions and 3 deletions
  1. +12
    -0
      services/common/Const.go
  2. +5
    -3
      services/qm/implments/DefectRecord.service.impl.go

+ 12
- 0
services/common/Const.go View File

@ -0,0 +1,12 @@
package common
// 单据状态常量
const (
ORDER_STATUS_UNPLANED = 10 // 未计划
ORDER_STATUS_PLANNED = 20 // 已计划
ORDER_STATUS_RELEASED = 26 // 已下达
ORDER_STATUS_RUNNING = 40 // 生产中
ORDER_STATUS_CLOSED = 80 // 已完成
ORDER_STATUS_LOCKED = 95 // 锁定
ORDER_STATUS_CANCELED = 98 // 取消
)

+ 5
- 3
services/qm/implments/DefectRecord.service.impl.go View File

@ -8,8 +8,10 @@ import (
"LAPP_GAAS_GFrame_BACKEND/grmi"
meta "LAPP_GAAS_GFrame_BACKEND/meta/qm"
model "LAPP_GAAS_GFrame_BACKEND/models/qm"
"LAPP_GAAS_GFrame_BACKEND/services/common"
"LAPP_GAAS_GFrame_BACKEND/web/models"
"fmt"
"strconv"
"time"
)
@ -321,7 +323,7 @@ func (impl *DefectRecordServiceImplement) Insert(user *models.Usertab, entities
return grmi.NewBusinessError(fmt.Sprintf("没有找到缺陷分组(%s)和缺陷原因(%s)的关联!", entity.DefectGrpId, entity.DefectReasonId))
}
entity.Qty = 1
entity.Status = "26"
entity.Status = strconv.Itoa(common.ORDER_STATUS_RELEASED)
entity.ViewCode = entity.AreaId
entity.ViewDescr = view.Descr
entity.ViewPicture = view.Picture
@ -460,11 +462,11 @@ func (impl *DefectRecordServiceImplement) Rework(user *models.Usertab, recNr int
return grmi.NewBusinessError("不存在指定记录!")
}
if record.Status != "26" {
if record.Status != strconv.Itoa(common.ORDER_STATUS_RELEASED) {
return grmi.NewBusinessError("状态错误!")
}
record.Status = "80"
record.Status = strconv.Itoa(common.ORDER_STATUS_CLOSED)
record.InspectTime = grmi.DateTime(time.Now())
record.Inspector = user.Userid
err = dao.UpdateOne(record)


Loading…
Cancel
Save