Browse Source

调角器功能开发

pull/375/head
娄文智 3 years ago
parent
commit
269112ce2b
20 changed files with 373 additions and 132 deletions
  1. +19
    -0
      dao/api/ACCUNITID.dao.go
  2. +18
    -9
      dao/api/implments/ACCUNITID.dao.impl.go
  3. +2
    -2
      dao/qm/ReclinerReclst.dao.go
  4. +4
    -4
      dao/qm/implments/ReclinerReclst.dao.impl.go
  5. +0
    -3
      models/api/ACCUNITID.model.go
  6. +15
    -7
      models/api/api.go
  7. +2
    -1
      models/base/LabelParserHead.model.go
  8. +1
    -1
      models/qm/ReclinerReclst.model.go
  9. +19
    -0
      services/api/ACCUNITID.service.go
  10. +93
    -0
      services/api/implments/ACCUNITID.service.impl.go
  11. +56
    -36
      services/log/implments/PackOrder.service.impl.go
  12. +39
    -23
      services/ods/implments/ArtRouteOdsLst.service.impl.go
  13. +2
    -2
      services/qm/ReclinerReclst.service.go
  14. +25
    -17
      services/qm/implments/DefectRecord.service.impl.go
  15. +10
    -10
      services/qm/implments/ReclinerReclst.service.impl.go
  16. +21
    -12
      services/qm/implments/View.service.impl.go
  17. +41
    -0
      web/controllers/api/ACCUNITID.rest.go
  18. +2
    -0
      web/controllers/api/api.go
  19. +3
    -4
      web/controllers/qm/ReclinerReclst.rest.go
  20. +1
    -1
      web/controllers/qm/qm.go

+ 19
- 0
dao/api/ACCUNITID.dao.go View File

