纸通宝工厂版
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

41 lines
4.2 KiB

*** Settings ***
Library Collections
Library RequestsLibrary
*** Test Cases ***
OutboundOrder
#出货--手工单
Create Session ztbf ${ztbClient} ${client_header}
${netWeight} Evaluate random.randint(3500,9000) random #净重(公斤)
${unitPrice} Evaluate round(random.uniform(${defaultUnitPrice},${highestUnitPrice}),2) random #单价(元/公斤)
${konePrice} Evaluate ${defaultUnitPrice}*1000 #指导价格
${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')}
#待审核列表
${reps} GET On Session ztbf ztb-factory/get/outbound-delivery-order-list params=pageNum=1&pageSize=15&status=0
${weightNoteList} Get From Dictionary ${reps.json()['data']} records #待审核列表
FOR ${items} IN @{weightNoteList}
${OrderId} Get From Dictionary ${items} id #出货订单id
${productId} Get From Dictionary ${items} productId #纸品id
Exit For Loop If '${productId}'=='${categoryId}'
END
#磅单审核通过
${auditData} Set Variable {"id":"${OrderId}","auditStatus":1}
${reps} POST On Session ztbf ztb-factory/audit/outbount-delivery-order ${auditData.encode('utf-8')}
#待付款列表
${reps} GET On Session ztbf ztb-factory/get/outbound-delivery-order-list params=pageNum=1&pageSize=15&status=1
${deliveryList} Get From Dictionary ${reps.json()['data']} records
FOR ${items} IN @{deliveryList}
${id} Get From Dictionary ${items} id #订单编号
${productItemId} Get From Dictionary ${items['productItemList'][0]} id #订单项编号
Exit For Loop If '${id}'=='${OrderId}'
END
#确认付款
${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')}