Browse Source

二次目检提示

develop
娄文智 1 year ago
parent
commit
a1013011c3
3 changed files with 19 additions and 11 deletions
  1. +10
    -7
      services/jit/implments/PackOrder.service.impl.go
  2. +1
    -1
      services/qm/implments/DefectRecord.service.impl.go
  3. +8
    -3
      web/controllers/qm/DefectRecord.rest.go

+ 10
- 7
services/jit/implments/PackOrder.service.impl.go View File

@ -2243,6 +2243,7 @@ func (impl *PackOrderServiceImplement) ScanBarcodeGFrame(user *global.User, barc
packOrderStatusDao := dal.NewPackOrderStatusDAO(session, user.PlantNr, user.UserId)
packOrderStatusHistoryDao := dal.NewPackOrderStatusHistoryDAO(session, user.PlantNr, user.UserId)
articleAtocdDao := baseDal.NewArticleAtcodLstDAO(session, user.PlantNr, user.UserId)
articleDao := baseDal.NewArticleDAO(session, user.PlantNr, user.UserId)
projectDao := meDal.NewProjectDAO(session, user.PlantNr, user.UserId)
packOrderPlcErrDao := dal.NewPackOrderPlcErrorDAO(session, user.PlantNr, user.UserId)
inspDao := omDal.NewSerialOrderInspectionItemDAO(session, user.PlantNr, user.UserId)
@ -2380,7 +2381,13 @@ func (impl *PackOrderServiceImplement) ScanBarcodeGFrame(user *global.User, barc
if project == nil {
return nil, grmi.NewBusinessError("车型项目数据不存在,项目ID:" + projectId)
}
artInfo, err := articleDao.SelectOne(artId, projectId)
if err != nil {
return nil, grmi.NewBusinessError("查询车型项目数据失败, error:" + err.Error())
}
if artInfo == nil {
return nil, grmi.NewBusinessError("物料信息不存在,物料ID:" + artId)
}
if err := session.Begin(); err != nil {
return nil, grmi.NewBusinessError("事务开启失败, error:" + err.Error())
}
@ -2397,12 +2404,8 @@ func (impl *PackOrderServiceImplement) ScanBarcodeGFrame(user *global.User, barc
_ = session.Rollback()
return nil, grmi.NewBusinessError("生成包装流水号格式错误!")
}
artIds := strings.Split(artId, "-")
if len(artIds) < 2 {
_ = session.Rollback()
return nil, grmi.NewBusinessError("零件号格式错误!")
}
packOrderId = packOrderIds[0] + "-" + artIds[0] + artIds[1] + packOrderIds[1]
packOrderId = packOrderIds[0] + "-" + artInfo.PartId + artInfo.Version + packOrderIds[1]
packOrder := model.PackOrder{
PackOrderId: packOrderId,
ProjectId: projectId,


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

@ -253,7 +253,7 @@ func (impl *DefectRecordServiceImplement) Insert(user *global.User, entities mod
return grmi.NewBusinessError("序列订单查询错误!")
}
if OrderInfo != nil && OrderInfo.Status == common.CHECK_STATUS_CLOSED {
return grmi.NewBusinessError("该序列订单已经检测!")
return grmi.NewBusinessError("再次目检,生成数据已更新完成!!")
}
orderId := entities.SerialorderId


+ 8
- 3
web/controllers/qm/DefectRecord.rest.go View File

@ -8,7 +8,6 @@ import (
"LAPP_ACURA_MOM_BACKEND/web/middleware/jwts"
"LAPP_ACURA_MOM_BACKEND/web/supports"
"fmt"
"github.com/kataras/iris/v12"
"github.com/kataras/iris/v12/core/router"
)
@ -156,6 +155,7 @@ func RegisterDeleteOneDefectRecord(party router.Party, path string, method func(
RegisterIDOfDefectRecord(party, "DELETE", path+"/{recNr:int}", method)
}
/******************************************************************************
*
* @Function Name : RegisterIDOfDefectRecord
@ -198,6 +198,7 @@ func RegisterIDOfDefectRecord(party router.Party, httpMethod string, path string
supports.Ok(ctx, supports.OptionSuccess, nil)
})
}
/******************************************************************************
*
* @Function Name : RegisterSelectOneDefectRecord
@ -296,14 +297,18 @@ func RegisterMultiDefectRecord(party router.Party, httpMethod string, path strin
var entities model.SerialOrderRuting
err := ctx.ReadJSON(&entities)
if err != nil {
fmt.Println(11111)
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil)
return
}
err = method(user, entities)
if err != nil {
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil)
if err.Error() == "再次目检,生成数据已更新完成!!" {
supports.Error(ctx, iris.StatusAccepted, err.Error(), nil)
} else {
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil)
}
return
}
supports.Ok(ctx, supports.OptionSuccess, nil)


Loading…
Cancel
Save