|
|
|
@ -59,7 +59,12 @@ class EcloudController < ApplicationController
|
|
|
|
|
ecloud = Ecloud.create!(eloud_params)
|
|
|
|
|
create_service(params['services'], ecloud.try(:id))
|
|
|
|
|
create_product_params(params['productparas'], ecloud.try(:id)) if params['productparas'].present?
|
|
|
|
|
# REDO为管理员添加一条记录
|
|
|
|
|
# 为管理员添加一条记录
|
|
|
|
|
# 开通的时候都是用户的opttype也是0
|
|
|
|
|
EcloudUser.create!(custid: params['custid'], opttype: params['opttype'], userid: params['userid'],
|
|
|
|
|
username: params['username'], useralias: params['useralias'],
|
|
|
|
|
mobile: params['mobile'], email: params['email'], begintime: params['begintime'],
|
|
|
|
|
endtime: params['endtime'])
|
|
|
|
|
elsif params['opttype'] == 2 # 试用转商用 # 变更企业/个人业务
|
|
|
|
|
# 业务列表:注销业务(注销试用的套餐),另一个业务项的操作代码是:新增业务(开通商用的套餐)
|
|
|
|
|
# 需要通过产品服务编号和业务编码来区分哪个产品
|
|
|
|
@ -76,6 +81,7 @@ class EcloudController < ApplicationController
|
|
|
|
|
# 新增业务
|
|
|
|
|
add_service = params['services'].select{|s| s['opttype'] == 0}
|
|
|
|
|
create_service(add_service, ecloud.try(:id))
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
elsif params['opttype'] == 1 # 业务变更
|
|
|
|
|
ecloud = Ecloud.where(custid: params['custid'], custcode: params['custcode'], productcode: params['productcode']).first
|
|
|
|
|