blsm-vd-core 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/bin/console +1 -1
- data/blsm-vd-core.gemspec +1 -1
- data/lib/blsm-vd-core.rb +10 -3
- data/lib/blsm-vd-core/version.rb +1 -1
- metadata +1 -4
- data/build.py +0 -7
- data/build.rb +0 -4
- data/config/database.yml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 873645212537fb5c7da204cf71ad878828fdd52f
|
4
|
+
data.tar.gz: ad5daf69a9d2f9a593f022d135527f27daa4318f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ae58f7927c467d40a82d73db7c9da7e9e74aba811cd83b41bfedc630d9997682dac4680da68b352c8dfbd17d77066600c4b2d1cb47abb64e4eddf3ef35f0b53b
|
7
|
+
data.tar.gz: eb4853163bed3b252e94c8d8f10fad745023f7ae4382b80863d8a75b3f142946edd6dddcd67da584eb59825bdfc249d59add40febf4459b870a35e9fc69d67b8
|
data/Gemfile.lock
CHANGED
data/bin/console
CHANGED
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
|
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
|
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
|
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
|
data/lib/blsm-vd-core/version.rb
CHANGED
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.
|
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
data/build.rb
DELETED
data/config/database.yml
DELETED
File without changes
|