educode_sales 0.9.21 → 0.9.23

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
  SHA256:
3
- metadata.gz: 1a49e1fe26099afa0e25a1542fe775e0433f635c3573e4f05c6ea6f3668446d5
4
- data.tar.gz: 9a461d3ec11c8edf2e6a2a0ff5af5935e97e49f7604203cdaf1bdcc3f5e22ad8
3
+ metadata.gz: c58fda9ebef8022559880649de7e90de9c0b5537ccab09a2bdf1900bea0373a1
4
+ data.tar.gz: cea666fa1f5c0939b3ad387cf023faf9a27169495d607ce32918208c0562f326
5
5
  SHA512:
6
- metadata.gz: 535bb72b0065d1fab5ebc6e7aef7d439f8ebdc6511ad9b15fbaf464404c043d937ccb6155e171f935d5e08b5431514e1aeb2f068e96736704616a5b0c06f9ca6
7
- data.tar.gz: 8b31c2724ce9fe79f94cd1f8a0ce91045b0833ec2524476037827587fbc708c7507886c46b76511885c425906de6c84cc1219c1b965d68d3413a01a59db32912
6
+ metadata.gz: '0905e5bc74bb514316f7e053e54768ae633f42591929d627033acab86bdc180ad7c660b1df276104be4f99fda43d9d21f37c58170b973a22e65e9285077e681a'
7
+ data.tar.gz: 489498f262416a5a5ce3eed6327796116d705299eac68a08600d0ab6b2a3bfcfbe708214a921c3aa7cc6f1cf383ea11f7d69df774d7a3581d4ce6db97150f43b
@@ -102,6 +102,7 @@ module EducodeSales
102
102
  @business.update(last_follow_up_id: follow_up.id)
103
103
  # 增加o商机编号
104
104
  add_business_number
105
+ update_department
105
106
  render_success
106
107
  else
107
108
  render_failure follow_up
@@ -140,6 +141,7 @@ module EducodeSales
140
141
  # 增加o类商机
141
142
  @business = follow_up.business
142
143
  add_business_number
144
+ update_department
143
145
  render_success
144
146
  else
145
147
  render_failure follow_up
@@ -258,6 +260,21 @@ module EducodeSales
258
260
  params.permit(:clazz_id, :stage_id, :invitation_at, :reception_at, :total_amount, :actual_amount, :divide_amount, :divide_rate, :budget_amount, :description, :advise, :place_id, :bidded_date, :signed_date, :year, :o_business_deployment)
259
261
  end
260
262
 
263
+ # 更新部门和部门下老师用户的状态
264
+ def update_department
265
+ clazz = %w[已中标 已签单 已验收 回款中 服务中]
266
+ name = @business.last_follow_up&.stage&.name
267
+ Rails.logger.debug("调试======#{clazz.include?(name)}")
268
+ if clazz.include?(name)
269
+ department = @business.department
270
+ if department
271
+ department.level = 2
272
+ department.save!
273
+ UserExtension.where(department_id:@business.department_id,identity:0).update_all(level:2)
274
+ end
275
+ end
276
+ end
277
+
261
278
  def teacher_params
262
279
  params.permit(:professional_title, :job, :attitude_id, :sex, :birth_date, :remark, :tel)
263
280
  end
@@ -2,7 +2,6 @@ require_dependency "educode_sales/application_controller"
2
2
 
3
3
  module EducodeSales
4
4
  class StaffsController < ApplicationController
5
-
6
5
  def index
7
6
  respond_to do |format|
8
7
  format.html do
@@ -35,7 +34,9 @@ module EducodeSales
35
34
  def create
36
35
  user = User.find(params[:id])
37
36
  staff = Staff.new(user_id: user.id)
37
+ params[:current_admin] = @current_admin.id
38
38
  if staff.save
39
+ impressionist(staff, params)
39
40
  render_success
40
41
  else
41
42
  render_failure staff
@@ -60,6 +61,8 @@ module EducodeSales
60
61
 
61
62
  def destroy
62
63
  staff = Staff.find(params[:id])
64
+ params[:current_admin] = @current_admin.id
65
+ impressionist(staff, params)
63
66
  staff.update(deleted_at: Time.now, expired_at: Time.now.days_ago(1))
