|
@@ -243,27 +243,12 @@ var cloudService={
|
|
|
|
|
|
//最后使用
|
|
|
userData['userInfo']['latest_usedName']='';
|
|
|
-// for(var ci=0;ci<compilationList.length;ci++){
|
|
|
-// if(compilationList[ci]._id==v.latest_used){
|
|
|
-// userData['userInfo']['latest_usedName']=compilationList[ci].name;
|
|
|
-// break;
|
|
|
-// }
|
|
|
-// }
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
//本地养护用户
|
|
|
userData['curingInfo']=await models.cloud_curing.getCuringBySsoid(ssoid);
|
|
|
client_id=userData['curingInfo']['client_id'];
|
|
|
|
|
|
- /*userData['clientInfo']='';
|
|
|
- if(!hash.isNotANumber(client_id)){
|
|
|
- client_id=hash.hashDecode(client_id);
|
|
|
- if(!hash.isNotANumber(client_id)){
|
|
|
- userData['clientInfo']=[];
|
|
|
- }
|
|
|
- }*/
|
|
|
-
|
|
|
var detail =[];
|
|
|
if(hash.isExistence(client_id)){
|
|
|
detail = await models.CLD_client.findById(client_id);
|
|
@@ -286,63 +271,18 @@ var cloudService={
|
|
|
});
|
|
|
userData['userInfo']['ssoIdKey']=hash.hashEncode(userData['userInfo']['ssoId'].toString());
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//获得操作日志
|
|
|
userData['operateLog']=[];
|
|
|
if(hash.isExistence(userData['curingInfo'])){
|
|
|
userData['operateLog']=await models.operate_log.findByCondition(1,hash.hashDecode(userData['curingInfo']['id']));
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
return userData;
|
|
|
},
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
- * 获得本地编办列表--废弃
|
|
|
+ * 用户升级专业版
|
|
|
*/
|
|
|
- getCuringCompilationList:async function (){
|
|
|
- var compilationList = await models.cloud_curing.getCuringCompilationList();
|
|
|
- return compilationList;
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- //获取本地养护数据--可能废弃
|
|
|
- getBindCuringByMobile:async function (mobile){
|
|
|
- var curingList = await models.cloud_curing.getCuringByMobile(mobile);
|
|
|
- if (curingList!=null){
|
|
|
- var cid=[curingList['client_id']];
|
|
|
- var attributes= ['cid', 'clientname', 'companyid', 'companyname'];
|
|
|
- var clientList = await models.CLD_client.findAllInCid(cid,attributes);
|
|
|
- curingList.clientInfo={};
|
|
|
- clientList.forEach(function(clientVal,clientI){
|
|
|
- if(curingList.client_id==clientVal.cid){
|
|
|
- curingList.clientInfo=clientVal;
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
- curingList.addtime=moment.unix(curingList.addtime).format('YYYY-MM-DD HH:mm');
|
|
|
- }
|
|
|
- return curingList;
|
|
|
- },
|
|
|
-
|
|
|
- //根据手机号码获得养护用户信息--可能废弃
|
|
|
- getCuringByMobile: async function(mobile){
|
|
|
- var url= curingUrl+'/getUsersAndCompilation?mobile='+ mobile;
|
|
|
- var userData= await curlRequest(url);
|
|
|
- return userData;
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
upCuringDo: async function(data){
|
|
|
var url = curingUrl+'/setUserUpgrade';
|
|
|
var ssoid=hash.hashDecode(data.ssoid);
|
|
@@ -379,11 +319,11 @@ var cloudService={
|
|
|
mobile: data.mobile,
|
|
|
sso_id: data.ssoid,
|
|
|
compilation_id: data.compilationId,
|
|
|
- curingCompany: data.name,
|
|
|
+ //curingCompany: data.name,
|
|
|
sid: sid,
|
|
|
cid: STAFF.cid,
|
|
|
status: 1,
|
|
|
- addtime: new Date().getTime(),
|
|
|
+ //addtime: new Date().getTime(),
|
|
|
updateTotal: 1
|
|
|
};
|
|
|
var detail=await models.cloud_curing.create(obj);
|
|
@@ -400,16 +340,18 @@ var cloudService={
|
|
|
}
|
|
|
},
|
|
|
|
|
|
- //养护用户绑定CLD客户
|
|
|
+ /**
|
|
|
+ * 用户关联CLD客户
|
|
|
+ */
|
|
|
relevanceClientDo: async function(data){
|
|
|
|
|
|
var cid=hash.hashDecode(data.cidKey);
|
|
|
- var id=hash.hashDecode(data.id);
|
|
|
- if(!hash.isNotANumber(cid)||!hash.isNotANumber(id)){
|
|
|
+ var ssoId=hash.hashDecode(data.ssoId);
|
|
|
+ if(!hash.isNotANumber(cid)||!hash.isNotANumber(ssoId)){
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- var curingDetail=await models.cloud_curing.getCuringById(id);
|
|
|
+//修改
|
|
|
+ var curingDetail=await models.cloud_curing.getCuringBySsoid(ssoId);
|
|
|
if(hash.isExistence(curingDetail)) {
|
|
|
|
|
|
var clientDetail=await models.CLD_client.findById(cid);
|
|
@@ -434,6 +376,49 @@ var cloudService={
|
|
|
return false;
|
|
|
}
|
|
|
},
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获得本地编办列表--废弃
|
|
|
+ */
|
|
|
+ getCuringCompilationList:async function (){
|
|
|
+ var compilationList = await models.cloud_curing.getCuringCompilationList();
|
|
|
+ return compilationList;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ //获取本地养护数据--可能废弃
|
|
|
+ getBindCuringByMobile:async function (mobile){
|
|
|
+ var curingList = await models.cloud_curing.getCuringByMobile(mobile);
|
|
|
+ if (curingList!=null){
|
|
|
+ var cid=[curingList['client_id']];
|
|
|
+ var attributes= ['cid', 'clientname', 'companyid', 'companyname'];
|
|
|
+ var clientList = await models.CLD_client.findAllInCid(cid,attributes);
|
|
|
+ curingList.clientInfo={};
|
|
|
+ clientList.forEach(function(clientVal,clientI){
|
|
|
+ if(curingList.client_id==clientVal.cid){
|
|
|
+ curingList.clientInfo=clientVal;
|
|
|
+
|
|
|
+ }
|
|
|
+ });
|
|
|
+ curingList.addtime=moment.unix(curingList.addtime).format('YYYY-MM-DD HH:mm');
|
|
|
+ }
|
|
|
+ return curingList;
|
|
|
+ },
|
|
|
+
|
|
|
+ //根据手机号码获得养护用户信息--可能废弃
|
|
|
+ getCuringByMobile: async function(mobile){
|
|
|
+ var url= curingUrl+'/getUsersAndCompilation?mobile='+ mobile;
|
|
|
+ var userData= await curlRequest(url);
|
|
|
+ return userData;
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//移除关联CLD客户
|
|
|
relieveClientDo: async function(data){
|
|
|
|