コード例 #1
0
    def setUp(self):
        self.qwo = QualityWorkOrder()
        self.tqo = TrackQualityOrder()

        self.qualityWorkOrder_data = {
            "smBusiUnitGid": "7e2c4ba1d1f64ad7b214a233c7ebb0fb",
            "code": pm.create_code(),
            "mdMaterialGid": params.MaterielSJGid,
            "shouldCheckQty": 10
        }

        resp1 = self.qwo.qualityWorkOrder_create(self.qualityWorkOrder_data)
        # print(resp1)
        # 直接创建一条质检工单

        self.trackQualityOrder_data = {
            "code": pm.create_code(),
            "qcDispatchedQty": 1,
            "mdFactoryWorkStationGid": "",
            "imeQcQualityWayGid": "",
            "surveyor": "",
            "checkBeginTime": "",
            "checkEndTime": "",
            "remarks": "",
            "imeQcQacGid": resp1.pop("data"),
            "imeQcQacCode": "",
            "mdMaterialGid": "",
            "mdProductInfoGid": "",
            "qcHasDispatchedQty": "",
            "qcHasInspectionQty": "",
            "qcDispatchedPersonGid": ""
        }
    def setUp(self):
        self.qcl = QualityCollectList()

        self.qwo = QualityWorkOrder()

        self.qualityWorkOrder_data = {
            "smBusiUnitGid": "7e2c4ba1d1f64ad7b214a233c7ebb0fb",
            "code": "",
            "mdMaterialGid": params.MaterielSJGid,
            "shouldCheckQty": 10
        }

        self.qualityCollectList_data = [
            {
                "importance": "important",
                "indexCode": "001",
                "indexCreateSourceGid": "60eca75873644e91b09b082d963bf76e",
                "indexName": "轴承",
                "indexType": "qualitative",
                "mdRouteOperationCode": "001",
                "mdRouteOperationName": "冲压工序01",
                "isOk": "b40fde533e474fdb97f0e51d4439fa2a",
                "qcRefCode": "",
                "qcRefGid": "",
                "qcRefType": ""
            }
        ]
