Browse Source

获取随机数

test
LG_lai 3 years ago
parent
commit
29ea6e43a1
6 changed files with 27 additions and 24 deletions
  1. 6
      001-FactoryReceiptManual/1-Client/FactoryReceipt.robot
  2. 6
      002-FactoryReceiptSwipe/1-Client/FactoryReceipt.robot
  3. 9
      003-FactoryOffsite/1-Client/FactoryOffsite.robot
  4. 11
      004-FactoryOutOrderManual/1-Client/FactoryOutbound.robot
  5. 13
      005-FactoryOutSwipe/1-Client/FactoryOutbound.robot
  6. 6
      RF-test/Client/1-FactoryReceipt.robot

6
001-FactoryReceiptManual/1-Client/FactoryReceipt.robot

@ -6,9 +6,9 @@ Library RequestsLibrary
ReceiptOrder
#创建厂内收货订单--手工单
Create Session ztbf ${ztbClient} ${client_header}
${unitPrice} Set Variable 2
${netWeight} Set Variable 11000
${settleWeight} Set Variable 11000
${unitPrice} Evaluate round(random.uniform(${defaultUnitPrice},${highestUnitPrice}),2) random
${netWeight} Evaluate random.randint(6000,10000) random
${settleWeight} Set Variable ${netWeight}
${settlePrice} Evaluate ${unitPrice}*${settleWeight}
${data} Set Variable { \ \ \ \ "deductType":1, \ \ \ \ "isWithoutTare":0, \ \ \ \ "status":null, \ \ \ \ "factoryCustomerId":"${CustomerId}", \ \ \ \ "factoryCustomerName":"${name}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "plateNumber":"55555", \ \ \ \ "productInfoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0, \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settlePrice":"${settlePrice}" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${reps} POST On Session ztbf ztb-factory/save/scrap-paper-onside-receipt-order ${data.encode('utf-8')}

6
002-FactoryReceiptSwipe/1-Client/FactoryReceipt.robot

@ -7,7 +7,7 @@ ReceiptWeigh
#厂内收货--刷卡过磅
#刷卡过磅--过毛重
Create Session ztbf ${ztbClient} ${client_header}
${weight} Set Variable 2410
${weight} Evaluate random.randint(4000,5000) random
${weighData} Set Variable {"cardNo":"${ReceiptcardNo}","weight":${weight}}
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${weighData.encode('utf-8')}
${ReceiptOrderId} Get From Dictionary ${reps.json()['data']} id #订单id
@ -20,11 +20,11 @@ ReceiptWeigh
${proportionOfProduct} Get From Dictionary ${reps.json()['data']} proportionOfProduct
${plateNumber} Set Variable If '${plateNumber}'=='${None}' null ${plateNumber}
#确定定价
${unitPrice} Set Variable 1.88
${unitPrice} Evaluate round(random.uniform(${defaultUnitPrice},${highestUnitPrice}),1) random
${submitData} Set Variable { \ \ \ \ "id":"${ReceiptOrderId}", \ \ \ \ "productInfoDtoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"2.1", \ \ \ \ \ \ \ \ \ \ \ \ "proportionOfProduct":"${proportionOfProduct}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "plateNumber":${plateNumber}, \ \ \ \ "factoryCustomerId":"${ReceiptCustomerId}", \ \ \ \ "deductType":1, \ \ \ \ "inspectionRemark":"确定定价", \ \ \ \ "isWithoutTare":"${isWithoutTare}" }
${reps} POST On Session ztbf ztb-factory/factory/submit/order-price ${submitData.encode('utf-8')}
#刷卡过磅--过皮重
${weightTare} Set Variable 2000
${weightTare} Evaluate random.randint(2000,4000) random
${weighData} Set Variable {"cardNo":"${ReceiptcardNo}","weight":${weightTare}}
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${weighData.encode('utf-8')}
${ReceiptOrderId} Get From Dictionary ${reps.json()['data']} id #订单id

9
003-FactoryOffsite/1-Client/FactoryOffsite.robot

@ -8,8 +8,9 @@ Library RequestsLibrary
OffsiteOrder
#创建厂外收货订单
Create Session ztbf ${ztbClient} ${client_header}
${unitPrice} Set Variable 1.66 #单价(公斤)
${plateNumber} Set Variable 粤M33333 #车牌号
${unitPrice} Evaluate round(random.uniform(${defaultUnitPrice},${highestUnitPrice}),2) random #单价(公斤)
${Number} Evaluate random.randint(00000,99999) random
${plateNumber} Set Variable 粤M${Number} #车牌号
${equipmentRemark} Set Variable NP-003 #设备
${ReceiptData} Set Variable { \ \ \ \ "productCategoryInfos":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productCategoryName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0 \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "predictDeliveryToFactoryTime":null, \ \ \ \ "factoryCustomerId":"${OffsiteCustomerId}", \ \ \ \ "factoryCustomerName":"${Offsitename}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "driverId":"${enterpriseMemberId}", \ \ \ \ "driverName":"${enterpriseMemberName}" }
${reps} POST On Session ztbf ztb-factory/create/scrap-paper-offsite-receipt-order ${ReceiptData.encode('utf-8')}
@ -25,8 +26,8 @@ OffsiteOrder
${reps} GET On Session ztbf ztb-factory/get/scrap-paper-offsite-receipt-order-detail params=id=${OffsiteOrderId}
${scrapPaperPurchaseOrderId} Get From Dictionary ${reps.json()['data']['productCategoryInfos'][0]} scrapPaperPurchaseOrderId #收货订单id
#提交订单
${offsiteTareWeight} Set Variable 500 #皮重(公斤)
${offsiteGrossWeight} Set Variable 1000 #毛重(公斤)
${offsiteTareWeight} Evaluate random.randint(200,500) random #皮重(公斤)
${offsiteGrossWeight} Evaluate random.randint(500,1500) random #毛重(公斤)
${netWeight} Evaluate ${offsiteGrossWeight}-${offsiteTareWeight}
${ReceiptWeight} Set Variable { \ \ \ \ "scrapPaperReceiptId":"${OffsiteOrderId}", \ \ \ \ "offsiteGrossWeight":"${offsiteGrossWeight}", \ \ \ \ "offsiteTareWeight":"${offsiteTareWeight}", \ \ \ \ "weightNoteList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "grossWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "tareWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "weightNoteImage":null, \ \ \ \ \ \ \ \ \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "scrapPaperPurchaseOrderId":"${scrapPaperPurchaseOrderId}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "orderImageList":[ \ \ \ \ \ \ \ \ "${Image}", \ \ \ \ \ \ \ \ "${Image}", \ \ \ \ \ \ \ \ "${Image}" \ \ \ \ ] }
${reps} POST On Session ztbf ztb-factory/submit/scrap-paper-offsite-receipt-weight-note ${ReceiptWeight.encode('utf-8')}

11
004-FactoryOutOrderManual/1-Client/FactoryOutbound.robot

@ -6,10 +6,11 @@ Library RequestsLibrary
OutboundOrder
#出货--手工单
Create Session ztbf ${ztbClient} ${client_header}
${netWeight} Set Variable 5000 #净重(公斤)
${unitPrice} Set Variable 2.02 #单价(元/公斤)
${netWeight} Evaluate random.randint(3500,9000) random #净重(公斤)
${unitPrice} Evaluate round(random.uniform(${defaultUnitPrice},${highestUnitPrice}),2) random #单价(元/公斤)
${konePrice} Evaluate ${defaultUnitPrice}*1000 #指导价格
${plateNumber} Set Variable 沪H22222 #车牌号
${Number} Evaluate random.randint(00000,99999) random
${plateNumber} Set Variable 沪H${Number} #车牌号
${estimatedAmount} Evaluate ${netWeight}*${unitPrice}
${OutData} Set Variable { \ \ \ \ "isHandworkOrder":1, \ \ \ \ "estimatedAmount":"${estimatedAmount}", \ \ \ \ "deliveryChannelType":1, \ \ \ \ "factoryDeliveryChannelId":"${ChannelId}", \ \ \ \ "consigneeName":"${ChannelName}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "productCategoryId":"${productcategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${konePrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0, \ \ \ \ \ \ \ \ \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":null, \ \ \ \ \ \ \ \ \ \ \ \ "estimatedAmount":"${estimatedAmount}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "weightNoteImageUrls":[ \ \ \ \ \ ] }
${reps} POST On Session ztbf ztb-factory/save/outbound-delivery-order ${OutData.encode('utf-8')}
@ -33,8 +34,8 @@ OutboundOrder
Exit For Loop If '${id}'=='${OrderId}'
END
#确认付款
${paperMillNetWeight} Set Variable 13 #纸厂净重(吨
${deductPercent} Set Variable 2.1 #扣点(%)
${paperMillNetWeight} Evaluate random.randint(10000,20000) random #纸厂净重(公斤
${deductPercent} Evaluate round(random.randint(2,10),2) random #扣点(%)
${settleWeight} Evaluate ${paperMillNetWeight}-${paperMillNetWeight}*${deductPercent}/1000 #结算重量(吨)
${PayData} Set Variable { \ \ \ \ "id":"${OrderId}", \ \ \ \ "categoryId":"${categoryId}", \ \ \ \ "otherFee":0, \ \ \ \ "subsidy":0, \ \ \ \ "proxyPaySurcharge":0, \ \ \ \ "freight":0, \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "settlementProductId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "id":"${productItemId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillNetWeight":"${paperMillNetWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":"${deductPercent}", \ \ \ \ \ \ \ \ \ \ \ \ "settleUnitPrice":"${unitPrice}" \ \ \ \ \ \ \ \ } \ \ \ \ ], \ \ \ \ "factoryId":"${factoryId}" }
${reps} POST On Session ztbf ztb-factory/confirm/outbound-delivery-order-receipt ${PayData.encode('utf-8')}

13
005-FactoryOutSwipe/1-Client/FactoryOutbound.robot

@ -7,7 +7,7 @@ OutboundDeviceOrder
#出货--刷卡单
#第一次刷卡过磅--皮重
Create Session ztbf ${ztbClient} ${client_header}
${OutFirstWeight} Set Variable 2000
${OutFirstWeight} Evaluate random.randint(500,3000) random
${OutFirstWeightData} Set Variable { \ \ \ \ "cardNo":"${OutCarNo}", \ \ \ \ "weight":"${OutFirstWeight}" }
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${OutFirstWeightData.encode('utf-8')}
${OutWeightId} Get From Dictionary ${reps.json()['data']} id #刷卡过磅id
@ -17,7 +17,7 @@ OutboundDeviceOrder
${reps} POST On Session ztbf /ztb-factory/binding/order-image ${OutFirstBinding.encode('utf-8')}
sleep 0.5
#第二次刷卡过磅--毛重
${OutSecondWeight} Set Variable 4520
${OutSecondWeight} Evaluate random.randint(3000,5000) random
${OutSecondWeightData} Set Variable { \ \ \ \ "cardNo":"${OutCarNo}", \ \ \ \ "weight":"${OutSecondWeight}" }
${reps} POST On Session ztbf ztb-factory/factory-customer/save/order ${OutSecondWeightData.encode('utf-8')}
Should Be Equal As Strings ${reps.json()['message']} 第二次过磅成功,${OutSecondWeight}公斤,请下地磅
@ -39,8 +39,9 @@ OutboundDeviceOrder
Exit For Loop If '${weightNoteId}'=='${OutWeightId}' #判断订单编号是否相等
END
#确认出货
${unitPrice} Set Variable 2.35 #出货品类单价
${plateNumber} Set Variable 川F66666 #出货车牌号
${unitPrice} Evaluate round(random.uniform(${defaultUnitPrice},${highestUnitPrice}),2) random #出货品类单价
${Number} Evaluate random.randint(00000,99999) random
${plateNumber} Set Variable 川F${Number} #出货车牌号
${estimatedAmount} Evaluate ${unitPrice}*${NetWeight} #预估金额(元)
${defaultUnitPrice} Set Variable ${defaultUnitPrice}*1000 #指导价格
${OutboundOrderData} Set Variable { \ \ \ \ "id":"${OutId}", \ \ \ \ "factoryId":"${factoryId}", \ \ \ \ "operaterId":null, \ \ \ \ "operaterName":null, \ \ \ \ "weightNoteId":"${weightNoteId}", \ \ \ \ "deliveryChannelType":1, \ \ \ \ "consigneeId":null, \ \ \ \ "consigneeName":"${ChannelName}", \ \ \ \ "productId":null, \ \ \ \ "productName":null, \ \ \ \ "packageQuantity":null, \ \ \ \ "status":"${status}", \ \ \ \ "plateNumber":"${plateNumber}", \ \ \ \ "driverName":null, \ \ \ \ "auditorName":null, \ \ \ \ "auditorId":null, \ \ \ \ "createTime":"${createTime}", \ \ \ \ "updadeTime":null, \ \ \ \ "agencySellOrderItemId":null, \ \ \ \ "unitPrice":null, \ \ \ \ "totalEstimatedAmount":0, \ \ \ \ "orderNumber":"${orderNumber}", \ \ \ \ "remark":null, \ \ \ \ "isHandworkOrder":0, \ \ \ \ "salesGuy":null, \ \ \ \ "receiptAddress":null, \ \ \ \ "roleName":null, \ \ \ \ "totalWeight":"${OutFirstWeight}", \ \ \ \ "netWeight":"${NetWeight}", \ \ \ \ "emptyWeight":"${OutSecondWeight}", \ \ \ \ "factoryDeliveryChannelId":"${ChannelId}", \ \ \ \ "estimatedAmount":"${estimatedAmount}", \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "productCategoryId":"${productcategoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0, \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":null, \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":null, \ \ \ \ \ \ \ \ \ \ \ \ "estimatedAmount":"${estimatedAmount}", \ \ \ \ \ \ \ \ \ \ \ \ "proportionOfProduct":100 \ \ \ \ \ \ \ \ } \ \ \ \ ] }
@ -57,8 +58,8 @@ OutboundDeviceOrder
Exit For Loop If '${id}'=='${OutId}'
END
#确认付款
${paperMillNetWeight} Set Variable 10 #纸厂净重(吨)
${deductPercent} Set Variable 2 #扣点(%)
${paperMillNetWeight} Evaluate random.randint(10000,20000) random #纸厂净重(吨)
${deductPercent} Evaluate round(random.randint(2,10),2) random #扣点(%)
${settleWeight} Evaluate ${paperMillNetWeight}-${paperMillNetWeight}*${deductPercent}/1000 #结算重量(吨)
${OutPayData} Set Variable { \ \ \ \ "id":"${OutId}", \ \ \ \ "categoryId":"${categoryId}", \ \ \ \ "outboundDeliveryOrderProductItemList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "settlementProductId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "id":"${productItemId}", \ \ \ \ \ \ \ \ \ \ \ \ "paperMillNetWeight":"${paperMillNetWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "deductPercent":"${deductPercent}", \ \ \ \ \ \ \ \ \ \ \ \ "settleUnitPrice":"${unitPrice}" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${reps} POST On Session ztbf ztb-factory/confirm/outbound-delivery-order-receipt ${OutPayData.encode('utf-8')}

6
RF-test/Client/1-FactoryReceipt.robot

@ -6,9 +6,9 @@ Library RequestsLibrary
ReceiptOrder
#创建厂内收货订单--手工单
Create Session ztbf ${ztbClient} ${client_header}
${unitPrice} Set Variable 2
${netWeight} Set Variable 10000
${settleWeight} Set Variable 5000
${unitPrice} Evaluate round(random.uniform(${defaultUnitPrice},${highestUnitPrice}),2) random
${netWeight} Evaluate random.randint(6000,10000) random
${settleWeight} Set Variable ${netWeight}
${settlePrice} Evaluate ${unitPrice}*${settleWeight}
${data} Set Variable { \ \ \ \ "deductType":1, \ \ \ \ "isWithoutTare":0, \ \ \ \ "status":null, \ \ \ \ "factoryCustomerId":"${CustomerId}", \ \ \ \ "factoryCustomerName":"${name}", \ \ \ \ "netWeight":"${netWeight}", \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ "plateNumber":"55555", \ \ \ \ "productInfoList":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "productId":"${categoryId}", \ \ \ \ \ \ \ \ \ \ \ \ "productName":"${categoryName}", \ \ \ \ \ \ \ \ \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "konePrice":"指导价格:${defaultUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "highestUnitPrice":"${highestUnitPrice}", \ \ \ \ \ \ \ \ \ \ \ \ "lowestUnitPrice":0, \ \ \ \ \ \ \ \ \ \ \ \ "settleWeight":"${settleWeight}", \ \ \ \ \ \ \ \ \ \ \ \ "settlePrice":"${settlePrice}" \ \ \ \ \ \ \ \ } \ \ \ \ ] }
${reps} POST On Session ztbf ztb-factory/save/scrap-paper-onside-receipt-order ${data.encode('utf-8')}

Loading…
Cancel
Save