BlsmVdCore

首趣微店核心模块,包含了结算项的创建、结算项更新、物流返款、拒签等。依赖于正式环境数据库。

包含的model

Application
Clearing        #结算单
ClearingItem    #结算项
LineItem
Order
Product
ProductProp
User
VdInfoSec       #安全信息库,做唯一性校验
VdUserInfo      #用户详情(积分、销售额、分销额等)
VdUserScore     #积分历史等

依赖的gem

gem 'blsm-mp-wx'

Installation

Add this line to your application's Gemfile:

gem 'blsm-vd-core'

And then execute:

$ bundle

Or install it yourself as:

$ gem install blsm-vd-core

用法

订单状态改变时

介绍

当订单状态发生改变时,调用此方法,包含“订单发出”、“订单取消”、“创建结算项”等

用法

    r = BlsmVdCore.on_order_state_change(394298)
    puts "#{r[:code].to_s}\n"
    #=> 200

订单发出时(慎用此方法)

介绍

当订单状态发生改变时,调用此方法

用法

    r = BlsmVdCore.on_order_sale_out(181,394298)
    puts "#{r[:code].to_s}\n"
    #=> 200

订单取消时(慎用此方法)

介绍

当订单状态发生改变时,调用此方法

用法

    r = BlsmVdCore.on_order_canceled(181,394298)
    puts "#{r[:code].to_s}\n"
    #=> 200

物流返款/拒签

介绍

当订单状态发生改变时,调用此方法

用法

    r = BlsmVdCore.on_order_signed(394298,'sign_ok')
    puts "#{r[:code].to_s}\n"
    #=> 200

创建结算项(慎重调用此方法)

介绍

当订单状态发生改变时,调用此方法

用法

    r = BlsmVdCore.create_clearing_item(394298)
    puts "#{r[:code].to_s}\n"
    #=> 200

Development

After checking out the repo, run bin/setup to install dependencies. Then, run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release to create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

  1. Fork it ( https://github.com/[my-github-username]/blsm-vd-core/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request