コード例 #3
0
    def setUp(self):
        self.qwo = QualityWorkOrder()
        self.tqo = TrackQualityOrder()
        self.qr = QualityRecord()

        self.qualityWorkOrder_data = {
            "smBusiUnitGid": "7e2c4ba1d1f64ad7b214a233c7ebb0fb",
            "code": pm.create_code(),
            "mdMaterialGid": params.MaterielSJGid,
            "shouldCheckQty": 10
        }

        resp1 = self.qwo.qualityWorkOrder_create(self.qualityWorkOrder_data)
        # print(resp1)
        # 直接创建一条质检工单

        self.trackQualityOrder_data = {
            "code": pm.create_code(),
            "qcDispatchedQty": 5,
            "mdFactoryWorkStationGid": "",
            "imeQcQualityWayGid": "",
            "surveyor": "",
            "checkBeginTime": "",
            "checkEndTime": "",
            "remarks": "",
            "imeQcQacGid": resp1.pop("data"),
            "imeQcQacCode": "",
            "mdMaterialGid": "",
            "mdProductInfoGid": "",
            "qcHasDispatchedQty": "",
            "qcHasInspectionQty": "",
            "qcDispatchedPersonGid": ""
        }

        resp2 = self.tqo.trackQualityOrder_add(self.trackQualityOrder_data)
        print("resp2")
        print(resp2)
        # 对质检工单做派检

        self.qualityRecord_data = {
            "code": "",
            "qcInspectionQty": 2,
            "imeQcQacBillGid": resp2.pop("data")
        }

        resp3 = self.qr.qualityRecord_add(self.qualityRecord_data)
        print("resp3")
        print(resp3)
        # 根据派检单生成报检单

        self.reportRecord_data = {
            "qualifiedQty": 1,
            "unQualifiedQty": 1,
            "imeQcQualityGradeGid": "",
            "qcHandleWay": "返工返修",
            "gid": resp3.pop("data")
        }
    def setUp(self):
        self.wo = WorkOrder()
        self.qwo = QualityWorkOrder()
        self.workOrder_mock_data = {
            "code": pm.create_code(),
            "resourceOrderGid": "",
            "materialGid": params.MaterielSJGid,
            "orderType": "62DC90DAFA845CB2E055000000000001",
            "workCenterGid": params.bmFactoryWorkCenterGid,
            "factoryLineGid": params.bmFactoryLineCF,
            "routeLineGid": "",
            "planQty": 10,
            "planBeginTime": "2018-05-01",
            "planEndTime": "2018-05-31",
            "actualBeginTime": "",
            "actualEndTime": "",
            "finishQty": "",
            "measureBeginTime": "",
            "measureEndTime": "",
            "orderSeq": "",
            "parentWorkOrderGid": "",
            "freezeStatus": "",
            "orderStatus": "",
            "bomStatus": "",
            "createStatus": "",
            "roundNum": "",
            "processStatus": "",
            "createKmFlag": "",
            "createQacFlag": "",
            "repairCardGid": "",
            "measurementUnitGid": params.bmMeasurementUnitGid,
            "materialVersion": "1",
            "busiActivityType": "",
            "qualifiedQty": "",
            "unqualifiedQty": "",
            "wasteQty": "",
            "batchNumber": "",
            "productGid": "",
            "workOrderCategory": "",
            "bomVersion": "",
            "routeLineVersion": "",
            "canOperation": "",
            "surplusOrderFlag": "",
            "publishedQty": "",
            "factoryLineType": "",
            "generatedCode": ""
        }

        self.workOrder_Rule_data = {
            "gid": "712E1C21843F5B4FE055000000000001",
            "name": "是否下发",
            "code": "IS_PUBLISH",
            "description": "是否下发",
            "activeRule": "false"
}
コード例 #5
0
    def setUp(self):
        self.qr = QualityRecord()
        self.qwo = QualityWorkOrder()

        self.qualityWorkOrder_data = {
            "smBusiUnitGid": "7e2c4ba1d1f64ad7b214a233c7ebb0fb",
            "code": pm.create_code(),
            "mdMaterialGid": params.MaterielSJGid,
            "shouldCheckQty": 10
        }

        resp1 = self.qwo.qualityWorkOrder_create(self.qualityWorkOrder_data)
        # print(resp1)
        # 直接创建一条质检工单

        self.qualityRecord_data = {
            "code": "",
            "qcInspectionQty": 5,
            "imeQcQacGid": resp1.pop("data")
        }
    def setUp(self):
        self.qc = QualityCollectList()
        self.qwo = QualityWorkOrder()
        self.tqo = TrackQualityOrder()
        self.qro = QualityRecord()

        self.qualityWorkOrder_data_create = {
            "smBusiUnitGid": "7e2c4ba1d1f64ad7b214a233c7ebb0fb",
            "code": "",
            "mdMaterialGid": params.MaterielSJGid,
            "shouldCheckQty": 10
        }

        self.tqo_data_create = {
            "code": "",
            "qcDispatchedQty": 10,
            "mdFactoryWorkStationGid": params.bmFactoryWorkStationCPUGid,
            "imeQcQualityWayGid": "",
            "surveyor": "",
            "checkBeginTime": "",
            "checkEndTime": "",
            "remarks": "",
            "imeQcQacGid": "",
            "imeQcQacCode": "",
            "mdMaterialGid": "",
            "mdProductInfoGid": "",
            "qcHasDispatchedQty": "",
            "qcHasInspectionQty": "",
            "qcDispatchedPersonGid": ""
        }

        self.rqo_data_create = {
            "code": "",
            "qcInspectionQty": 10,
            "imeQcQacBillGid": ""
        }