64
67
  render_success
65
68
  # rescue ActiveRecord::DeleteRestrictionError => e
@@ -68,6 +71,8 @@ module EducodeSales
68
71
 
69
72
  def disable
70
73
  staff = Staff.find(params[:id])
74
+ params[:current_admin] = @current_admin.id
75
+ impressionist(staff, params)
71
76
  staff.update(expired_at: Time.now.days_ago(1))
72
77
  render_success
73
78
  end
@@ -89,6 +94,8 @@ module EducodeSales
89
94
  else
90
95
  staff.staff_schools.destroy_all
91
96
  end
97
+ params[:current_admin] = @current_admin.id
98
+ impressionist(staff, params)
92
99
  if staff.save
93
100
  render_success
94
101
  else
@@ -3,6 +3,8 @@ module EducodeSales
3
3
  belongs_to :user
4
4
  belongs_to :role, optional: true
5
5
 
6
+ is_impressionable
7
+
6
8
  has_many :follow_ups, dependent: :destroy
7
9
  has_many :operation_plans, dependent: :destroy
8
10
  has_many :operation_reports, dependent: :destroy
@@ -26,7 +26,7 @@ json.data do
26
26
 
27
27
  json.divide_rate d.divide_rate
28
28
  json.divide_money d.divide_amount
29
- json.budget_money d.budget_amount
29
+ json.budget_amount d.budget_amount
30
30
  json.area d.department.school.province
31
31
  school_property = d.department.school.school_property
32
32
  property = []
@@ -404,11 +404,11 @@
404
404
  hide: gon.filter.o_business_deployment
405
405
  },
406
406
  {
407
- field: 'budget_money',
407
+ field: 'budget_amount',
408
408
  width: 105,
409
409
  title: '预算金额',
410
410
  sort: true,
411
- hide: gon.filter.budget_money
411
+ hide: gon.filter.budget_amount
412
412
  },
413
413
  {
414
414
  field: 'total_amount',
@@ -28,7 +28,7 @@ json.data do
28
28
  end
29
29
  json.divide_rate d.divide_rate
30
30
  json.divide_money d.divide_amount
31
- json.budget_money d.budget_amount #d.follow_ups.where(stage_id: @budget_stage_ids).order("created_at desc").first&.total_amount&.round(2) || 0
31
+ json.budget_amount d.budget_amount #d.follow_ups.where(stage_id: @budget_stage_ids).order("created_at desc").first&.total_amount&.round(2) || 0
32
32
  json.area d.department.school.province
33
33
  school_property = d.department.school.school_property
34
34
  property = []
@@ -1,3 +1,3 @@
1
1
  module EducodeSales
2
- VERSION = '0.9.21'
2
+ VERSION = '0.9.23'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: educode_sales
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.21
4
+ version: 0.9.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - anke1460
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-17 00:00:00.000000000 Z
11
+ date: 2022-12-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -105,6 +105,7 @@ files:
105
105
  - app/assets/images/educode_sales/icon-login.png
106
106
  - app/assets/images/educode_sales/icon.png
107
107
  - app/assets/images/educode_sales/indexLogo.png
108
+ - app/assets/images/educode_sales/indexlogo.png
108
109
  - app/assets/images/educode_sales/loading-0.gif
109
110
  - app/assets/images/educode_sales/loading-1.gif
110
111
  - app/assets/images/educode_sales/loading-2.gif
@@ -488,7 +489,7 @@ homepage: https://www.educoder.net
488
489
  licenses:
489
490
  - MIT
490
491
  metadata: {}
491
- post_install_message:
492
+ post_install_message:
492
493
  rdoc_options: []
493
494
  require_paths:
494
495
  - lib
@@ -503,8 +504,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
503
504
  - !ruby/object:Gem::Version
504
505
  version: '0'
505
506
  requirements: []
506
- rubygems_version: 3.0.0
507
- signing_key:
507
+ rubygems_version: 3.0.9
508
+ signing_key:
508
509
  specification_version: 4
509
510
  summary: Summary of EducodeSales.
510
511
  test_files: []