Beispiel #1
0
    def create(self,
               order_id,
               regionid,
               customer_address,
               customer_name,
               customer_mobile,
               mchnt_address,
               mchnt_name,
               mchnt_mobile,
               order_time,
               limit_time,
               order_type=1):
        """
        创建配送单
        :param order_id:订单id
        :param order_type:订单类型,1:普通订单, 2:内测订单, 选传(默认为1)
        :param regionid:商圈ID
        :param customer_address:客户地址
        :param customer_name:客户名
        :param customer_mobile:客户手机号码
        :param mchnt_address:商家地址
        :param mchnt_name:商家名称
        :param mchnt_mobile:商家号码
        :param order_time:下单时间
        :param limit_time:送达时间
        :return:
        """
        data = Storage()
        data.orderid = order_id
        data.type = order_type
        data.regionid = regionid
        data.customer_address = customer_address
        data.customer_name = customer_name
        data.customer_mobile = customer_mobile
        data.mchnt_address = mchnt_address
        data.mchnt_name = mchnt_name
        data.mchnt_mobile = mchnt_mobile
        data.order_time = order_time
        data.limit_time = limit_time
        data.goods_info = json.dumps(self.goods)
        data.app_code = self.app_code
        data.sign = self._gen_sign(data)

        url = 'http://{host}:{port}/marathon/disorder/create'.format(
            host=self.host, port=self.port)
        resp = requests.post(url, data=data, timeout=self.timeout)
        if resp.status_code != 200:
            return {"respcd": resp.status_code}
        ret = json.loads(resp.text)
        return ret
Beispiel #2
0
    def create(self, order_id, regionid, customer_address, customer_name, customer_mobile,
               mchnt_address, mchnt_name, mchnt_mobile, order_time, limit_time, order_type=1):
        """
        创建配送单
        :param order_id:订单id
        :param order_type:订单类型,1:普通订单, 2:内测订单, 选传(默认为1)
        :param regionid:商圈ID
        :param customer_address:客户地址
        :param customer_name:客户名
        :param customer_mobile:客户手机号码
        :param mchnt_address:商家地址
        :param mchnt_name:商家名称
        :param mchnt_mobile:商家号码
        :param order_time:下单时间
        :param limit_time:送达时间
        :return:
        """
        data = Storage()
        data.orderid = order_id
        data.type = order_type
        data.regionid = regionid
        data.customer_address = customer_address
        data.customer_name = customer_name
        data.customer_mobile = customer_mobile
        data.mchnt_address = mchnt_address
        data.mchnt_name = mchnt_name
        data.mchnt_mobile = mchnt_mobile
        data.order_time = order_time
        data.limit_time = limit_time
        data.goods_info = json.dumps(self.goods)
        data.app_code = self.app_code
        data.sign = self._gen_sign(data)

        url = 'http://{host}:{port}/marathon/disorder/create'.format(host=self.host, port=self.port)
        resp = requests.post(url, data=data, timeout=self.timeout)
        if resp.status_code != 200:
            return {"respcd": resp.status_code}
        ret = json.loads(resp.text)
        return ret