Commit 3fbdeffd by 王勇飞

gyq

parent 511ad00b
......@@ -41,8 +41,8 @@ class BizOptCtl extends CtlBase {
robj.business_type = element.business_type;//商机类型
robj.business_info_person = element.business_info.contactsName;//联系人
robj.v_coname = element.v_coname;//联系人-shousuo
robj.business_info_phone = await system.decryptStr(element.business_info.contactsPhone);//联系电话
robj.v_cophone = await system.decryptStr(element.v_cophone);//联系电话-shousuo
robj.business_info_phone = system.decryptStr(element.business_info.contactsPhone);//联系电话
robj.v_cophone = system.decryptStr(element.v_cophone);//联系电话-shousuo
robj.business_status = element.business_status;//商机当前状态
if (element.business_info.serviceName && element.business_info.serviceName != 'undefined'){
robj.serviceName = element.business_info.serviceName;//服务地区
......@@ -97,7 +97,7 @@ class BizOptCtl extends CtlBase {
businessInfo.statusReason = rs.close_reason;//商机关闭原因
businessInfo.memoInfo = rs.business_info.memoInfo;//备注信息
businessInfo.contactsName = rs.business_info.contactsName;//联系人名称
businessInfo.contactsPhone = await system.decryptStr(rs.business_info.contactsPhone);//联系人联系方式
businessInfo.contactsPhone = system.decryptStr(rs.business_info.contactsPhone);//联系人联系方式
businessInfo.createdTime = this.timeFormat(rs.created_at);//商机创建时间
rarr.statusInfo = statusInfo;
rarr.businessInfo = businessInfo;
......@@ -233,11 +233,10 @@ class BizOptCtl extends CtlBase {
var pobj = nobj.d;
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.businessType && pobj.businessType != 'undefined') {
try {
pobj.currentStatus = "beforeSubmission";//加上当前状态为待提交方案
//pobj.currentStatus = "beforeSubmission";//加上当前状态为待提交方案
// pobj.channelSource = "tencentCloud";//目前渠道只有腾讯
// pobj.sourceNumber = "1111111";
pobj.businessType = appconfig.pdict.dyDict[pobj.businessType];
if (pobj.)
var buInfo = await this.service.insertInfo(pobj);
var logInfo = {
"flowType": "BIZ",
......@@ -274,7 +273,28 @@ class BizOptCtl extends CtlBase {
module.exports = BizOptCtl;
// var task = new BizOptCtl();
// var obj={"d":{"businessMode":"201111093003","facilitatorId":"10","facilitatorName":"猪八戒","salesmanId":"12","salesmanName":"zhangsan","salesmanOpcode":"root/ic/zhangsan"}};
// task.updateSalesmanInfoByDemandCode(obj,{},{}).then(d=>{
// console.log(d);
// var obj={
// "d": {
// "businessMode": "20200728103902194833",
// "servicerName": "公司宝",
// "serviceCode": "110100",
// "serviceName": "北京",
// "contactsName": "张三",
// "contactsPhone": "15801599965",
// "businessType": "/ic/gsreg/",
// "businessName": "公司注册",
// "channelSource": "tencentCloud",
// "channelNumber": "tx",
// "memoInfo": "测试一下下",
// "companyName": "腾讯科技有限公司",
// "UserName": "张三",
// "salesmanOpcode": "root/ic/j2",
// "salesmanId": "15",
// "clerkName": "j2",
// "clerkPhone": "13800138000",
// "servicerCode": "10"
// }
// }
// task.findInfoByDemandCode(obj,{},{}).then(d=>{
// console.log(JSON.stringify(d));
// })
......@@ -89,9 +89,9 @@ class DeliverybillCtl extends CtlBase {
robj.deliverStatus = element.delivery_status;//交付单状态
robj.delivery_status = element.delivery_status;//交付单状态-shousuo
robj.contactsName = robj.baseInfo.contactsName;//联系人
robj.contactsPhone = await system.decryptStr(robj.baseInfo.contactsPhone);//联系电话
robj.contactsPhone = system.decryptStr(robj.baseInfo.contactsPhone);//联系电话
robj.v_coname = element.v_coname;//联系人-shousuo
robj.v_cophone = await system.decryptStr(element.v_cophone);//联系电话-shousuo
robj.v_cophone = system.decryptStr(element.v_cophone);//联系电话-shousuo
robj.clerkName = element.salesman_name;//业务员名称
robj.clerkPhone = element.salesman_phone;//业务员电话
robj.deliveryName = element.delivery_man_name;//交付人员名称
......@@ -179,7 +179,7 @@ class DeliverybillCtl extends CtlBase {
rarr.baseInfo.contactsName = rs.delivery_info.contactsName;//联系人信息
}
if (rs.delivery_info.contactsPhone && rs.delivery_info.contactsPhone != 'undefined') {
rarr.contactsInfo.contactsPhone = await system.decryptStr(rs.delivery_info.contactsPhone);//联系电话信息
rarr.contactsInfo.contactsPhone = system.decryptStr(rs.delivery_info.contactsPhone);//联系电话信息
rarr.baseInfo.contactsPhone = rarr.contactsInfo.contactsPhone;//联系电话信息
}
......@@ -573,7 +573,7 @@ class DeliverybillCtl extends CtlBase {
baseInfo.contactsName = pobj.contactsInfo.contactsName;
}
if (pobj.contactsInfo.contactsPhone && pobj.contactsInfo.contactsPhone != 'undefined') {
baseInfo.contactsPhone = await system.encryptStr(pobj.contactsInfo.contactsPhone);
baseInfo.contactsPhone = system.encryptStr(pobj.contactsInfo.contactsPhone);
}
var parms = {
"deliverNumber": pobj.deliverNumber
......@@ -657,7 +657,7 @@ class DeliverybillCtl extends CtlBase {
console.log("根据交付单编号更新交付单详情-------------------------" + JSON.stringify(pobj));
if (pobj.deliverNumber && pobj.deliverNumber != 'undefined') {
try {
pobj.deliverStatus = "received";
//pobj.deliverStatus = "received";
pobj.businessType = appconfig.pdict.dyDict[pobj.businessType];
if (pobj.companyInfo.companyPropertiesName && pobj.companyInfo.companyPropertiesName != 'undefined') {
if (pobj.businessName == "公司注册") {
......@@ -699,6 +699,7 @@ class DeliverybillCtl extends CtlBase {
};
if (pobj.businessMode && pobj.businessMode != 'undefined') {//如果有商机编号,需要取方案编号
var schemeInfo = await this.schemeService.findInfoByDemandCode(pobj);
console.log("schemeInfo-------------" + JSON.stringify())
if (schemeInfo && schemeInfo != 'undefined') {
pobj.schemeNumber = schemeInfo.scheme_number;
pobj.salesmanOpcode = schemeInfo.salesman_opcode;
......@@ -769,7 +770,7 @@ class DeliverybillCtl extends CtlBase {
}
if (pobj.baseInfo.contactsPhone && pobj.baseInfo.contactsPhone != 'undefined') {
pobj.baseInfo.contactsPhone = await system.encryptStr(pobj.baseInfo.contactsPhone);
pobj.baseInfo.contactsPhone = system.encryptStr(pobj.baseInfo.contactsPhone);
pobj.cacheInfo.cmpContactInfo.contactsPhone = pobj.baseInfo.contactsPhone;
}
if (pobj.baseInfo.virtualPrice && pobj.baseInfo.virtualPrice != 'undefined') {//虚拟地址价格
......@@ -779,7 +780,7 @@ class DeliverybillCtl extends CtlBase {
if ((pobj.deliverNumber != pobj.txOrderNum) && (pobj.businessType == "sealSevCase" || pobj.businessType == "agentCase")) {
pobj.companyInfo = {};
}
//await this.service.insertInfoall(pobj);
//更新状态给庄冰
var rc = system.getObject("util.execClient");
var requrl = this.queueUrl;
......@@ -965,8 +966,44 @@ module.exports = DeliverybillCtl;
// // var diff = task.diffDays(ss,oneYear);
// // console.log(oneYear);
// // console.log(diff);
// var obj={"d":{"deliverNumber":"1111111","facilitatorId":"10","facilitatorName":"猪八戒","salesmanId":"12","salesmanName":"zhangsan","salesmanOpcode":"root/ic/zhangsan"}};
// task.updateSalesmanInfoByDeliverCode(obj,{},{}).then(d=>{
// console.log(d);
// var obj={
// "d": {
// "deliverNumber": "20200728103902190000",
// "businessMode": "20200728103902194833",
// "servicerName": "公司宝",
// "serviceCode": "110100",
// "serviceName": "北京",
// "businessType": "/ic/gsreg/",
// "businessName": "公司注册",
// "channelSource": "tencentCloud",
// "channelNumber": "tx",
// "skuCode": "3032",
// "txOrderNum": "20200728103902190000",
// "memoInfo": "测试一下下",
// "companyName": "腾讯科技有限公司",
// "UserName": "张三",
// "clerkOpcode": "root/ic/j2",
// "clerkId": "15",
// "clerkName": "j2",
// "servicerCode": "10",
// "costPrice": "200",
// "sellingPrice": "2000",
// "baseInfo": {
// "txOrderNum": "20200728103902190000",
// "isAdviser": "已分配",
// "contactsName": "张三",
// "contactsPhone": "15801599965",
// "clerkName": "j2",
// "payStatus": "待交付"
// },
// "companyInfo": {},
// "registeredInfo": {},
// "positionInfo": {},
// "regInfo": {},
// "express_info": {}
// }
// };
// task.dealInfo(obj,{},{}).then(d=>{
// console.log(JSON.stringify(d));
// //console.log(d[0].analyse);
// })
......@@ -104,7 +104,7 @@ class BizoptDao extends Dao {
obj.business_info.contactsName = qobj.contactsName;
}
if (qobj.contactsPhone && qobj.contactsPhone != 'undefined') {
obj.business_info.contactsPhone = await system.encryptStr(qobj.contactsPhone);
obj.business_info.contactsPhone = system.encryptStr(qobj.contactsPhone);
}
if (qobj.serviceName && qobj.serviceName != 'undefined') {
obj.business_info.serviceName = qobj.serviceName;
......
......@@ -2,6 +2,8 @@ var fs = require("fs");
var objsettings = require("../config/objsettings");
var settings = require("../config/settings");
const request = require('request');
const cryptoJS = require('crypto-js');
class System {
static declare(ns) {
var ar = ns.split('.');
......@@ -302,22 +304,22 @@ class System {
* 加密信息
* @param {*} opStr
*/
static async encryptStr(opStr) {
static encryptStr(opStr) {
if (!opStr) {
return this.getResult(null, "opStr is empty");
return "opStr is empty";
}
let keyHex = cryptoJS.enc.Utf8.parse(settings.encrypt_key);
let ivHex = cryptoJS.enc.Utf8.parse(settings.encrypt_secret.substring(0, 8));
var cipherStr = cryptoJS.TripleDES.encrypt(opStr, keyHex, { iv: ivHex }).toString();
return this.getResultSuccess(cipherStr);
return cipherStr;
}
/**
* 解密信息
* @param {*} opStr
*/
static async decryptStr(opStr) {
static decryptStr(opStr) {
if (!opStr) {
return this.getResult(null, "opStr is empty");
return "opStr is empty";
}
let keyHex = cryptoJS.enc.Utf8.parse(settings.encrypt_key);
let ivHex = cryptoJS.enc.Utf8.parse(settings.encrypt_secret.substring(0, 8));
......@@ -325,7 +327,7 @@ class System {
iv: ivHex
});
var plaintext = bytes.toString(cryptoJS.enc.Utf8);
return this.getResultSuccess(plaintext);
return plaintext;
}
......
......@@ -307,7 +307,6 @@
"aproba": {
"version": "1.2.0",
"resolved": "https://registry.npm.taobao.org/aproba/download/aproba-1.2.0.tgz",
"integrity": "sha1-aALmJk79GMeQobDVF/DyYnvyyUo=",
"optional": true
},
"arch": {
......@@ -382,7 +381,6 @@
"are-we-there-yet": {
"version": "1.1.5",
"resolved": "https://registry.npm.taobao.org/are-we-there-yet/download/are-we-there-yet-1.1.5.tgz",
"integrity": "sha1-SzXClE8GKov82mZBB2A1D+nd/CE=",
"optional": true,
"requires": {
"delegates": "^1.0.0",
......@@ -1622,8 +1620,7 @@
},
"connect-history-api-fallback": {
"version": "1.6.0",
"resolved": "https://registry.npm.taobao.org/connect-history-api-fallback/download/connect-history-api-fallback-1.6.0.tgz",
"integrity": "sha1-izIIk1kwjRERFdgcrT/Oq4iPl7w="
"resolved": "https://registry.npm.taobao.org/connect-history-api-fallback/download/connect-history-api-fallback-1.6.0.tgz"
},
"connect-redis": {
"version": "3.4.2",
......@@ -1647,7 +1644,6 @@
"console-control-strings": {
"version": "1.1.0",
"resolved": "https://registry.npm.taobao.org/console-control-strings/download/console-control-strings-1.1.0.tgz",
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"optional": true
},
"console-stream": {
......@@ -1788,8 +1784,8 @@
},
"crypto-js": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-3.3.0.tgz",
"integrity": "sha512-DIT51nX0dCfKltpRiXV+/TVZq+Qq2NgF4644+K7Ttnla7zEzqc+kjJyiB96BHNyUTBxyjzRcZYpUdZa+QAqi6Q=="
"resolved": "https://registry.npm.taobao.org/crypto-js/download/crypto-js-3.3.0.tgz",
"integrity": "sha1-hG3RzOL2iqz6FWyFePkmpgm3l2s="
},
"css-select": {
"version": "2.1.0",
......@@ -2113,7 +2109,6 @@
"deep-extend": {
"version": "0.6.0",
"resolved": "https://registry.npm.taobao.org/deep-extend/download/deep-extend-0.6.0.tgz",
"integrity": "sha1-xPp8lUBKF6nD6Mp+FTcxK3NjMKw=",
"optional": true
},
"deep-is": {
......@@ -2205,7 +2200,6 @@
"detect-libc": {
"version": "1.0.3",
"resolved": "https://registry.npm.taobao.org/detect-libc/download/detect-libc-1.0.3.tgz",
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
"optional": true
},
"dicer": {
......@@ -3453,7 +3447,6 @@
"gifsicle": {
"version": "4.0.1",
"resolved": "https://registry.npm.taobao.org/gifsicle/download/gifsicle-4.0.1.tgz",
"integrity": "sha1-MOHmHj7kiE73AmQbLpihXCEnsuI=",
"dev": true,
"optional": true,
"requires": {
......@@ -3889,7 +3882,6 @@
"has-unicode": {
"version": "2.0.1",
"resolved": "https://registry.npm.taobao.org/has-unicode/download/has-unicode-2.0.1.tgz",
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
"optional": true
},
"hawk": {
......@@ -4060,7 +4052,6 @@
"ignore-walk": {
"version": "3.0.3",
"resolved": "https://registry.npm.taobao.org/ignore-walk/download/ignore-walk-3.0.3.tgz",
"integrity": "sha1-AX4kRxhL/q3nwjjkrv3R6PlbHjc=",
"optional": true,
"requires": {
"minimatch": "^3.0.4"
......@@ -4084,7 +4075,6 @@
"imagemin-gifsicle": {
"version": "6.0.1",
"resolved": "https://registry.npm.taobao.org/imagemin-gifsicle/download/imagemin-gifsicle-6.0.1.tgz",
"integrity": "sha1-arrU6VVm1S5aEEq6HCS087SFgbM=",
"dev": true,
"optional": true,
"requires": {
......@@ -5568,7 +5558,6 @@
"minizlib": {
"version": "1.3.3",
"resolved": "https://registry.npm.taobao.org/minizlib/download/minizlib-1.3.3.tgz",
"integrity": "sha1-IpDeloGKNMKVUcio0wEha9Zahh0=",
"optional": true,
"requires": {
"minipass": "^2.9.0"
......@@ -5753,7 +5742,6 @@
"nan": {
"version": "2.14.1",
"resolved": "https://registry.npm.taobao.org/nan/download/nan-2.14.1.tgz",
"integrity": "sha1-174036MQW5FJTDFHCJMV7/iHSwE=",
"optional": true
},
"nanoid": {
......@@ -5829,7 +5817,6 @@
"nodejieba": {
"version": "2.4.1",
"resolved": "https://registry.npm.taobao.org/nodejieba/download/nodejieba-2.4.1.tgz",
"integrity": "sha1-LD5CL7zG2NRJ8tAiJtoFO6WUc2w=",
"optional": true,
"requires": {
"nan": "^2.14.0",
......@@ -5981,7 +5968,6 @@
"npm-bundled": {
"version": "1.1.1",
"resolved": "https://registry.npm.taobao.org/npm-bundled/download/npm-bundled-1.1.1.tgz",
"integrity": "sha1-Ht1XCGWpTNsbyCIHdeKUZsn7I0s=",
"optional": true,
"requires": {
"npm-normalize-package-bin": "^1.0.1"
......@@ -6035,7 +6021,6 @@
"npmlog": {
"version": "4.1.2",
"resolved": "https://registry.npm.taobao.org/npmlog/download/npmlog-4.1.2.tgz",
"integrity": "sha1-CKfyqL9zRgR3mp76StXMcXq7lUs=",
"optional": true,
"requires": {
"are-we-there-yet": "~1.1.2",
......@@ -6754,7 +6739,6 @@
"rc": {
"version": "1.2.8",
"resolved": "https://registry.npm.taobao.org/rc/download/rc-1.2.8.tgz",
"integrity": "sha1-zZJL9SAKB1uDwYjNa54hG3/A0+0=",
"optional": true,
"requires": {
"deep-extend": "^0.6.0",
......@@ -8363,7 +8347,6 @@
"wide-align": {
"version": "1.1.3",
"resolved": "https://registry.npm.taobao.org/wide-align/download/wide-align-1.1.3.tgz",
"integrity": "sha1-rgdOa9wMFKQx6ATmJFScYzsABFc=",
"optional": true,
"requires": {
"string-width": "^1.0.2 || 2"
......
......@@ -24,7 +24,7 @@
"continuation-local-storage": "^3.2.1",
"cookie-parser": "^1.4.3",
"crypto": "^1.0.1",
"crypto-js": "^3.1.9-1",
"crypto-js": "^3.3.0",
"easyimage": "^3.1.0",
"ejs": "^2.5.8",
"engine.io-parser": "^2.1.2",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment