blsm-vd-core 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c8d161c0b8e6fac2d8ae793f4703c6e2669841ae
4
- data.tar.gz: 998f0655c0e0735d9f607e753742aa979c477a97
3
+ metadata.gz: 873645212537fb5c7da204cf71ad878828fdd52f
4
+ data.tar.gz: ad5daf69a9d2f9a593f022d135527f27daa4318f
5
5
  SHA512:
6
- metadata.gz: 13a6df8872910aff61e248fd72a5bd2da01f217e7f7cf1a05a20d8bd96b93458d743233aea4cfa5315de4902f6b49b109c2be7c7a49bbf5ebfed4eba333964d4
7
- data.tar.gz: 674a4bae04f183559d5b6137643e19e0d9742b84c5605037b6b7bb3dcb4425745bddd16a4d0e70d5aa5967532561770f1f5e922a655bcc3d2d553315d3bcc877
6
+ metadata.gz: ae58f7927c467d40a82d73db7c9da7e9e74aba811cd83b41bfedc630d9997682dac4680da68b352c8dfbd17d77066600c4b2d1cb47abb64e4eddf3ef35f0b53b
7
+ data.tar.gz: eb4853163bed3b252e94c8d8f10fad745023f7ae4382b80863d8a75b3f142946edd6dddcd67da584eb59825bdfc249d59add40febf4459b870a35e9fc69d67b8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- blsm-vd-core (0.2.0)
4
+ blsm-vd-core (0.2.1)
5
5
 
6
6
  GEM
7
7
  remote: https://ruby.taobao.org/
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
3
  require "bundler/setup"
4
- require "blsm/vd/core"
4
+ require "blsm-vd-core"
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
data/blsm-vd-core.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
23
23
  end
24
24
 
25
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
25
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features|config|build.rb)/}) }
26
26
  spec.bindir = "exe"
27
27
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
28
28
  spec.require_paths = ["lib"]
data/lib/blsm-vd-core.rb CHANGED
@@ -43,9 +43,11 @@ module BlsmVdCore
43
43
  module_function
44
44
 
45
45
  #当订单状态发生变化时,调用此方法
46
+ # 包含:订单被发出去 +order_sale_out+
47
+ # 创建结算项 +create_clearing_item+
46
48
  #==== Parameters
47
49
  # * +order_id+ - 订单id
48
- def order_state_change(order_id)
50
+ def on_order_state_change(order_id)
49
51
  order = Order.where(id: order_id).first
50
52
  clearing_item = ClearingItem.where(order_id: order.id).first if order
51
53
 
@@ -58,6 +60,11 @@ module BlsmVdCore
58
60
  return create_clearing_item(order_id)
59
61
  end
60
62
 
63
+ #已发货,准备收货=>订单被售卖出去
64
+ if order.state.to_s.include?('已发货,准备收货')
65
+ return on_order_sale_out(order.application.user_id, order_id) if order.application
66
+ end
67
+
61
68
  #订单被取消=>删除结算项
62
69
  if order.state.to_s.include?('订单取消')
63
70
  order.clearing_items.each { |item|
@@ -79,7 +86,7 @@ module BlsmVdCore
79
86
  #==== Parameters
80
87
  # * +order_id+ - 订单id
81
88
  # * +sign_type+ - 签收状态:ENUM('sign_ok','sign_fail')
82
- def order_sign_handle(order_id, sign_type)
89
+ def on_order_signed(order_id, sign_type)
83
90
  order = Order.where(id: order_id).first
84
91
  clearing_item = ClearingItem.where(order_id: order.id).first if order
85
92
 
@@ -192,7 +199,7 @@ module BlsmVdCore
192
199
  #==== Parameters
193
200
  # * +seller_id+ - 销售员的id
194
201
  # * +order_id+ - 订单id
195
- def order_sale_out(seller_id, order_id)
202
+ def on_order_sale_out(seller_id, order_id)
196
203
  seller = User.where(id: seller_id).first
197
204
  leader = User.where("id in(select supervisor_id from vd_user_infos where user_id=#{seller_id})").first
198
205
  order = Order.where(id: order_id).first
@@ -1,3 +1,3 @@
1
1
  module BlsmVdCore
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: blsm-vd-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - saxer
@@ -152,9 +152,6 @@ files:
152
152
  - bin/console
153
153
  - bin/setup
154
154
  - blsm-vd-core.gemspec
155
- - build.py
156
- - build.rb
157
- - config/database.yml
158
155
  - lib/blsm-vd-core.rb
159
156
  - lib/blsm-vd-core/model/active_record.rb
160
157
  - lib/blsm-vd-core/model/application.rb
data/build.py DELETED
@@ -1,7 +0,0 @@
1
- import os
2
- import sys
3
-
4
- os.system("mv config/database.yml spec/")
5
- os.system("touch config/database.yml")
6
- os.system("gem build blsm-vd-core.gemspec")
7
- os.system("mv spec/database.yml config/")
data/build.rb DELETED
@@ -1,4 +0,0 @@
1
- system("mv config/database.yml spec/")
2
- system("touch config/database.yml")
3
- system("gem build blsm-vd-core.gemspec")
4
- system("mv spec/database.yml config/")
data/config/database.yml DELETED
File without changes