From 14a358ac5d8a1c43a69c3783507c12a8dd3591e0 Mon Sep 17 00:00:00 2001 From: zhangxin Date: Wed, 4 Aug 2021 16:54:38 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=94=9F=E6=88=90=E5=B7=A5?= =?UTF-8?q?=E8=89=BA=E6=95=B0=E6=8D=AE=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- services/om/implments/WorkOrder.service.impl.go | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/services/om/implments/WorkOrder.service.impl.go b/services/om/implments/WorkOrder.service.impl.go index b3971ed..fb4a945 100644 --- a/services/om/implments/WorkOrder.service.impl.go +++ b/services/om/implments/WorkOrder.service.impl.go @@ -1312,9 +1312,6 @@ func (impl *WorkOrderServiceImplement) OPCCommunication(user *models.Usertab, se for _, opc := range opcBasicData.OPCComRuleLi { var value string if opc.DBlockValueType == model.OPC_DBBLOCK_VALUE_TYPE_MAP { - if len(opc.OPCComDetailRuleLi) > 1 { - return nil, grmi.NewBusinessError("映射值多余一条") - } for _, detail := range opc.OPCComDetailRuleLi { if detail.BaseOnType == baseModel.BASE_ON_TYPE_ATTRNAME { attributeData, exist := attributeMap[detail.BaseOnValue] @@ -1322,25 +1319,25 @@ func (impl *WorkOrderServiceImplement) OPCCommunication(user *models.Usertab, se return nil, grmi.NewBusinessError("未获取到OPC通信细则中的零件属性描述对应的shortCode, 属性描述:" + detail.BaseOnValue) } if detail.DataType == baseModel.DATA_TYPE_ATTRCODE { - value = strconv.Itoa(attributeData.AttrCode) + value += strconv.Itoa(attributeData.AttrCode) } else if detail.DataType == baseModel.DATA_TYPE_SHORTCODE { - value = attributeData.ShortCode + value += attributeData.ShortCode } else if detail.DataType == baseModel.DATA_TYPE_ATTRVALUE { - value = attributeData.AttrValue + value += attributeData.AttrValue } else { return nil, grmi.NewBusinessError("不支持的OPC通信细则中的DATA TYPE, DATA TYPE:" + detail.DataType) } } else if detail.BaseOnType == baseModel.BASE_ON_TYPE_ORDERINFO { if detail.DataType == baseModel.DATA_TYPE_WONO { - value = workOrderId + value += workOrderId } else if detail.DataType == baseModel.DATA_TYPE_PARTNO { - value = serialOrderStep.SubArtId + value += serialOrderStep.SubArtId } else { return nil, grmi.NewBusinessError("不支持的OPC通信细则中的DATA TYPE, DATA TYPE:" + detail.DataType) } } else if detail.BaseOnType == baseModel.BASE_ON_TYPE_MAINBARCODE { if detail.BaseOnValue == baseModel.BASE_ON_VALUE_UNITSN { - value = serialOrderStep.SerialOrderId + value += serialOrderStep.SerialOrderId } else { return nil, grmi.NewBusinessError("不支持的OPC通信细则中的BASE ON VALUE, BASE ON VALUE:" + detail.BaseOnValue) } @@ -1419,7 +1416,7 @@ func (impl *WorkOrderServiceImplement) TightenWrenchInfo(user *models.Usertab, s PO: serialOrderStep.PO, SubArtId: serialOrderStep.SubArtId, Pos: pos, - StepType: model.STEP_OPC_RULE, + StepType: model.STEP_TW_RULE, Status: baseModel.WO_STATUS_LOCKED, StepNo: serialOrderStep.StepNo, // TightenWrenchInfo BRAND NAME