コード例 #7
0
    def setUp(self):
        # 脚本执行开关
        self.run_status = {
            'smoke_production': True,
            'smoke_logistics': True,
            'smoke_quality': True,
            'smoke_equipment': True
        }

        # 订单、工单下发方式:0-下发改变状态;1-下发生成下游数据
        # 质检工单自动生成:0-否;1-是
        self.way_planorder_sendown = 1
        self.way_workorder_sendown = 0
        self.way_quality_autocreate = 1

        self.po = PlanOrder()
        self.wo = WorkOrder()
        self.to = TrackOrder()
        self.ro = ReportOrder()

        self.mr = MaterialRequirement()
        self.lo = Logistics()
        self.lbr = LogBillReport()
        self.lro = LogReportRecord()

        self.qwo = QualityWorkOrder()
        self.qto = TrackQualityOrder()
        self.qro = QualityRecord()

        self.eqm = Equipments()

        self.isy = InspectStrategy()
        self.it = InspectTask()

        self.msg = 'Error'

        self.test_sc_status = False
        self.test_wl_status = False
        self.test_zl_status = False
        self.test_sb_status = False

        self.planOrder_create_data = {
            "planOrderCategory": "normal",
            "factoryLineGid": params.bmFactoryLineCF,
            "orderType": "62DC90DAFA845CB2E055000000000001",
            "orderTypeRef": {
                "name": "类型一"
            },
            "materialRef": {
                "code": "Q01",
                "name": "手机",
                "bmMeasurementUnitGidRef": {
                    "name": "件"
                },
                "bmMeasurementUnitGid": params.bmMeasurementUnitGid
            },
            "code": "sfdsfsdafsdfasfasdf",
            "planBeginTime": "2018-08-02 17:18:47",
            "planQty": "11",
            "workCenterRef": {
                "workCenterName": "小米科技",
                "workCenterCode": "Q1"
            },
            "surplusOrderFlag": "false",
            "factoryLineRef": {
                "lineName": "小米重复",
                "lineCode": "Q11",
                "lineType": "REPEAT"
            },
            "smBusiUnitGidRef": {
                "busiUnitName": "小米科技"
            },
            "materialGid": params.MaterielSJGid,
            "smBusiUnitGid": params.busiUnitGid,
            "workCenterGid": params.bmFactoryWorkCenterGid,
            "planEndTime": "2018-08-24 17:18:47"
        }

        self.wo_query_data = {
            "query": {
                "query": [{
                    "field": "smBusiUnitGid",
                    "type": "eq",
                    "value": params.busiUnitGid,
                    "operator": "and"
                }, {
                    "operator": "and",
                    "field": "planOrderRef.code",
                    "type": "eq",
                    "value": "",
                    "left": "(",
                    "right": ")"
                }]
            },
            "pager": {
                "page": 1,
                "pageSize": 10
            }
        }

        self.to_createby_data = [{
            "orderId": "123",  # 工单ID
            "refenceQty": 11,  # 本次参照数量,工单产线类型为重复时,必填,产线类型为离散时,不校验此参数
        }]

        self.to_assign_data = {
            "imeTrackOrderOperationList": [{
                "gid": "23ef1117e6ff4b4fad2cc7b6766ad5cc",
                "curTrackQty": 11
            }, {
                "gid": "321fdfcdc14a4557a4c473aec97075ae",
                "curTrackQty": 11
            }],
            "gid":
            "a32b387bdaad4f0d85e260948e4d7a24",
            "workUnitGid":
            "78ae9666dc974110ad74303bbd5b368e"
        }

        self.to_query_data = {
            "query": {
                "query": [{
                    "field": "smBusiUnitGid",
                    "type": "eq",
                    "value": "7e2c4ba1d1f64ad7b214a233c7ebb0fb",
                    "operator": "and"
                }, {
                    "operator": "and",
                    "field": "workOrderRef.code",
                    "type": "eq",
                    "value": "WO1532061056870",
                    "left": "(",
                    "right": ")"
                }]
            },
            "pager": {
                "page": 1,
                "pageSize": 10
            }
        }

        self.ro_report_data = {
            "reportOrderId":
            "",
            "resourceOrderType":
            "10030",
            "imeReportOrderOperations": [{
                "operationGid": "5a814bc4682442d6add2836fe609809d",
                "curQualifiedQty": "11",
                "curRepairQty": "0"
            }, {
                "operationGid": "5b8b28f5755a4189a1c32385c6af4c96",
                "curQualifiedQty": "11",
                "curRepairQty": "0"
            }],
            "smBusiUnitGid":
            "7e2c4ba1d1f64ad7b214a233c7ebb0fb"
        }

        self.materialReq_mock_data = {
            "gids": [],
            "groupBy": [],
            "orderBy": [],
            "strategys": [],
            "strategyGids": []
        }

        self.materialReq_query_data = {
            "query": {
                "query": [{
                    "field": "smBusiUnitGid",
                    "type": "eq",
                    "value": "7e2c4ba1d1f64ad7b214a233c7ebb0fb",
                    "operator": "and"
                }, {
                    "operator": "and",
                    "field": "factoryStationRef.stationName",
                    "type": "eq",
                    "value": "CPU",
                    "left": "(",
                    "right": ")"
                }],
                "sorted":
                "createTime desc"
            },
            "pager": {
                "page": 1,
                "pageSize": 10
            }
        }

        self.lgis_ref_data = {"gids": [], "groupBy": [], "orderBy": []}

        self.lgis_query_data = {
            "query": {
                "query": [{
                    "field": "smBusiUnitGid",
                    "type": "eq",
                    "value": params.busiUnitGid,
                    "operator": "and"
                }, {
                    "operator": "and",
                    "field": "imeLogTrackBillDetailList.resourceGidRef.code",
                    "type": "eq",
                    "value": "MR201807230023",
                    "left": "(",
                    "right": ")"
                }]
            },
            "pager": {
                "page": 1,
                "pageSize": 10
            }
        }

        self.lgis_bind_data = {
            'gids': [],
            'bmLogRouteGid': params.bmLogRouteGid
        }

        self.lbr_mock_data = {
            "billGidList": [],
            "operationRuleList": [{
                "bmLogOperationGid": params.bmLogOperationGid,
                "ruleList": []
            }]
        }

        self.lbr_find_data = {
            "query": {
                "query": [{
                    "field": "smBusiUnitGid",
                    "type": "eq",
                    "value": params.busiUnitGid,
                    "operator": "and"
                }, {
                    "operator": "and",
                    "field": "logBillReportList.resourceGidRef.code",
                    "type": "eq",
                    "value": "TB",
                    "left": "(",
                    "right": ")"
                }]
            },
            "pager": {
                "page": 1,
                "pageSize": 10
            }
        }

        self.lrr_query_data = {
            "query": {
                "query": [{
                    "field": "opType",
                    "value": "REPORT",
                    "operator": "and",
                    "type": "eq",
                    "left": "(",
                    "right": ")"
                }, {
                    "operator": "and",
                    "field": "objectGid",
                    "type": "eq",
                    "value": "",
                    "left": "(",
                    "right": ")"
                }]
            },
            "pager": {
                "page": 1,
                "pageSize": 10
            }
        }

        self.eqm_add_data = {
            "bmEquipmentTypeGid": "740a423085c54da9bdb3c28442b0f3c4",
            "bmMeasurementUnitGidRef": {
                "name": "件",
                "code": "Q1"
            },
            "model": "FDASFASDF",
            "name": "",
            "code": "",
            "bmMeasurementUnitGid": "f32a4a41e5834369924c5a9fa9358913",
            "status": "intact",
            "bmFactoryWorkCenterGidRef": {
                "workCenterCode": "Q1",
                "workCenterName": "小米科技"
            },
            "smDepartmentGid": "c72e12eceb4b430cb87af95f962c7edf",
            "smBusiUnitGidRef": {
                "busiUnitName": "小米科技"
            },
            "smBusiUnitGid": "7e2c4ba1d1f64ad7b214a233c7ebb0fb",
            "smDepartmentGidRef": {
                "code": "Q11",
                "name": "研发部"
            },
            "bmFactoryWorkCenterGid": "4756b6ee4de24d0b82281af141e64e97"
        }

        self.isy_add_data = [{
            "inspectCycle":
            5,
            "inspectCycleUnit":
            "时",
            "bmEquipmentGid":
            "",
            "bmEquipInspectPartGid":
            params.bmEquipInspectPartGid,
            "bmEquipInspectItemGid":
            params.bmEquipInspectItemGid
        }]

        self.it_addf_data = {
            "bmEquipmentGid": "",
            "beginTime": "2017-12-31 11:18:35",
            "endTime": "2018-01-01 11:18:35"
        }

        self.it_track_data = {
            "gids": [],
            "headPersonnelGid": params.smPersonnelGid
        }

        self.it_report_data = {
            "gid": "",
            "inspectResult": "normal",
            "inspectResultDescription": "设备运行正常",
            "reportPersonnelGid": params.smPersonnelGid
        }

        self.qwo_query_data = {
            "query": {
                "query": [{
                    "field": "smBusiUnitGid",
                    "type": "eq",
                    "value": "7e2c4ba1d1f64ad7b214a233c7ebb0fb",
                    "operator": "and"
                }, {
                    "operator": "and",
                    "field": "imeWorkOrderGidRef.code",
                    "type": "eq",
                    "value": "fsdfadasfdasfasf",
                    "left": "(",
                    "right": ")"
                }],
            },
            "pager": {
                "page": 1,
                "pageSize": 10
            }
        }

        self.qto_create_data = {
            "code": "",
            "qcDispatchedQty": "1",
            "mdFactoryWorkStationGid": "",
            "imeQcQualityWayGid": "",
            "surveyor": "",
            "checkBeginTime": "",
            "checkEndTime": "",
            "remarks": "",
            "imeQcQacGid": "",
            "imeQcQacCode": "",
            "mdMaterialGid": "",
            "mdProductInfoGid": "",
            "qcHasDispatchedQty": "",
            "qcHasInspectionQty": "",
            "qcDispatchedPersonGid": ""
        }

        self.qro_create_data = {
            "code": "",
            "qcInspectionQty": "1",
            "imeQcQacBillGid": ""
        }

        self.qro_report_data = {
            "qualifiedQty": 1,
            "unQualifiedQty": "",
            "imeQcQualityGradeGid": "",
            "qcHandleWay": "",
            "gid": ""
        }