|
|
|
@ -7,10 +7,10 @@ class EcloudController < ApplicationController
|
|
|
|
|
|
|
|
|
|
# before_filter :check_sign
|
|
|
|
|
before_filter :user_setup
|
|
|
|
|
before_filter :require_login, only: [:authorize]
|
|
|
|
|
# before_filter :require_login, only: [:authorize]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
skip_before_filter :verify_authenticity_token, only: [:ps_new, :ps_edit, :ecloud_login_callback]
|
|
|
|
|
skip_before_filter :verify_authenticity_token, only: [:ps_new, :ps_update, :bs_new, :bs_update, :ecloud_login_callback]
|
|
|
|
|
|
|
|
|
|
def index
|
|
|
|
|
|
|
|
|
@ -65,8 +65,9 @@ class EcloudController < ApplicationController
|
|
|
|
|
ecloud.update_attributes!(applyno: params['applyno'], ecordercode: params['ecordercode'], opttype: params['opttype'],
|
|
|
|
|
custid: params['custid'], custcode: params['custcode'], productcode: params['productcode'],
|
|
|
|
|
operatime: params['operatime'], effecttime: params['effecttime'])
|
|
|
|
|
services = params['ervices'].first
|
|
|
|
|
ecloud.ecloud_services.update_attributes!(packagecode: services['packagecode'], bossorderid: services['bossorderid'])
|
|
|
|
|
services = params['services'].first
|
|
|
|
|
ecloud.ecloud_service.update_attributes!(packagecode: services['packagecode'], bossorderid: services['bossorderid'])
|
|
|
|
|
render :json => {result: true, errmsg: ""}
|
|
|
|
|
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
logger.error(e.message)
|
|
|
|
@ -79,15 +80,15 @@ class EcloudController < ApplicationController
|
|
|
|
|
# 用户业务开通接口
|
|
|
|
|
def ps_new
|
|
|
|
|
begin
|
|
|
|
|
logger.info("11111######params")
|
|
|
|
|
ecloud_user = EcloudUser.where(:custid => params['custid'], :user_id => params['users']['userid']).first
|
|
|
|
|
user_param = params['users'].first
|
|
|
|
|
ecloud_user = EcloudUser.where(:custid => params['custid'], :userid => user_param['userid']).first
|
|
|
|
|
if ecloud_user.present?
|
|
|
|
|
render :json => {code: 501, msg: "你已开通过该业务"}
|
|
|
|
|
render :json => {code: 500, msg: "你已开通过该业务"}
|
|
|
|
|
else
|
|
|
|
|
EcloudUser.create!(custid: params['custid'], opttype: params['users']['opttype'], userid: params['users']['userid'],
|
|
|
|
|
username: params['users']['username'], useralias: params['users']['useralias'],
|
|
|
|
|
mobile: params['users']['mobile'], email: params['users']['email'], begintime: params['users']['begintime'].to_s,
|
|
|
|
|
endtime: params['users']['endtime'].to_s)
|
|
|
|
|
EcloudUser.create!(custid: params['custid'], opttype: user_param['opttype'], userid: user_param['userid'],
|
|
|
|
|
username: user_param['username'], useralias: user_param['useralias'],
|
|
|
|
|
mobile: user_param['mobile'], email: user_param['email'], begintime: user_param['begintime'].to_s,
|
|
|
|
|
endtime: user_param['endtime'].to_s)
|
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
|
end
|
|
|
|
|
rescue Exception => e
|
|
|
|
@ -99,12 +100,13 @@ class EcloudController < ApplicationController
|
|
|
|
|
# 用户业务变更、销毁接口
|
|
|
|
|
def ps_update
|
|
|
|
|
begin
|
|
|
|
|
ecloud_user = EcloudUser.where(:custid => params['custid'], :user_id => params['users']['userid']).first
|
|
|
|
|
user_param = params['users'].first
|
|
|
|
|
ecloud_user = EcloudUser.where(:custid => params['custid'], :userid => user_param['userid']).first
|
|
|
|
|
if ecloud_user.present?
|
|
|
|
|
ecloud_user.update_attributes(opttype: params['users']['opttype'])
|
|
|
|
|
render :json => {code: 501, msg: "你已开通过该业务"}
|
|
|
|
|
ecloud_user.update_attributes(opttype: user_param['opttype'])
|
|
|
|
|
render :json => {success: true, errmsg: ""}
|
|
|
|
|
else
|
|
|
|
|
render :json => {code: 404, errmsg: ""}
|
|
|
|
|
render :json => {code: 404, msg: "企业ID不存在"}
|
|
|
|
|
end
|
|
|
|
|
rescue Exception => e
|
|
|
|
|
logger.error(e.message)
|
|
|
|
|