@ -75,6 +75,25 @@ type ACCUNITIDDAO interface {
*
******************************************************************************/
SelectOne(int64) (*model.ACCUNITID, error)
/******************************************************************************
*
* @Function Name : SelectInfo
*-----------------------------------------------------------------------------
*
* @Description : 查找指定键的ACCUNITID
*
* @Function Parameters : 主键
*
* @Return Value : 查找到的ACCUNITID
*
* @Return Value : 执行时发生的错误
*
* @Author : 代码生成器创建
*
* @Date : 2021-07-12 10:08:28
*
******************************************************************************/
SelectInfo(reclinerNr string) (*model.ACCUNITID, error)
/******************************************************************************
*
* @Function Name : UpdateOne


+ 18
- 9
dao/api/implments/ACCUNITID.dao.impl.go View File

@ -56,7 +56,6 @@ func NewACCUNITIDDAOImplement(session *xorm.Session, userid string) *ACCUNITIDDA
******************************************************************************/
func (impl *ACCUNITIDDAOImplement) InsertOne(entity *model.ACCUNITID) error {
entity.LastUser = impl.userid
_, err := impl.session.Table(impl.meta.TableName).Insert(entity)
if err != nil {
return grmi.NewDataBaseError(err)
@ -95,6 +94,24 @@ func (impl *ACCUNITIDDAOImplement) SelectOne(rECID int64) (*model.ACCUNITID, err
return &data, nil
}
/******************************************************************************
*
* @Reference LAPP_GAAS_GFrame_BACKEND/dao/api/ACCUNITIDDAO.SelectInfo
*
******************************************************************************/
func (impl *ACCUNITIDDAOImplement) SelectInfo(reclinerNr string) (*model.ACCUNITID, error) {
var data model.ACCUNITID
ok, err := impl.session.Table(impl.meta.TableName).Where("LINE = ? and ID_NAME = ? and ID_VALUE = ?","LaserWelding","Adjuster",reclinerNr).Get(&data)
if err != nil {
return nil, grmi.NewDataBaseError(err)
}
if !ok {
return nil, nil
}
return &data, nil
}
/******************************************************************************
*
* @Reference LAPP_GAAS_GFrame_BACKEND/dao/api/ACCUNITIDDAO.UpdateOne
@ -102,7 +119,6 @@ func (impl *ACCUNITIDDAOImplement) SelectOne(rECID int64) (*model.ACCUNITID, err
******************************************************************************/
func (impl *ACCUNITIDDAOImplement) UpdateOne(entity *model.ACCUNITID) error {
entity.LastUser = impl.userid
_, err := impl.session.Table(impl.meta.TableName).Cols(impl.meta.UpdatingMembers...).ID(entity.GetKey()).Update(entity)
if err != nil {
return grmi.NewDataBaseError(err)
@ -116,11 +132,6 @@ func (impl *ACCUNITIDDAOImplement) UpdateOne(entity *model.ACCUNITID) error {
*
******************************************************************************/
func (impl *ACCUNITIDDAOImplement) Insert(entities *[]model.ACCUNITID) error {
for i := 0; i < len(*entities); i++ {
entity := &(*entities)[i]
entity.LastUser = impl.userid
}
_, err := impl.session.Table(impl.meta.TableName).Insert(entities)
if err != nil {
return grmi.NewDataBaseError(err)
@ -258,7 +269,6 @@ func (impl *ACCUNITIDDAOImplement) Update(entities *[]model.ACCUNITID) error {
for i := 0; i < len(*entities); i++ {
entity := &(*entities)[i]
entity.LastUser = impl.userid
_, err := impl.session.Table(impl.meta.TableName).Cols(impl.meta.UpdatingMembers...).ID(entity.GetKey()).Update(entity)
if err != nil {
return grmi.NewDataBaseError(err)
@ -289,7 +299,6 @@ func (impl *ACCUNITIDDAOImplement) UpdateWhere(predicates []grmi.Predicate, enti
}
columns = append(columns, meta.ACCUNITID_LastUser.ColumnName)
entity.LastUser = impl.userid
_, err := impl.session.Table(impl.meta.TableName).Cols(columns...).Update(entity)
if err != nil {
return grmi.NewDataBaseError(err)


+ 2
- 2
dao/qm/ReclinerReclst.dao.go View File

@ -57,7 +57,7 @@ type ReclinerReclstDAO interface {
* @Date : 2021-07-12 14:05:20
*
******************************************************************************/
DeleteOne(int, string) error
DeleteOne(int) error
/******************************************************************************
*
* @Function Name : SelectOne
@ -78,7 +78,7 @@ type ReclinerReclstDAO interface {
* @Date : 2021-07-12 14:05:20
*
******************************************************************************/
SelectOne(int, string) (*model.ReclinerReclst, error)
SelectOne(int) (*model.ReclinerReclst, error)
/******************************************************************************
*
* @Function Name : UpdateOne


+ 4
- 4
dao/qm/implments/ReclinerReclst.dao.impl.go View File

@ -72,8 +72,8 @@ func (impl *ReclinerReclstDAOImplement) InsertOne(entity *model.ReclinerReclst)
* @Reference LAPP_GAAS_GFrame_BACKEND/dao/qm/ReclinerReclstDAO.DeleteOne
*
******************************************************************************/
func (impl *ReclinerReclstDAOImplement) DeleteOne(recNr int, line string) error {
_, err := impl.session.Table(impl.meta.TableName).ID(core.PK{impl.plantNr, recNr, line}).Delete(impl.meta.Indicator)
func (impl *ReclinerReclstDAOImplement) DeleteOne(recNr int) error {
_, err := impl.session.Table(impl.meta.TableName).ID(core.PK{impl.plantNr, recNr}).Delete(impl.meta.Indicator)
if err != nil {
return grmi.NewDataBaseError(err)
}
@ -86,9 +86,9 @@ func (impl *ReclinerReclstDAOImplement) DeleteOne(recNr int, line string) error
* @Reference LAPP_GAAS_GFrame_BACKEND/dao/qm/ReclinerReclstDAO.SelectOne
*
******************************************************************************/
func (impl *ReclinerReclstDAOImplement) SelectOne(recNr int, line string) (*model.ReclinerReclst, error) {
func (impl *ReclinerReclstDAOImplement) SelectOne(recNr int) (*model.ReclinerReclst, error) {
var data model.ReclinerReclst
ok, err := impl.session.Table(impl.meta.TableName).ID(core.PK{impl.plantNr, recNr, line}).Get(&data)
ok, err := impl.session.Table(impl.meta.TableName).ID(core.PK{impl.plantNr, recNr}).Get(&data)
if err != nil {
return nil, grmi.NewDataBaseError(err)
}


+ 0
- 3
models/api/ACCUNITID.model.go View File

@ -32,9 +32,6 @@ type ACCUNITID struct {
OP string `xorm:"nvarchar(100) 'OP'" json:"ACC_UNITID-OP"`
RUNTIMEID int64 `xorm:"bigint 'RUNTIMEID'" json:"ACC_UNITID-RUNTIMEID"`
CYCLEID int64 `xorm:"bigint 'CYCLEID'" json:"ACC_UNITID-CYCLEID"`
LastModify grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"ACC_UNITID-LastModify"`
LastUser string `xorm:"nvarchar(20) 'LastUser' not null" json:"ACC_UNITID-LastUser"`
CreateTime grmi.DateTime `xorm:"datetime 'CreateTime' not null created" json:"ACC_UNITID-CreateTime"`
}
/******************************************************************************


+ 15
- 7
models/api/api.go View File

@ -1,6 +1,9 @@
package api
import "sync"
import (
model "LAPP_GAAS_GFrame_BACKEND/models/qm"
"sync"
)
// 从mes回写数据时的临时结构体
type AccWorkOrderHeaderJoin struct {
@ -13,8 +16,10 @@ type AccWorkOrderHeaderJoin struct {
// screw相关
// 当前零件的 screw map
var ScrewGlobalMap ScrewMap
// 当前零件的 最新的screw
var ScrewGlobalNewest ScrewSingle
// 当前零件全部记录
var ScrewGlobalArtId ScrewPartNo
@ -23,19 +28,22 @@ type ScrewWithData struct {
PicPath string `json:"PIC_PATH"`
}
type ScrewMap struct {
Lock sync.RWMutex
Map map[string]map[int]ScrewWithData
Map map[string]map[int]ScrewWithData
}
type ScrewSingle struct {
Lock sync.RWMutex
Map map[string]ScrewWithData
Map map[string]ScrewWithData
}
type ScrewPartNo struct {
Lock sync.RWMutex
Map map[string]string
}
Map map[string]string
}
type ReclinerResult struct {
ACCUNITID ACCUNITID `json:"aCCUNITID"`
Views []model.View `json:"views"`
}

+ 2
- 1
models/base/LabelParserHead.model.go View File

@ -24,6 +24,7 @@ type LabelParserHead struct {
ParserId string `xorm:"pk nvarchar(40) 'ParserId'" json:"LabelParserHead-ParserId"`
Length int `xorm:"int 'Length' not null" json:"LabelParserHead-Length"`
ParserType string `xorm:"nvarchar(40) 'ParserType' not null" json:"LabelParserHead-ParserType"`
Split string `xorm:"nvarchar(40) 'Split' not null" json:"LabelParserHead-Split"`
Descr string `xorm:"nvarchar(40) 'Descr' not null" json:"LabelParserHead-Descr"`
Example string `xorm:"nvarchar(100) 'Example' not null" json:"LabelParserHead-Example"`
LastModify grmi.DateTime `xorm:"datetime 'LastModify' not null updated" json:"LabelParserHead-LastModify"`
@ -70,7 +71,7 @@ func ParseBarcode(str string, data []LabelParserDetailLst) map[string]string {
key := v.Abrev
startPos := v.StartPos
endPos := v.EndPos
if endPos > len(str){
if endPos > len(str) {
continue
}
value := str[startPos:endPos]


+ 1
- 1
models/qm/ReclinerReclst.model.go View File

@ -22,7 +22,7 @@ import (
type ReclinerReclst struct {
PlantNr int `xorm:"pk int 'PlantNr'" json:"QM_ReclinerReclst-PlantNr"`
RecNr int `xorm:"pk int 'RecNr' autoincr" json:"QM_ReclinerReclst-RecNr"`
Line string `xorm:"pk nvarchar(16) 'Line'" json:"QM_ReclinerReclst-Line"`
Line string `xorm:"nvarchar(16) 'Line'" json:"QM_ReclinerReclst-Line"`
ArtId string `xorm:"nvarchar(64) 'ArtId'" json:"QM_ReclinerReclst-ArtId"`
SerialOrderId string `xorm:"nvarchar(100) 'SerialOrderId'" json:"QM_ReclinerReclst-SerialOrderId"`
ReclinerNr string `xorm:"nvarchar(64) 'ReclinerNr'" json:"QM_ReclinerReclst-ReclinerNr"`


+ 19
- 0
services/api/ACCUNITID.service.go View File

@ -76,6 +76,25 @@ type ACCUNITIDService interface {
*
******************************************************************************/
SelectOne(*models.Usertab, int64) (*model.ACCUNITID, error)
/******************************************************************************
*
* @Function Name : SelectInfo
*-----------------------------------------------------------------------------
*
* @Description : 查找指定键的ACCUNITID
*
* @Function Parameters : 主键
*
* @Return Value : 查找到的ACCUNITID
*
* @Return Value : 执行时发生的错误
*
* @Author : 代码生成器创建
*
* @Date : 2021-07-12 10:08:28
*
******************************************************************************/
SelectInfo(*models.Usertab, string) (*model.ReclinerResult, error)
/******************************************************************************
*
* @Function Name : UpdateOne


+ 93
- 0
services/api/implments/ACCUNITID.service.impl.go View File

@ -4,11 +4,19 @@ package implments
import (
dal "LAPP_GAAS_GFrame_BACKEND/dao/api"
qmdal "LAPP_GAAS_GFrame_BACKEND/dao/qm"
basedal "LAPP_GAAS_GFrame_BACKEND/dao/base"
"LAPP_GAAS_GFrame_BACKEND/db"
"LAPP_GAAS_GFrame_BACKEND/grmi"
meta "LAPP_GAAS_GFrame_BACKEND/meta/api"
qmmeta "LAPP_GAAS_GFrame_BACKEND/meta/qm"
bmeta "LAPP_GAAS_GFrame_BACKEND/meta/base"
model "LAPP_GAAS_GFrame_BACKEND/models/api"
common "LAPP_GAAS_GFrame_BACKEND/models/base"
"LAPP_GAAS_GFrame_BACKEND/utils"
"LAPP_GAAS_GFrame_BACKEND/web/models"
"fmt"
"strings"
)
/******************************************************************************
@ -162,6 +170,91 @@ func (impl *ACCUNITIDServiceImplement) SelectOne(user *models.Usertab, rECID int
return result, nil
}
/******************************************************************************
*
* @Reference LAPP_GAAS_GFrame_BACKEND/services/api/ACCUNITIDService.SelectInfo
*
******************************************************************************/
func (impl *ACCUNITIDServiceImplement) SelectInfo(user *models.Usertab, reclinerNr string) (*model.ReclinerResult, error) {
grmi.Log(user, "/services/api/implments/ACCUNITID.service.impl.go", "SelectOneACCUNITID", "查询一个ACCUNITID")
reclinerResult := new(model.ReclinerResult)
slaves := db.Eloquent.Slaves()
slavesession := slaves[0].NewSession()
defer slavesession.Close()
engine := db.Eloquent.Master()
session := engine.NewSession()
defer session.Close()
dao := dal.NewACCUNITIDDAO(slavesession, user.Userid)
result, err := dao.SelectInfo(reclinerNr)
if err != nil {
fmt.Println(11)
return nil, err
}
orderId := result.UNITSN
//截取物料id
bdal := basedal.NewLabelParserHeadDAO(session, user.Pid, user.Userid)
resultCode, err := bdal.SelectOne("Barcode")
if err != nil {
return nil, err
}
var artId string
if utils.ValueIsEmpty(resultCode.Split) {
lstdao := basedal.NewLabelParserDetailLstDAO(session, user.Pid, user.Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
resultCode.Valst = list
if len(orderId) < resultCode.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
}
codeInfos := common.ParseBarcode(orderId, resultCode.Valst)
artId = codeInfos["artId"]
} else {
artIds := strings.Split(orderId, resultCode.Split)
artId = artIds[0]
}
// 获取Article
articleDAO := basedal.NewArticleDAO(session, user.Pid, user.Userid)
article, err := articleDAO.SelectOne(artId)
if err != nil {
return nil, err
}
if article == nil {
return nil, grmi.NewBusinessError("不存在指定Article!")
}
// 获取Article和视图的关联
artViewDAO := qmdal.NewArtViewDAO(session, user.Pid, user.Userid)
artViews, err := artViewDAO.Select([]grmi.Predicate{qmmeta.ArtView_ArtId.NewPredicate(grmi.Equal, article.ArtId)}, nil)
if err != nil {
return nil, err
}
// 从关联中获取视图标识
viewIds := make([]interface{}, len(artViews))
for i, artView := range artViews {
viewIds[i] = artView.ViewId
}
// 获取视图
viewDAO := qmdal.NewViewDAO(session, user.Pid, user.Userid)
views, err := viewDAO.Select([]grmi.Predicate{qmmeta.View_ViewId.NewPredicate(grmi.Include, viewIds...)}, nil)
if err != nil {
return nil, err
}
reclinerResult.ACCUNITID = *result
reclinerResult.Views = views
return reclinerResult, nil
}
/******************************************************************************
*
* @Reference LAPP_GAAS_GFrame_BACKEND/services/api/ACCUNITIDService.UpdateOne


+ 56
- 36
services/log/implments/PackOrder.service.impl.go View File

@ -9,6 +9,7 @@ import (
basedal "LAPP_GAAS_GFrame_BACKEND/dao/base"
"LAPP_GAAS_GFrame_BACKEND/utils"
"fmt"
"strings"
//medal "LAPP_GAAS_GFrame_BACKEND/dao/me"
dal "LAPP_GAAS_GFrame_BACKEND/dao/log"
@ -516,19 +517,26 @@ func (self *PackOrderServiceImplement) OpenPackOrder(context *container.RequestC
if err != nil {
return nil, err
}
lstdao := basedal.NewLabelParserDetailLstDAO(context.Session(), self.session.User().Pid, self.session.User().Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
data.Valst = list
if len(orderId) < data.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
var artId string
if utils.ValueIsEmpty(data.Split) {
lstdao := basedal.NewLabelParserDetailLstDAO(context.Session(), self.session.User().Pid, self.session.User().Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
data.Valst = list
if len(orderId) < data.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
}
codeInfos := bmodel.ParseBarcode(orderId, data.Valst)
artId = codeInfos["artId"]
} else {
artIds := strings.Split(orderId, data.Split)
artId = artIds[0]
}
codeInfos := bmodel.ParseBarcode(orderId, data.Valst)
artId := codeInfos["artId"]
articleDAO := base.NewArticleDAO(context.Session(), self.session.User().Pid, self.session.User().Userid)
article, err := articleDAO.SelectOne(artId)
@ -681,19 +689,25 @@ func (self *PackOrderServiceImplement) IsCreatePackOrder(user *models.Usertab, o
if err != nil {
return nil, err
}
lstdao := basedal.NewLabelParserDetailLstDAO(session, user.Pid, user.Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
data.Valst = list
if len(orderId) < data.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
var artId string
if utils.ValueIsEmpty(data.Split) {
lstdao := basedal.NewLabelParserDetailLstDAO(session, self.session.User().Pid, self.session.User().Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
data.Valst = list
if len(orderId) < data.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
}
codeInfos := bmodel.ParseBarcode(orderId, data.Valst)
artId = codeInfos["artId"]
} else {
artIds := strings.Split(orderId, data.Split)
artId = artIds[0]
}
codeInfos := bmodel.ParseBarcode(orderId, data.Valst)
artId := codeInfos["artId"]
//判断条码是否已经生成过包装
itemlstDAO := dal.NewPackOrderItemlstDAO(session, user.Pid, user.Userid)
@ -964,19 +978,25 @@ func (self *PackOrderServiceImplement) SelectTemplates(user *models.Usertab, ord
if err != nil {
return nil, err
}
lstdao := basedal.NewLabelParserDetailLstDAO(session, user.Pid, user.Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
data.Valst = list
if len(orderId) < data.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
var artId string
if utils.ValueIsEmpty(data.Split) {
lstdao := basedal.NewLabelParserDetailLstDAO(session, self.session.User().Pid, self.session.User().Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
data.Valst = list
if len(orderId) < data.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
}
codeInfos := bmodel.ParseBarcode(orderId, data.Valst)
artId = codeInfos["artId"]
} else {
artIds := strings.Split(orderId, data.Split)
artId = artIds[0]
}
codeInfos := bmodel.ParseBarcode(orderId, data.Valst)
artId := codeInfos["artId"]
articleDAO := base.NewArticleDAO(session, user.Pid, user.Userid)
article, err := articleDAO.SelectOne(artId)


+ 39
- 23
services/ods/implments/ArtRouteOdsLst.service.impl.go View File

@ -11,7 +11,9 @@ import (
meta "LAPP_GAAS_GFrame_BACKEND/meta/ods"
model "LAPP_GAAS_GFrame_BACKEND/models/ods"
bmodel "LAPP_GAAS_GFrame_BACKEND/models/base"
"LAPP_GAAS_GFrame_BACKEND/utils"
"LAPP_GAAS_GFrame_BACKEND/web/models"
"strings"
)
/******************************************************************************
@ -226,18 +228,26 @@ func (impl *ArtRouteOdsLstServiceImplement) SelectOneByWorkPlaceId(user *models.
if err != nil {
return nil, err
}
delstdao := basedal.NewLabelParserDetailLstDAO(session, user.Pid, user.Userid)
valst, err := delstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
if len(orderId) < data.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
var artId string
if utils.ValueIsEmpty(data.Split) {
lstdao := basedal.NewLabelParserDetailLstDAO(session, user.Pid, user.Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
data.Valst = list
if len(orderId) < data.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
}
codeInfos := bmodel.ParseBarcode(orderId, data.Valst)
artId = codeInfos["artId"]
} else {
artIds := strings.Split(orderId, data.Split)
artId = artIds[0]
}
codeInfos := bmodel.ParseBarcode(orderId, valst)
artId := codeInfos["artId"]
//根据工位编号查询工位Id
placeDao := basedal.NewWorkPlaceDAO(session, user.Pid, user.Userid)
@ -461,19 +471,25 @@ func (impl *ArtRouteOdsLstServiceImplement) SelectByArtId(user *models.Usertab,
if err != nil {
return nil,err
}
lstdao := basedal.NewLabelParserDetailLstDAO(session, user.Pid, user.Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil,err
}
data.Valst = list
if len(orderId) < data.Length{
return nil,grmi.NewBusinessError("序列订单错误!")
var artId string
if utils.ValueIsEmpty(data.Split) {
lstdao := basedal.NewLabelParserDetailLstDAO(session, user.Pid, user.Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
data.Valst = list
if len(orderId) < data.Length {
return nil, grmi.NewBusinessError("序列订单错误!")
}
codeInfos := bmodel.ParseBarcode(orderId, data.Valst)
artId = codeInfos["artId"]
} else {
artIds := strings.Split(orderId, data.Split)
artId = artIds[0]
}
codeInfos := bmodel.ParseBarcode(orderId,data.Valst)
artId := codeInfos["artId"]
dao := dal.NewArtRouteOdsLstDAO(session, user.Pid, user.Userid)
result, err := dao.SelectByArtId(artId)
if err != nil {


+ 2
- 2
services/qm/ReclinerReclst.service.go View File

@ -58,7 +58,7 @@ type ReclinerReclstService interface {
* @Date : 2021-07-12 14:05:20
*
******************************************************************************/
DeleteOne(*models.Usertab, int, string) error
DeleteOne(*models.Usertab, int) error
/******************************************************************************
*
* @Function Name : SelectOne
@ -79,7 +79,7 @@ type ReclinerReclstService interface {
* @Date : 2021-07-12 14:05:20
*
******************************************************************************/
SelectOne(*models.Usertab, int, string) (*model.ReclinerReclst, error)
SelectOne(*models.Usertab, int) (*model.ReclinerReclst, error)
/******************************************************************************
*
* @Function Name : UpdateOne


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

@ -11,9 +11,11 @@ import (
bmeta "LAPP_GAAS_GFrame_BACKEND/meta/base"
model "LAPP_GAAS_GFrame_BACKEND/models/qm"
common "LAPP_GAAS_GFrame_BACKEND/models/base"
"LAPP_GAAS_GFrame_BACKEND/utils"
"LAPP_GAAS_GFrame_BACKEND/web/models"
"fmt"
"strconv"
"strings"
"time"
)
@ -257,19 +259,25 @@ func (impl *DefectRecordServiceImplement) Insert(user *models.Usertab, entities
if err != nil {
return err
}
lstdao := basedal.NewLabelParserDetailLstDAO(session, user.Pid, user.Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return err
}
result.Valst = list
if len(orderId) < result.Length {
return grmi.NewBusinessError("序列订单错误!")
var artId string
if utils.ValueIsEmpty(result.Split) {
lstdao := basedal.NewLabelParserDetailLstDAO(session, user.Pid, user.Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return err
}
result.Valst = list
if len(orderId) < result.Length {
return grmi.NewBusinessError("序列订单错误!")
}
codeInfos := common.ParseBarcode(orderId, result.Valst)
artId = codeInfos["artId"]
} else {
artIds := strings.Split(orderId, result.Split)
artId = artIds[0]
}
codeInfos := common.ParseBarcode(orderId, result.Valst)
artID := codeInfos["artId"]
if count <= 0 {
//判断是否是修复
@ -286,7 +294,7 @@ func (impl *DefectRecordServiceImplement) Insert(user *models.Usertab, entities
//更新状态
entities.Status = common.CHECK_STATUS_CLOSED
entities.IsPack = 0
entities.ArtId = artID
entities.ArtId = artId
err = sdao.UpdateOne(&entities)
if err != nil {
return grmi.NewBusinessError("更新记录失败!")
@ -296,7 +304,7 @@ func (impl *DefectRecordServiceImplement) Insert(user *models.Usertab, entities
/*******无提交记录,即为正常订单********/
entities.Status = common.CHECK_STATUS_CLOSED
entities.IsPack = 0
entities.ArtId = artID
entities.ArtId = artId
err = sdao.InsertOne(&entities)
if err != nil {
return grmi.NewBusinessError("提交记录失败!")
@ -322,7 +330,7 @@ func (impl *DefectRecordServiceImplement) Insert(user *models.Usertab, entities
groupReasonDAO := dal.NewDefectGrpReasonLstDAO(session, user.Pid, user.Userid)
//添加记录
entities.Status = common.CHECK_STATUS_RUNNING
entities.ArtId = artID
entities.ArtId = artId
entities.IsPack = 0
err = sdao.InsertOne(&entities)
if err != nil {
@ -365,12 +373,12 @@ func (impl *DefectRecordServiceImplement) Insert(user *models.Usertab, entities
if area == nil {
return grmi.NewBusinessError(fmt.Sprintf("没有找到缺陷原因:%s#%d!", entity.ViewId, entity.AreaId))
}
artView, err := articleViewDAO.SelectOne(artID, entity.ViewId)
artView, err := articleViewDAO.SelectOne(artId, entity.ViewId)
if err != nil {
return err
}
if artView == nil {
return grmi.NewBusinessError(fmt.Sprintf("没有找到Article(%s)和视图(%s)的关联!", artID, entity.ViewId))
return grmi.NewBusinessError(fmt.Sprintf("没有找到Article(%s)和视图(%s)的关联!", artId, entity.ViewId))
}
viewGroup, err := viewGroupDAO.SelectOne(entity.ViewId, entity.DefectGrpId)
if err != nil {


+ 10
- 10
services/qm/implments/ReclinerReclst.service.impl.go View File

@ -96,7 +96,7 @@ func (impl *ReclinerReclstServiceImplement) InsertOne(user *models.Usertab, enti
session := engine.NewSession()
defer session.Close()
dao := dal.NewReclinerReclstDAO(session, user.Pid, user.Userid)
record, err := dao.SelectOne(entity.RecNr, entity.Line)
record, err := dao.SelectOne(entity.RecNr)
if err != nil {
return err
}
@ -115,7 +115,7 @@ func (impl *ReclinerReclstServiceImplement) InsertOne(user *models.Usertab, enti
* @Reference LAPP_GAAS_GFrame_BACKEND/services/qm/ReclinerReclstService.DeleteOne
*
******************************************************************************/
func (impl *ReclinerReclstServiceImplement) DeleteOne(user *models.Usertab, recNr int, line string) error {
func (impl *ReclinerReclstServiceImplement) DeleteOne(user *models.Usertab, recNr int) error {
grmi.Log(user, "/services/qm/implments/ReclinerReclst.service.impl.go", "DeleteOneReclinerReclst", "删除一个ReclinerReclst")
@ -123,14 +123,14 @@ func (impl *ReclinerReclstServiceImplement) DeleteOne(user *models.Usertab, recN
session := engine.NewSession()
defer session.Close()
dao := dal.NewReclinerReclstDAO(session, user.Pid, user.Userid)
record, err := dao.SelectOne(recNr, line)
record, err := dao.SelectOne(recNr)
if err != nil {
return err
}
if record == nil {
return grmi.NewBusinessError("不存在指定记录!")
}
err = dao.DeleteOne(recNr, line)
err = dao.DeleteOne(recNr)
if err != nil {
return err
}
@ -142,7 +142,7 @@ func (impl *ReclinerReclstServiceImplement) DeleteOne(user *models.Usertab, recN
* @Reference LAPP_GAAS_GFrame_BACKEND/services/qm/ReclinerReclstService.SelectOne
*
******************************************************************************/
func (impl *ReclinerReclstServiceImplement) SelectOne(user *models.Usertab, recNr int, line string) (*model.ReclinerReclst, error) {
func (impl *ReclinerReclstServiceImplement) SelectOne(user *models.Usertab, recNr int) (*model.ReclinerReclst, error) {
grmi.Log(user, "/services/qm/implments/ReclinerReclst.service.impl.go", "SelectOneReclinerReclst", "查询一个ReclinerReclst")
@ -150,7 +150,7 @@ func (impl *ReclinerReclstServiceImplement) SelectOne(user *models.Usertab, recN
session := engine.NewSession()
defer session.Close()
dao := dal.NewReclinerReclstDAO(session, user.Pid, user.Userid)
result, err := dao.SelectOne(recNr, line)
result, err := dao.SelectOne(recNr)
if err != nil {
return nil, err
}
@ -170,7 +170,7 @@ func (impl *ReclinerReclstServiceImplement) UpdateOne(user *models.Usertab, enti
session := engine.NewSession()
defer session.Close()
dao := dal.NewReclinerReclstDAO(session, user.Pid, user.Userid)
record, err := dao.SelectOne(entity.RecNr, entity.Line)
record, err := dao.SelectOne(entity.RecNr)
if err != nil {
return err
}
@ -199,7 +199,7 @@ func (impl *ReclinerReclstServiceImplement) Insert(user *models.Usertab, entitie
dao := dal.NewReclinerReclstDAO(session, user.Pid, user.Userid)
for _, entity := range *entities {
record, err := dao.SelectOne(entity.RecNr, entity.Line)
record, err := dao.SelectOne(entity.RecNr)
if err != nil {
return err
}
@ -230,7 +230,7 @@ func (impl *ReclinerReclstServiceImplement) Delete(user *models.Usertab, entitie
dao := dal.NewReclinerReclstDAO(session, user.Pid, user.Userid)
for _, entity := range *entities {
record, err := dao.SelectOne(entity.RecNr, entity.Line)
record, err := dao.SelectOne(entity.RecNr)
if err != nil {
return err
}
@ -294,7 +294,7 @@ func (impl *ReclinerReclstServiceImplement) Update(user *models.Usertab, entitie
dao := dal.NewReclinerReclstDAO(session, user.Pid, user.Userid)
for _, entity := range *entities {
record, err := dao.SelectOne(entity.RecNr, entity.Line)
record, err := dao.SelectOne(entity.RecNr)
if err != nil {
return err
}


+ 21
- 12
services/qm/implments/View.service.impl.go View File

@ -13,10 +13,12 @@ import (
meta "LAPP_GAAS_GFrame_BACKEND/meta/qm"
common "LAPP_GAAS_GFrame_BACKEND/models/base"
model "LAPP_GAAS_GFrame_BACKEND/models/qm"
"LAPP_GAAS_GFrame_BACKEND/utils"
"LAPP_GAAS_GFrame_BACKEND/web/models"
"fmt"
"github.com/go-xorm/xorm"
basedal "LAPP_GAAS_GFrame_BACKEND/dao/base"
"strings"
)
const (
@ -603,19 +605,26 @@ func (impl *ViewServiceImplement) ViewsOfArticle(context *container.RequestConte
if err != nil {
return nil,err
}
lstdao := basedal.NewLabelParserDetailLstDAO(context.Session(), impl.session.User().Pid, impl.session.User().Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil,err
}
result.Valst = list
if len(orderId) < result.Length{
return nil,grmi.NewBusinessError("序列订单错误!")
var artId string
if utils.ValueIsEmpty(result.Split) {
lstdao := basedal.NewLabelParserDetailLstDAO(context.Session(), impl.session.User().Pid, impl.session.User().Userid)
list, err := lstdao.Select([]grmi.Predicate{
bmeta.LabelParserDetailLst_ParserId.NewPredicate(grmi.Equal, "Barcode"),
}, nil)
if err != nil {
return nil, err
}
result.Valst = list
if len(orderId) < result.Length {
return nil,grmi.NewBusinessError("序列订单错误!")
}
codeInfos := common.ParseBarcode(orderId, result.Valst)
artId = codeInfos["artId"]
} else {
artIds := strings.Split(orderId, result.Split)
artId = artIds[0]
}
codeInfos := common.ParseBarcode(orderId,result.Valst)
artId := codeInfos["artId"]
slaves := db.Eloquent.Slaves()
slavesession := slaves[0].NewSession()


+ 41
- 0
web/controllers/api/ACCUNITID.rest.go View File

@ -198,6 +198,47 @@ func RegisterSelectOneACCUNITID(party router.Party, path string, method func(*mo
})
}
/******************************************************************************
*
* @Function Name : RegisterSelectInfoACCUNITID
*-----------------------------------------------------------------------------
*
* @Description : 为一个查找单条ACCUNITID的方法注册路由
*
* @Function Parameters : 路由分组
*
* @Function Parameters : 路径
*
* @Function Parameters : 实际处理请求的方法
*
* @Author : 代码生成器创建
*
* @Date : 2021-07-12 10:08:28
*
******************************************************************************/
func RegisterSelectInfoACCUNITID(party router.Party, path string, method func(*models.Usertab, string) (*model.ReclinerResult, error)) {
party.Get(path, func(ctx iris.Context) {
user, ok := jwts.ParseToken(ctx)
if !ok {
supports.Error(ctx, iris.StatusBadRequest, supports.ParseParamsFailur, nil)
return
}
reclinerNr := ctx.URLParam("reclinerNr")
result, err := method(user, reclinerNr)
if err != nil {
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil)
return
}
if result == nil {
supports.Error(ctx, iris.StatusNotFound, supports.NotFound, nil)
return
}
supports.Ok(ctx, supports.OptionSuccess, result)
})
}
/******************************************************************************
*
* @Function Name : RegisterUpdateOneACCUNITID


+ 2
- 0
web/controllers/api/api.go View File

@ -78,6 +78,8 @@ func RegisterRoutes() {
RegisterSelectACCUNITID(accunitid, "/query", serviceOfACCUNITID.Select)
// ACCUNITID查询一条
RegisterSelectOneACCUNITID(accunitid, "/get", serviceOfACCUNITID.SelectOne)
//查询调角器对应的信息
RegisterSelectInfoACCUNITID(accunitid, "/selectinfo", serviceOfACCUNITID.SelectInfo)
// ACCUNITID修改一条
// RegisterUpdateOneACCUNITID(accunitid, "/updateone", serviceOfACCUNITID.UpdateOne)
// ACCUNITID修改多条


+ 3
- 4
web/controllers/qm/ReclinerReclst.rest.go View File

@ -172,9 +172,9 @@ func RegisterDeleteOneReclinerReclst(party router.Party, path string, method fun
* @Date : 2021-07-12 14:05:20
*
******************************************************************************/
func RegisterSelectOneReclinerReclst(party router.Party, path string, method func(*models.Usertab, int, string) (*model.ReclinerReclst, error)) {
func RegisterSelectOneReclinerReclst(party router.Party, path string, method func(*models.Usertab, int) (*model.ReclinerReclst, error)) {
party.Get(path+"/{recNr:int}/{line:string}", func(ctx iris.Context) {
party.Get(path+"/{recNr:int}", func(ctx iris.Context) {
user, ok := jwts.ParseToken(ctx)
if !ok {
supports.Error(ctx, iris.StatusBadRequest, supports.ParseParamsFailur, nil)
@ -186,8 +186,7 @@ func RegisterSelectOneReclinerReclst(party router.Party, path string, method fun
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil)
return
}
line := ctx.Params().GetString("line")
result, err := method(user, recNr, line)
result, err := method(user, recNr)
if err != nil {
supports.Error(ctx, iris.StatusBadRequest, err.Error(), nil)
return


+ 1
- 1
web/controllers/qm/qm.go View File

@ -241,7 +241,7 @@ func RegisterRoutes() {
// ReclinerReclst的服务实例
var serviceOfReclinerReclst = svr.NewReclinerReclstService()
// ReclinerReclst插入一条
// RegisterInsertOneReclinerReclst(reclinerreclst, "/insertone", serviceOfReclinerReclst.InsertOne)
RegisterInsertOneReclinerReclst(reclinerreclst, "/insertone", serviceOfReclinerReclst.InsertOne)
// ReclinerReclst插入多条
// RegisterInsertReclinerReclst(reclinerreclst, "/insert", serviceOfReclinerReclst.Insert)
// ReclinerReclst删除一条


Loading…
Cancel
Save