Commit bf74e640 by 高宇强

gyq

parent 7daf2464
...@@ -4,9 +4,11 @@ const querystring = require('querystring'); ...@@ -4,9 +4,11 @@ const querystring = require('querystring');
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base"); const CtlBase = require("../../ctl.base");
const moment = require('moment'); const moment = require('moment');
const appconfig = system.getSysConfig();
class BizOptCtl extends CtlBase { class BizOptCtl extends CtlBase {
constructor() { constructor() {
super("bizchance", CtlBase.getServiceName(BizOptCtl)); super("bizchance", CtlBase.getServiceName(BizOptCtl));
this.receiveUrl = "http://192.168.1.140:4011/api/receive/entService/springBoard";
} }
/*根据用户id获取商机信息,分页获取*/ /*根据用户id获取商机信息,分页获取*/
...@@ -24,8 +26,8 @@ class BizOptCtl extends CtlBase { ...@@ -24,8 +26,8 @@ class BizOptCtl extends CtlBase {
robj.demand_code = element.demand_code;//商机编号 robj.demand_code = element.demand_code;//商机编号
robj.source = element.source_name;//商机来源 robj.source = element.source_name;//商机来源
robj.business_type = element.business_type;//商机类型 robj.business_type = element.business_type;//商机类型
robj.business_info_person = element.business_info.contacts_name;//联系人 robj.business_info_person = element.business_info.contactsName;//联系人
robj.business_info_phone = element.business_info.contacts_phone;//联系电话 robj.business_info_phone = element.business_info.contactsPhone;//联系电话
robj.business_status = element.business_status;//商机当前状态 robj.business_status = element.business_status;//商机当前状态
robj.updated_at = this.timeFormat(element.updated_at);//商机当前状态日期 robj.updated_at = this.timeFormat(element.updated_at);//商机当前状态日期
rarr.push(robj); rarr.push(robj);
...@@ -48,15 +50,24 @@ class BizOptCtl extends CtlBase { ...@@ -48,15 +50,24 @@ class BizOptCtl extends CtlBase {
rarr.id = rs.id;//数据的id rarr.id = rs.id;//数据的id
rarr.businessMode = rs.demand_code;//商机编号 rarr.businessMode = rs.demand_code;//商机编号
rarr.channelSource = rs.source_name;//渠道来源 rarr.channelSource = rs.source_name;//渠道来源
rarr.businessType = rs.business_type;//商机类型 rarr.businessType = rs.business_type;//商机类型代码
rarr.businessName = appconfig.pdict.businessType[rarr.businessType];//商机类型名称
rarr.currentStatus = rs.business_status;//商机状态 rarr.currentStatus = rs.business_status;//商机状态
rarr.serviceArea = rs.service_address;//服务地区 rarr.serviceCode = rs.service_address;//服务地区
if (rarr.businessName == "园区注册"){
rarr.serviceName = appconfig.pdict.registeredParkDict[rarr.serviceCode];//服务地区名称
}
else{
rarr.serviceName = appconfig.pdict.registeredAreaDict[rarr.serviceCode];//服务地区名称
}
rarr.statusReason = rs.close_reason;//商机关闭原因 rarr.statusReason = rs.close_reason;//商机关闭原因
rarr.clerkName = rs.salesman_name;//业务员名称 rarr.clerkName = rs.salesman_name;//业务员名称
rarr.clerkPhone = rs.salesman_phone;//业务员联系方式 rarr.clerkPhone = rs.salesman_phone;//业务员联系方式
rarr.memoInfo = rs.business_info.memo_info;//备注信息 rarr.memoInfo = rs.business_info.memoInfo;//备注信息
rarr.contactsName = rs.business_info.contacts_name;//联系人名称 rarr.contactsName = rs.business_info.contactsName;//联系人名称
rarr.contactsPhone = rs.business_info.contacts_phone;//联系人联系方式 rarr.contactsPhone = rs.business_info.contactsPhone;//联系人联系方式
rarr.servicerCode = rs.facilitator_id;//服务商编码
rarr.servicerName = rs.facilitator_name;//服务商名称
rarr.createdTime = this.timeFormat(rs.created_at);//商机创建时间 rarr.createdTime = this.timeFormat(rs.created_at);//商机创建时间
rarr.statusTime = this.timeFormat(rs.updated_at);//当前状态时间 rarr.statusTime = this.timeFormat(rs.updated_at);//当前状态时间
} }
...@@ -77,8 +88,25 @@ class BizOptCtl extends CtlBase { ...@@ -77,8 +88,25 @@ class BizOptCtl extends CtlBase {
try{ try{
var res = await this.service.updateStatusByDemandCode(pobj); var res = await this.service.updateStatusByDemandCode(pobj);
//调商城接口,回传状态信息,后加 //调商城接口,回传状态信息,后加
if (pobj.currentStatus == "isClosed"){
return system.getResult("更新成功!"); var rc = system.getObject("util.execClient");
var requrl = this.receiveUrl;
var params = {
"actionType":"closeNeed",
"actionBody":{
"needNum": pobj.businessMode,
"note":pobj.statusReason
}
}
var rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
if (j.status == 1){
return system.getResult("操作成功!");
}
else{
return system.getResultError("提交方案出错!");
}
}
} }
catch (error){ catch (error){
return system.getResultError(error); return system.getResultError(error);
...@@ -100,9 +128,7 @@ class BizOptCtl extends CtlBase { ...@@ -100,9 +128,7 @@ class BizOptCtl extends CtlBase {
module.exports = BizOptCtl; module.exports = BizOptCtl;
var task = new BizOptCtl(); var task = new BizOptCtl();
var obj={"demand_code":"30030302991","business_status":"isClosed","close_reason":"嗯哈哈"}; var obj={"businessMode":"202006100001","currentStatus":"isClosed","statusReason":"未付款"};
task.updateStatusByDemandCode(obj,{},{}).then(d=>{ task.updateStatusByDemandCode(obj,{},{}).then(d=>{
console.log(d); console.log(d);
//console.log(d[0].analyse);
}) })
...@@ -4,17 +4,18 @@ const querystring = require('querystring'); ...@@ -4,17 +4,18 @@ const querystring = require('querystring');
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base"); const CtlBase = require("../../ctl.base");
const moment = require('moment'); const moment = require('moment');
const appconfig = system.getSysConfig();
class DeliverybillCtl extends CtlBase { class DeliverybillCtl extends CtlBase {
constructor() { constructor() {
super("bizchance", CtlBase.getServiceName(DeliverybillCtl)); super("bizchance", CtlBase.getServiceName(DeliverybillCtl));
this.materialService = system.getObject("service.bizchance.materialSve");
this.receiveUrl = "http://192.168.1.140:4011/api/receive/entService/springBoard";
} }
/*根据用户id获取商机信息,分页获取*/ /*根据用户id获取商机信息,分页获取*/
async findAndCountAll(pobj, qobj, req) { async findAndCountAll(pobj, qobj, req) {
try { try {
//TODO 根据业务员id获取该业务员所有列表 //TODO 根据业务员id获取该业务员所有交付单列表
//设置查询条件
console.log("pobj--",pobj)
const rs = await this.service.findAndCountAll(pobj); const rs = await this.service.findAndCountAll(pobj);
let rarr = []; let rarr = [];
let results = rs.results.rows; let results = rs.results.rows;
...@@ -26,16 +27,31 @@ class DeliverybillCtl extends CtlBase { ...@@ -26,16 +27,31 @@ class DeliverybillCtl extends CtlBase {
robj.businessType = element.product_code;//产品编码 robj.businessType = element.product_code;//产品编码
robj.channelSource = element.source_name;//渠道名称 robj.channelSource = element.source_name;//渠道名称
robj.channelNumber = element.source_number;//渠道编码 robj.channelNumber = element.source_number;//渠道编码
if (robj.businessName != '工商注册' && robj.businessName != '云上园区注册'){ robj.baseInfo = element.delivery_info;//交付单详情
if (robj.businessName == '工商注册'){
if (robj.baseInfo.isWhether == "是" || robj.baseInfo.isVirtual == "是"){//如果有刻章需求或者是虚拟地址
robj.relatedProducts = '有';
}
else{
robj.relatedProducts = '无'; robj.relatedProducts = '无';
}
} }
// else{ else if (robj.businessName == '园区注册'){
// //获取材料信息中的 if (robj.baseInfo.isWhether == "是"){//如果有刻章需求或者是虚拟地址
// } robj.relatedProducts = '有';
robj.business_info_person = element.business_info.contacts_name;//联系人 }
robj.business_info_phone = element.business_info.contacts_phone;//联系电话 else{
robj.business_status = element.business_status;//商机当前状态 robj.relatedProducts = '无';
robj.updated_at = this.timeFormat(element.updated_at);//商机当前状态日期 }
}
else{
robj.relatedProducts = '无';
};
robj.payAmount = element.selling_price;//交付单金额
robj.deliverStatus = element.delivery_status;//交付单状态
robj.contactsName = robj.baseInfo.contactsName;//联系人
robj.contactsPhone = robj.baseInfo.contactsPhone;//联系电话
robj.CrteatdTime = this.timeFormat(element.created_at);//交付单创建时间
rarr.push(robj); rarr.push(robj);
}); });
rs.results.rows = rarr; rs.results.rows = rarr;
...@@ -47,26 +63,160 @@ class DeliverybillCtl extends CtlBase { ...@@ -47,26 +63,160 @@ class DeliverybillCtl extends CtlBase {
/*根据交付单编号获取交付单详情*/ /*根据交付单编号获取交付单详情*/
async findInfoByDeliverCode(pobj,qobj,req){ async findInfoByDeliverCode(pobj,qobj,req){
if (pobj.businessMode && pobj.businessMode != 'undefined') if (pobj.deliverNumber && pobj.deliverNumber != 'undefined')
{ {
try{ try{
var rs = await this.service.findInfoByDeliverCode(pobj); var rs = await this.service.findInfoByDeliverCode(pobj);
var rarr = {} var rarr = {}
if (rs){ if (rs){
rarr.id = rs.id;//数据的id rarr.id = rs.id;//数据的id
rarr.businessMode = rs.demand_code;//商机编号 rarr.deliverNumber = rs.deliver_code;//交付单编号
rarr.channelSource = rs.source_name;//渠道来源 rarr.businessName = rs.product_name;//产品名称
rarr.businessType = rs.business_type;//商机类型 rarr.businessType = rs.product_code;//产品编码
rarr.currentStatus = rs.business_status;//商机状态 rarr.channelSource = rs.source_name;//渠道名称
rarr.serviceArea = rs.service_address;//服务地区 rarr.channelNumber = rs.source_number;//渠道编码
rarr.statusReason = rs.close_reason;//商机关闭原因 //rarr.baseInfo = rs.delivery_info;//交付单详情
rarr.serviceCode = rs.service_address;//服务地区编码
if (rarr.businessName == "园区注册"){
rarr.serviceArea = appconfig.pdict.registeredParkDict[rarr.serviceCode];//服务地区名称
}
else{
rarr.serviceArea = appconfig.pdict.registeredAreaDict[rarr.serviceCode];//服务地区名称
}
rarr.contactsName = rs.delivery_info.contactsName;//联系人姓名
rarr.contactsPhone = rs.delivery_info.contactsPhone;//联系人电话
rarr.servicerCode = rs.facilitator_id;//服务商编码
rarr.servicerName = rs.facilitator_name;//服务商名称
rarr.clerkName = rs.salesman_name;//业务员名称 rarr.clerkName = rs.salesman_name;//业务员名称
rarr.clerkPhone = rs.salesman_phone;//业务员联系方式 rarr.clerkPhone = rs.salesman_phone;//业务员电话
rarr.memoInfo = rs.business_info.memo_info;//备注信息 rarr.payAmount = rs.selling_price;//交付单金额
rarr.contactsName = rs.business_info.contacts_name;//联系人名称 rarr.deliverStatus = rs.delivery_status;//交付单状态
rarr.contactsPhone = rs.business_info.contacts_phone;//联系人联系方式 rarr.statusReason = rs.close_reason;//状态原因
rarr.createdTime = this.timeFormat(rs.created_at);//商机创建时间 rarr.createdTime = this.timeFormat(rs.created_at);//交付单创建时间
rarr.statusTime = this.timeFormat(rs.updated_at);//当前状态时间 rarr.statusTime = this.timeFormat(rs.updated_at);//当前状态时间
//其他详细信息
var baseInfo = {};
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
baseInfo.isWhether = rs.delivery_info.isWhether;
if (robj.baseInfo.isWhether == "是"){//如果有刻章需求或者是虚拟地址
baseInfo.relatedProducts = '有';
}
else{
baseInfo.relatedProducts = '无';
}
if (rarr.businessName == "公司注册"){
baseInfo.isVirtual = rs.delivery_info.isVirtual;
if (baseInfo.isVirtual == "是"){
baseInfo.relatedProducts = '有';
}
}
baseInfo.officialSeal = rs.delivery_info.officialSeal;
baseInfo.businessLicense = rs.delivery_info.businessLicense;
}
if (rarr.businessName == "税控申请" || rarr.businessName == "代理记账"){
baseInfo.taxpayerType = rs.delivery_info.taxpayerType;
if (rarr.businessName == "代理记账"){
baseInfo.subjectType = rs.delivery_info.subjectType;
}
}
if (rarr.businessName == "刻章服务"){
baseInfo.whetherType = rs.delivery_info.whetherType;
}
if (rarr.businessName == "注册地址" || rarr.businessName == "代理记账"){
baseInfo.buyTime = rs.delivery_info.buyTime;
baseInfo.buyDuration = rs.delivery_info.buyDuration;
baseInfo.isRenew = rs.delivery_info.isRenew;
}
rarr.baseInfo = baseInfo;
var companyInfo = {};
var materialInfo = await this.materialService.findInfoByDeliverId(rarr.id);
if (materialInfo){
companyInfo.companyName = materialInfo.company_info.companyName;
companyInfo.fullAddress = materialInfo.company_info.fullAddress;
companyInfo.operatingPeriod = materialInfo.company_info.operatingPeriod;
companyInfo.businessScope = materialInfo.company_info.businessScope;
if (rarr.businessName == "园区注册"){
companyInfo.individualType = materialInfo.company_info.individualType;
companyInfo.individualName = appconfig.pdict.registeredTypeDict[companyInfo.individualType];
}
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
companyInfo.spareName = Arrays.asList(materialInfo.company_info.spareName.split(","));
companyInfo.taxpayerType = materialInfo.company_info.taxpayerType;
if (rarr.businessName == "公司注册"){
companyInfo.companyProperties = materialInfo.company_info.companyProperties;
}
companyInfo.addressType = materialInfo.company_info.addressType;
companyInfo.engagedIndustry = materialInfo.company_info.engagedIndustry;
}
if (rarr.businessName != "公司注册" && rarr.businessName != "园区注册" ){
companyInfo.registeredCapital = materialInfo.company_info.registeredCapital;
companyInfo.creditCode = materialInfo.company_info.creditCode;
companyInfo.companyType = materialInfo.company_info.companyType;
companyInfo.establishedTime = materialInfo.company_info.establishedTime;
companyInfo.shareholderName = materialInfo.company_info.shareholderName;
}
rarr.companyInfo = companyInfo;
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
var registeredInfo = {};
registeredInfo.registeredCapital = materialInfo.registered_info.registeredCapital;
registeredInfo.reserveProportion = materialInfo.registered_info.reserveProportion;
if (rarr.businessName == "公司注册" || companyInfo.individualName == "个人独资" ){
registeredInfo.registeredDate = materialInfo.registered_info.registeredDate;
}
rarr.registeredInfo = registeredInfo;
}
if (rarr.businessName == "公司注册" || companyInfo.individualName == "个人独资" ){
var contributionInfo = [];
var tempList = materialInfo.contribution_info.contributionInfo;//数据格式:{"contributionInfo":[{},{}]}
tempList.forEach(element => {
contributionInfo.push(element);
});
rarr.contributionInfo = contributionInfo;
}
if (rarr.businessName == "公司注册"){
var positionInfo = [];
var tempList = materialInfo.position_info.positionInfo;//数据格式:{"positionInfo":[{},{}]}
tempList.forEach(element => {
positionInfo.push(element);
});
rarr.positionInfo = positionInfo;
}
if (companyInfo.individualName == "个体商户")
{
rarr.managerInfo = materialInfo.position_info;
}
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
var regInfo = {};
if (companyInfo.individualName == "个体商户"){
regInfo.managerCertificate = materialInfo.file_info.managerCertificate;
}
else{
regInfo.legalpersonCertificate = materialInfo.file_info.legalpersonCertificate;
regInfo.cfoCertificate = materialInfo.file_info.cfoCertificate;
if (rarr.businessName == "公司注册"){
regInfo.titleCertificate = materialInfo.file_info.titleCertificate;
regInfo.naturalpersonCertificate = materialInfo.file_info.naturalpersonCertificate;
regInfo.socialCertificate = materialInfo.file_info.socialCertificate;
regInfo.directorCertificate = materialInfo.file_info.directorCertificate;
regInfo.managerCertificate = materialInfo.file_info.managerCertificate;
regInfo.supervisorCertificate = materialInfo.file_info.supervisorCertificate;
}
}
rarr.regInfo = regInfo;
rarr.expressInfo = materialInfo.express_info;
}
}
} }
return system.getResult(rarr); return system.getResult(rarr);
} }
...@@ -81,7 +231,7 @@ class DeliverybillCtl extends CtlBase { ...@@ -81,7 +231,7 @@ class DeliverybillCtl extends CtlBase {
/*根据交付单编号更新交付单状态*/ /*根据交付单编号更新交付单状态*/
async updateInfoByDeliverCode(pobj,qobj,req){ async updateInfoByDeliverCode(pobj,qobj,req){
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.currentStatus && pobj.currentStatus != 'undefined'){ if (pobj.deliverNumber && pobj.deliverNumber != 'undefined' && pobj.deliverStatus && pobj.deliverStatus != 'undefined'){
try{ try{
var res = await this.service.updateInfoByDeliverCode(pobj); var res = await this.service.updateInfoByDeliverCode(pobj);
//调商城接口,回传状态信息,后加 //调商城接口,回传状态信息,后加
...@@ -97,7 +247,25 @@ class DeliverybillCtl extends CtlBase { ...@@ -97,7 +247,25 @@ class DeliverybillCtl extends CtlBase {
} }
} }
async insertInfo(pobj,qobj,req){
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.schemeNumber && pobj.schemeNumber != 'undefined'){
try{
var res = await this.service.insertInfo(pobj);
var mobj = pobj;
mobj.deliverId = res.id;
if (res.delivery_code){
mobj.deliverNumber = res.delivery_code;
}
await this.materialService.insertInfo(mobj);
return system.getResult("插入成功!");
}
catch (error){
return system.getResultError(error);
}
}else{
return system.getResultError("参数错误!");
}
}
timeFormat(date) { timeFormat(date) {
let localTime = moment.utc(date).toDate(); let localTime = moment.utc(date).toDate();
...@@ -108,7 +276,7 @@ class DeliverybillCtl extends CtlBase { ...@@ -108,7 +276,7 @@ class DeliverybillCtl extends CtlBase {
module.exports = DeliverybillCtl; module.exports = DeliverybillCtl;
var task = new DeliverybillCtl(); var task = new DeliverybillCtl();
var obj={"demand_code":"30030302991","business_status":"isClosed","close_reason":"嗯哈哈"}; var obj={};
task.updateStatusByDemandCode(obj,{},{}).then(d=>{ task.updateStatusByDemandCode(obj,{},{}).then(d=>{
console.log(d); console.log(d);
//console.log(d[0].analyse); //console.log(d[0].analyse);
......
...@@ -4,9 +4,12 @@ const querystring = require('querystring'); ...@@ -4,9 +4,12 @@ const querystring = require('querystring');
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
const CtlBase = require("../../ctl.base"); const CtlBase = require("../../ctl.base");
const moment = require('moment'); const moment = require('moment');
const appconfig = system.getSysConfig();
class SchemeCtl extends CtlBase { class SchemeCtl extends CtlBase {
constructor() { constructor() {
super("bizchance", CtlBase.getServiceName(SchemeCtl)); super("bizchance", CtlBase.getServiceName(SchemeCtl));
this.bizoptService = system.getObject("service.bizchance.bizoptSve");
this.receiveUrl = "http://192.168.1.140:4011/api/receive/entService/springBoard";
} }
/*根据id获取方案信息详情*/ /*根据id获取方案信息详情*/
...@@ -18,7 +21,14 @@ class SchemeCtl extends CtlBase { ...@@ -18,7 +21,14 @@ class SchemeCtl extends CtlBase {
if (rs){ if (rs){
rarr.businessMode = rs.demand_code;//商机编号 rarr.businessMode = rs.demand_code;//商机编号
rarr.schemeNumber = rs.scheme_number;//方案编号 rarr.schemeNumber = rs.scheme_number;//方案编号
rarr.planInfo = rs.scheme_info;//方案详情 rarr.businessType = "";//商机类型
rarr.businessName = "";//商机名称
var bizoptInfo = await this.bizoptService.findInfoByDemandCode({"businessMode":rarr.businessMode});
if (bizoptInfo){
rarr.businessType = bizoptInfo.business_type;
rarr.businessName = appconfig.pdict.businessType[rarr.businessType];//商机类型名称
}
// rarr.planInfo = rs.scheme_info;//方案详情
rarr.memoInfo = rs.remark_info;//备注信息 rarr.memoInfo = rs.remark_info;//备注信息
rarr.currentStatus = rs.scheme_status;//当前状态 rarr.currentStatus = rs.scheme_status;//当前状态
rarr.statusReason = rs.reject_reason;//状态原因 rarr.statusReason = rs.reject_reason;//状态原因
...@@ -29,6 +39,49 @@ class SchemeCtl extends CtlBase { ...@@ -29,6 +39,49 @@ class SchemeCtl extends CtlBase {
rarr.clerkPhone = rs.salesman_phone;//业务员联系方式 rarr.clerkPhone = rs.salesman_phone;//业务员联系方式
rarr.createdTime = this.timeFormat(rs.created_at);//创建方案的日期 rarr.createdTime = this.timeFormat(rs.created_at);//创建方案的日期
rarr.statusTime = this.timeFormat(rs.updated_at);//当前状态的日期 rarr.statusTime = this.timeFormat(rs.updated_at);//当前状态的日期
var baseInfo = {};
if (rs.scheme_info.companyName && rs.scheme_info.companyName != 'undefined'){//公司名称
rarr.companyName = rs.scheme_info.companyName;
}
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"
|| rarr.businessName == "税控申请" || rarr.businessName == "代理记账"){
baseInfo.taxpayerType = rs.scheme_info.taxpayerType;
}
if (rarr.businessName == "园区注册"){
baseInfo.registeredType = rs.scheme_info.registeredType;
}
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
baseInfo.companyProperties = rs.scheme_info.companyProperties;
baseInfo.engagedIndustry = rs.scheme_info.engagedIndustry;
baseInfo.addressType = rs.scheme_info.addressType;
baseInfo.fullAddress = rs.scheme_info.fullAddress;
baseInfo.businessScope = rs.scheme_info.businessScope;
baseInfo.isWhether = rs.scheme_info.isWhether;
}
if (rarr.businessName == "刻章服务"){
baseInfo.whetherType = rs.scheme_info.whetherType;
}
if (rarr.businessName == "代理记账"){
baseInfo.subjectType = rs.scheme_info.subjectType;
}
if (rarr.businessName == "注册地址" || rarr.businessName == "代理记账"){
baseInfo.buyTime = rs.scheme_info.buyTime;
baseInfo.buyDuration = rs.scheme_info.buyDuration;
baseInfo.isRenew = rs.scheme_info.isRenew;
}
rarr.baseInfo = baseInfo;
if (rarr.businessName != "公司注册" && rarr.businessName != "园区注册"){
var companyInfo = {};
companyInfo.creditCode = rs.scheme_info.creditCode;
companyInfo.companyType = rs.scheme_info.companyType;
companyInfo.establishedTime = rs.scheme_info.establishedTime;
companyInfo.registeredCapital =rs.scheme_info.registeredCapital;
companyInfo.shareholderName = rs.scheme_info.shareholderName;
companyInfo.businessTerm = rs.scheme_info.businessTerm;
companyInfo.businessScope = rs.scheme_info.businessScope;
companyInfo.residenceAddress = rs.scheme_info.residenceAddress;
rarr.companyInfo = companyInfo;
}
} }
return system.getResult(rarr); return system.getResult(rarr);
} }
...@@ -50,7 +103,14 @@ class SchemeCtl extends CtlBase { ...@@ -50,7 +103,14 @@ class SchemeCtl extends CtlBase {
if (rs){ if (rs){
rarr.businessMode = rs.demand_code;//商机编号 rarr.businessMode = rs.demand_code;//商机编号
rarr.schemeNumber = rs.scheme_number;//方案编号 rarr.schemeNumber = rs.scheme_number;//方案编号
rarr.planInfo = rs.scheme_info;//方案详情 rarr.businessType = "";//商机类型
rarr.businessName = "";//商机名称
var bizoptInfo = await this.bizoptService.findInfoByDemandCode({"businessMode":rarr.businessMode});
if (bizoptInfo){
rarr.businessType = bizoptInfo.business_type;
rarr.businessName = appconfig.pdict.businessType[rarr.businessType];//商机类型名称
}
//rarr.planInfo = rs.scheme_info;//方案详情
rarr.memoInfo = rs.remark_info;//备注信息 rarr.memoInfo = rs.remark_info;//备注信息
rarr.currentStatus = rs.scheme_status;//当前状态 rarr.currentStatus = rs.scheme_status;//当前状态
rarr.statusReason = rs.reject_reason;//状态原因 rarr.statusReason = rs.reject_reason;//状态原因
...@@ -61,6 +121,48 @@ class SchemeCtl extends CtlBase { ...@@ -61,6 +121,48 @@ class SchemeCtl extends CtlBase {
rarr.clerkPhone = rs.salesman_phone;//业务员联系方式 rarr.clerkPhone = rs.salesman_phone;//业务员联系方式
rarr.createdTime = this.timeFormat(rs.created_at);//创建方案的日期 rarr.createdTime = this.timeFormat(rs.created_at);//创建方案的日期
rarr.statusTime = this.timeFormat(rs.updated_at);//当前状态的日期 rarr.statusTime = this.timeFormat(rs.updated_at);//当前状态的日期
var baseInfo = {};
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"
|| rarr.businessName == "税控申请" || rarr.businessName == "代理记账"){
baseInfo.taxpayerType = rs.scheme_info.taxpayerType;
}
if (rarr.businessName == "园区注册"){
baseInfo.registeredType = rs.scheme_info.registeredType;
}
if (rarr.businessName == "公司注册" || rarr.businessName == "园区注册"){
if (rarr.businessName == "公司注册"){
baseInfo.companyProperties = rs.scheme_info.companyProperties;
}
baseInfo.engagedIndustry = rs.scheme_info.engagedIndustry;
baseInfo.addressType = rs.scheme_info.addressType;
baseInfo.fullAddress = rs.scheme_info.fullAddress;
baseInfo.businessScope = rs.scheme_info.businessScope;
baseInfo.isWhether = rs.scheme_info.isWhether;
}
if (rarr.businessName == "刻章服务"){
baseInfo.whetherType = rs.scheme_info.whetherType;
}
if (rarr.businessName == "代理记账"){
baseInfo.subjectType = rs.scheme_info.subjectType;
}
if (rarr.businessName == "注册地址" || rarr.businessName == "代理记账"){
baseInfo.buyTime = rs.scheme_info.buyTime;
baseInfo.buyDuration = rs.scheme_info.buyDuration;
baseInfo.isRenew = rs.scheme_info.isRenew;
}
rarr.baseInfo = baseInfo;
if (rarr.businessName != "公司注册" && rarr.businessName != "园区注册"){
var companyInfo = {};
companyInfo.creditCode = rs.scheme_info.creditCode;
companyInfo.companyType = rs.scheme_info.companyType;
companyInfo.establishedTime = rs.scheme_info.establishedTime;
companyInfo.registeredCapital =rs.scheme_info.registeredCapital;
companyInfo.shareholderName = rs.scheme_info.shareholderName;
companyInfo.businessTerm = rs.scheme_info.businessTerm;
companyInfo.businessScope = rs.scheme_info.businessScope;
companyInfo.residenceAddress = rs.scheme_info.residenceAddress;
rarr.companyInfo = companyInfo;
}
} }
return system.getResult(rarr); return system.getResult(rarr);
} }
...@@ -77,7 +179,7 @@ class SchemeCtl extends CtlBase { ...@@ -77,7 +179,7 @@ class SchemeCtl extends CtlBase {
async updateStatusBySchemeNumber(pobj, qobj, req){ async updateStatusBySchemeNumber(pobj, qobj, req){
if (pobj.schemeNumber && pobj.schemeNumber != 'undefined' && pobj.currentStatus && pobj.currentStatus != 'undefined'){ if (pobj.schemeNumber && pobj.schemeNumber != 'undefined' && pobj.currentStatus && pobj.currentStatus != 'undefined'){
try{ try{
await this.service.updateStatusBySchemeNumber(pobj); await this.service.updateStatusBySchemeNumber(pobj);
//调商城接口 //调商城接口
return system.getResult("更新成功!"); return system.getResult("更新成功!");
} }
...@@ -92,10 +194,15 @@ class SchemeCtl extends CtlBase { ...@@ -92,10 +194,15 @@ class SchemeCtl extends CtlBase {
/*根据方案编号更新方案详情*/ /*根据方案编号更新方案详情*/
async updateInfoBySchemeNumber(pobj, qobj, req){ async updateInfoBySchemeNumber(pobj, qobj, req){
if (pobj.schemeNumber && pobj.schemeNumber != 'undefined' && pobj.planInfo != 'undefined'){ if (pobj.schemeNumber && pobj.schemeNumber != 'undefined'){
try{ try{
await this.service.updateInfoBySchemeNumber(pobj); var retn = await this.service.updateInfoBySchemeNumber(pobj);
return system.getResult("更新成功!"); if (retn == -1){
return system.getResultError("要更新的数据不存在!");
}
else{
return system.getResult("更新成功!");
}
} }
catch(error){ catch(error){
return system.getResultError(error); return system.getResultError(error);
...@@ -124,10 +231,42 @@ class SchemeCtl extends CtlBase { ...@@ -124,10 +231,42 @@ class SchemeCtl extends CtlBase {
/*插入方案信息*/ /*插入方案信息*/
async insertInfo(pobj, qobj, req){ async insertInfo(pobj, qobj, req){
if (pobj.businessMode && pobj.businessMode != 'undefined' && pobj.currentStatus && pobj.currentStatus != 'undefined' && pobj.planInfo!= 'undefined'){ if (pobj.businessMode && pobj.businessMode != 'undefined'){//商机编号必须存在
try{ try{
await this.service.insertInfo(pobj); var businessInfo = await this.bizoptService.findInfoByDemandCode(pobj);//得到商机的信息
return system.getResult("插入成功!"); if (businessInfo){
pobj.businessId = businessInfo.id;//商机id
pobj.businessType = businessInfo.business_type;//商机类型
pobj.servicerCode = businessInfo.facilitator_id;//服务商id
pobj.servicerName = businessInfo.facilitator_name;//服务商的名称
pobj.clerkOpcode = businessInfo.salesman_opcode;//这个信息需要确认
pobj.clerkId = businessInfo.salesman_id;//业务员id
pobj.clerkName = businessInfo.salesman_name;//业务员名称
pobj.clerkPhone = businessInfo.salesman_phone;//业务员联系电话
pobj.currentStatus = businessInfo.business_status;//商机状态即为方案状态
pobj.statusReason = businessInfo.close_reason;//状态原因
}
var rc = system.getObject("util.execClient");
var requrl = this.receiveUrl;
var params = {
"actionType":"submitSolution",
"actionBody":{
"needNum": pobj.businessMode,
"solutionNum":"",
"solutionContent": pobj
}
}
var rtn = await rc.execPost(params, requrl);
var j = JSON.parse(rtn.stdout);
if (j.status == 1){
pobj.schemeNumber = j.data
await this.service.insertInfo(pobj);
return system.getResult("操作成功!");
}
else{
return system.getResultError("提交方案出错!");
}
} }
catch(error){ catch(error){
return system.getResultError(error); return system.getResultError(error);
...@@ -147,7 +286,7 @@ class SchemeCtl extends CtlBase { ...@@ -147,7 +286,7 @@ class SchemeCtl extends CtlBase {
module.exports = SchemeCtl; module.exports = SchemeCtl;
var task = new SchemeCtl(); var task = new SchemeCtl();
var obj={"businessMode":"30030302991","currentStatus":"待提交","planInfo":{}}; var obj={"businessMode":"202006100011","memoInfo":"sfdsff","whetherType":"individual","creditCode":"1223345455","companyType":"有限公司","companyName":"三个五","establishedTime":"2010-5-6","registeredCapital":"5万元","shareholderName":"2B","businessTerm":"500","businessScope":"sgrgdrgghhh","residenceAddress":"北京市"};
task.insertInfo(obj,{},{}).then(d=>{ task.insertInfo(obj,{},{}).then(d=>{
console.log(d); console.log(d);
//console.log(d[0].analyse); //console.log(d[0].analyse);
......
...@@ -25,6 +25,7 @@ class BizoptDao extends Dao { ...@@ -25,6 +25,7 @@ class BizoptDao extends Dao {
return await this.findOne(qcwhere); return await this.findOne(qcwhere);
} }
/*更新商机状态*/
async updateStatusByDemandCode(qobj,t){ async updateStatusByDemandCode(qobj,t){
var setobj = {"business_status":qobj.currentStatus}; var setobj = {"business_status":qobj.currentStatus};
if (qobj.statusReason && qobj.statusReason != 'undefined'){ if (qobj.statusReason && qobj.statusReason != 'undefined'){
...@@ -34,6 +35,11 @@ class BizoptDao extends Dao { ...@@ -34,6 +35,11 @@ class BizoptDao extends Dao {
return await this.updateByWhere(setobj,whereobj,t); return await this.updateByWhere(setobj,whereobj,t);
} }
/*插入商机信息*/
async insertInfo(qobj,t){
}
} }
module.exports = BizoptDao; module.exports = BizoptDao;
...@@ -35,14 +35,98 @@ class DeliverybillDao extends Dao { ...@@ -35,14 +35,98 @@ class DeliverybillDao extends Dao {
return await this.updateByWhere(setobj,whereobj,t); return await this.updateByWhere(setobj,whereobj,t);
} }
/*插入缓存信息*/ /*插入交付单信息*/
// async insertInfo(qobj,t){ async insertInfo(qobj,t){
// var obj = { var obj = {
// "deliver_id":qobj.deliver_id, "demand_code":qobj.businessMode,
// "cache_info":qobj.cache_info "scheme_number":qobj.schemeNumber
// }; };
// return await this.create(obj,t); if (qobj.deliverNumber && qobj.deliverNumber != 'undefined'){
// } obj.delivery_code = qobj.deliverNumber;
}
if (qobj.businessName && qobj.businessName != 'undefined'){
obj.product_name = qobj.businessName;
}
if (qobj.businessType && qobj.businessType != 'undefined'){
obj.product_code = qobj.businessType;
}
if (qobj.channelSource && qobj.channelSource != 'undefined'){
obj.source_name = qobj.channelSource;
}
if (qobj.channelNumber && qobj.channelNumber != 'undefined'){
obj.source_number = qobj.channelNumber;
}
if (qobj.serviceCode && qobj.serviceCode != 'undefined'){
obj.service_address = qobj.serviceCode;
}
if (qobj.servicerCode && qobj.servicerCode != 'undefined'){
obj.facilitator_id = qobj.servicerCode;
}
if (qobj.servicerName && qobj.servicerName != 'undefined'){
obj.facilitator_name = qobj.servicerName;
}
if (qobj.clerkName && qobj.clerkName != 'undefined'){
obj.salesman_name = qobj.clerkName;
}
if (qobj.clerkPhone && qobj.clerkPhone != 'undefined'){
obj.salesman_phone = qobj.clerkPhone
}
if (qobj.clerkOpcode && qobj.clerkOpcode != 'undefined'){
obj.salesman_opcode = qobj.clerkOpcode;
}
if (qobj.clerkId && qobj.clerkId != 'undefined'){
obj.salesman_id = qobj.clerkId;
}
if (qobj.payAmount && qobj.payAmount != 'undefined'){
obj.selling_price = qobj.payAmount;
}
if (qobj.deliverStatus && qobj.deliverStatus != 'undefined'){
obj.delivery_status = qobj.deliverStatus;
}
if (qobj.costPrice && qobj.costPrice != 'undefined'){
obj.cost_price = qobj.costPrice;
}
if (qobj.statusReason && qobj.statusReason != 'undefined'){
obj.close_reason = qobj.statusReason;
}
if (qobj.isWhether && qobj.isWhether != 'undefined'){
obj.delivery_info.isWhether = qobj.isWhether;
}
if (qobj.isVirtual && qobj.isVirtual != 'undefined'){
obj.delivery_info.isVirtual = qobj.isVirtual;
}
if (qobj.officialSeal && qobj.officialSeal != 'undefined'){
obj.delivery_info.officialSeal = qobj.officialSeal;
}
if (qobj.businessLicense && qobj.businessLicense != 'undefined'){
obj.delivery_info.businessLicense = obj.businessLicense;
}
if (qobj.taxpayerType && qobj.taxpayerType != 'undefined'){
obj.delivery_info.taxpayerType = qobj.taxpayerType;
}
if (qobj.whetherType && qobj.whetherType != 'undefined'){
obj.delivery_info.whetherType = qobj.whetherType;
}
if (qobj.subjectType && qobj.subjectType != 'undefined'){
obj.delivery_info.subjectType = qobj.subjectType;
}
if (qobj.buyTime && qobj.buyTime != 'undefined'){
obj.delivery_info.buyTime = qobj.buyTime;
}
if (qobj.buyDuration && qobj.buyDuration != 'undefined'){
obj.delivery_info.buyDuration = qobj.buyDuration;
}
if (qobj.isRenew && qobj.isRenew != 'undefined'){
obj.delivery_info.isRenew = qobj.isRenew;
}
if (qobj.contactsName && qobj.contactsName != 'undefined'){
obj.delivery_info.contactsName = qobj.contactsName;
}
if (qobj.contactsPhone && qobj.contactsPhone != 'undefined'){
obj.delivery_info.contactsPhone = qobj.contactsPhone;
}
return await this.create(obj,t);
}
} }
......
...@@ -23,26 +23,131 @@ class MaterialDao extends Dao { ...@@ -23,26 +23,131 @@ class MaterialDao extends Dao {
var obj = { var obj = {
"delivery_id":qobj.deliverId "delivery_id":qobj.deliverId
}; };
if (qobj.deliverNumber != 'undefined'){ if (qobj.deliverNumber && qobj.deliverNumber != 'undefined'){
obj["delivery_code"] = qobj.deliverNumber; obj["delivery_code"] = qobj.deliverNumber;
} }
if (qobj.companyInfo != 'undefined'){ if (qobj.companyName && qobj.companyName != 'undefined'){
obj["company_info"] = qobj.companyInfo; obj.company_info.companyName = qobj.companyName;
} }
if (qobj.registeredInfo != 'undefined'){ if (qobj.spareName && qobj.spareName != 'undefined'){
obj["registered_info"] = qobj.registeredInfo; obj.company_info.spareName = qobj.spareName;
} }
if (qobj.contributionInfo != 'undefined'){ if (qobj.taxpayerType && qobj.taxpayerType != 'undefined'){
obj["contribution_info"] = qobj.contributionInfo; obj.company_info.taxpayerType = qobj.taxpayerType;
} }
if (qobj.positionInfo != 'undefined'){ if (qobj.companyProperties && qobj.companyProperties != 'undefined'){
obj["position_info"] = qobj.positionInfo; obj.company_info.companyProperties = qobj.companyProperties;
} }
if (qobj.regInfo != 'undefined'){ if (qobj.addressType && qobj.addressType != 'undefined'){
obj["file_info"] = qobj.regInfo; obj.company_info.addressType = pobj.company_info.addressType;
} }
if (qobj.expressInfo != 'undefined'){ if (qobj.fullAddress && qobj.fullAddress != 'undefined'){
obj["express_info"] = qobj.expressInfo; obj.company_info.fullAddress = qobj.fullAddress;
}
if (pobj.engagedIndustry && pobj.engagedIndustry != 'undefined'){
obj.company_info.engagedIndustry = qobj.engagedIndustry;
}
if (pobj.businessScope && pobj.businessScope != 'undefined'){
obj.company_info.businessScope = pobj.businessScope;
}
if (pobj.operatingPeriod && pobj.operatingPeriod != 'undefined'){
obj.company_info.operatingPeriod = pobj.operatingPeriod;
}
if (pobj.individualType && pobj.individualType != 'undefined'){
obj.company_info.individualType = pobj.individualType;
}
if (pobj.registeredCapital && pobj.registeredCapital != 'undefined'){
obj.company_info.registeredCapital = pobj.registeredCapital;
}
if (pobj.creditCode && pobj.creditCode != 'undefined'){
obj.company_info.creditCode = pobj.creditCode;
}
if (pobj.companyType && pobj.companyType != 'undefined'){
obj.company_info.companyType = pobj.companyType;
}
if (pobj.establishedTime && pobj.establishedTime != 'undefined'){
obj.company_info.establishedTime = pobj.establishedTime;
}
if (pobj.shareholderName && pobj.shareholderName != 'undefined'){
obj.company_info.shareholderName = pobj.shareholderName;
}
if (pobj.registeredCapital && pobj.registeredCapital != 'undefined'){
obj.registered_info.registeredCapital = pobj.registeredCapital;
}
if (pobj.registeredDate && pobj.registeredDate != 'undefined'){
obj.registered_info.registeredDate = pobj.registeredDate;
}
if (pobj.reserveProportion && pobj.reserveProportion != 'undefined'){
obj.registered_info.reserveProportion = pobj.reserveProportion;
}
if (pobj.contributionInfo && pobj.contributionInfo != 'undefined'){
obj.contribution_info.contributionInfo = pobj.contributionInfo;
}
if (pobj.positionInfo && pobj.positionInfo != 'undefined'){
obj.position_info.positionInfo = pobj.positionInfo;
}
if (pobj.managerName && pobj.managerName != 'undefined'){
obj.position_info.managerName = pobj.managerName;
}
if (pobj.managerName && pobj.managerName != 'undefined'){
obj.position_info.managerName = pobj.managerName;
}
if (pobj.IdentificationNumber && pobj.IdentificationNumber != 'undefined'){
obj.position_info.IdentificationNumber = pobj.IdentificationNumber;
}
if (pobj.phoneNumber && pobj.phoneNumber != 'undefined'){
obj.position_info.phoneNumber = pobj.phoneNumber;
}
if (pobj.contactAddress && pobj.contactAddress != 'undefined'){
obj.position_info.contactAddress = pobj.contactAddress;
}
if (pobj.legalpersonCertificate && pobj.legalpersonCertificate != 'undefined'){
obj.file_info.legalpersonCertificate = pobj.legalpersonCertificate;
}
if (pobj.cfoCertificate && pobj.cfoCertificate != 'undefined'){
obj.file_info.cfoCertificate = pobj.cfoCertificate;
}
if (pobj.titleCertificate && pobj.titleCertificate != 'undefined'){
obj.file_info.titleCertificate = pobj.titleCertificate;
}
if (pobj.naturalpersonCertificate && pobj.naturalpersonCertificate != 'undefined'){
obj.file_info.naturalpersonCertificate = obj.naturalpersonCertificate;
}
if (pobj.socialCertificate && pobj.socialCertificate != 'undefined'){
obj.file_info.socialCertificate = pobj.socialCertificate;
}
if (pobj.directorCertificate && pobj.directorCertificate != 'undefined'){
obj.file_info.directorCertificate = pobj.directorCertificate;
}
if (pobj.managerCertificate && pobj.managerCertificate != 'undefined'){
obj.file_info.managerCertificate = pobj.managerCertificate;
}
if (pobj.supervisorCertificate && pobj.supervisorCertificate != 'undefined'){
obj.file_info.supervisorCertificate = pobj.supervisorCertificate;
}
if (pobj.managerCertificate && pobj.managerCertificate != 'undefined'){
obj.file_info.managerCertificate = pobj.managerCertificate;
}
if (pobj.trackingNumber && pobj.trackingNumber != 'undefined'){
obj.express_info.trackingNumber = pobj.trackingNumber;
}
if (pobj.logisticsCompany && pobj.logisticsCompany != 'undefined'){
obj.express_info.logisticsCompany = pobj.logisticsCompany;
}
if (pobj.addresseeName && pobj.addresseeName != 'undefined'){
obj.express_info.addresseeName = pobj.addresseeName;
}
if (pobj.addresseePhone && pobj.addresseePhone != 'undefined'){
obj.express_info.addresseePhone = pobj.addresseePhone;
}
if (pobj.addresseeEmail && pobj.addresseeEmail != 'undefined'){
obj.express_info.addresseeEmail = pobj.addresseeEmail;
}
if (pobj.addresseeAddress && pobj.addresseeAddress != 'undefined'){
obj.express_info.addresseeAddress = pobj.addresseeAddress;
}
if (pobj.expressStatus && pobj.expressStatus != 'undefined'){
obj.express_info.expressStatus = pobj.expressStatus;
} }
return await this.create(obj,t); return await this.create(obj,t);
} }
......
...@@ -23,9 +23,105 @@ class SchemeDao extends Dao { ...@@ -23,9 +23,105 @@ class SchemeDao extends Dao {
/*根据方案编号更新方案详情*/ /*根据方案编号更新方案详情*/
async updateInfoBySchemeNumber(qobj,t){ async updateInfoBySchemeNumber(qobj,t){
var setobj = {"scheme_info":qobj.planInfo};
var whereobj = {"scheme_number":qobj.schemeNumber}; var whereobj = {"scheme_number":qobj.schemeNumber};
return await this.updateByWhere(setobj,whereobj,t); var setobj = await this.findOne(whereobj);
if (setobj){
if (qobj.businessMode && qobj.businessMode != 'undefined'){
setobj.demand_code = qobj.businessMode;
}
if (qobj.statusReason && qobj.statusReason != 'undefined'){
setobj.reject_reason = qobj.statusReason;
}
if (qobj.memoInfo && qobj.memoInfo != 'undefined'){
setobj.remark_info = qobj.memoInfo;
}
if (qobj.businessId && qobj.businessId != 'undefined'){
setobj.bizopt_id = qobj.businessId;
}
if (qobj.servicerCode && qobj.servicerCode != 'undefined'){
setobj.facilitator_id = qobj.servicerCode;
}
if (qobj.servicerName && qobj.servicerName != 'undefined'){
setobj.facilitator_name = qobj.servicerName;
}
if (qobj.clerkOpcode && qobj.clerkOpcode != 'undefined'){
setobj.salesman_opcode = qobj.clerkOpcode;
}
if (qobj.clerkId && qobj.clerkId != 'undefined'){
setobj.salesman_id = qobj.clerkId;
}
if (qobj.clerkName && qobj.clerkName != 'undefined'){
setobj.salesman_name = qobj.clerkName;
}
if (qobj.clerkPhone && qobj.clerkPhone != 'undefined'){
setobj.salesman_phone = qobj.clerkPhone;
}
if (qobj.taxpayerType && qobj.taxpayerType != 'undefined'){
setobj.scheme_info.taxpayerType = qobj.taxpayerType;
}
if (qobj.registeredType && qobj.registeredType != 'undefined'){
setobj.scheme_info.registeredType = qobj.registeredType;
}
if (qobj.companyProperties && qobj.companyProperties != 'undefined'){
setobj.scheme_info.companyProperties = qobj.companyProperties;
}
if (qobj.engagedIndustry && qobj.engagedIndustry != 'undefined'){
setobj.scheme_info.engagedIndustry = qobj.engagedIndustry;
}
if (qobj.addressType && qobj.addressType != 'undefined'){
setobj.scheme_info.addressType = qobj.addressType;
}
if (qobj.fullAddress && qobj.fullAddress != 'undefined'){
setobj.scheme_info.fullAddress = qobj.fullAddress;
}
if (qobj.businessScope && qobj.businessScope != 'undefined'){
setobj.scheme_info.businessScope = qobj.businessScope;
}
if (qobj.isWhether && qobj.isWhether != 'undefined'){
setobj.scheme_info.isWhether = qobj.isWhether;
}
if (qobj.whetherType && qobj.whetherType != 'undefined'){
setobj.scheme_info.whetherType = qobj.whetherType;
}
if (qobj.subjectType && qobj.subjectType != 'undefined'){
setobj.scheme_info.subjectType = qobj.subjectType;
}
if (qobj.buyTime && qobj.buyTime != 'undefined'){
setobj.scheme_info.buyTime = qobj.buyTime;
}
if (qobj.buyDuration && qobj.buyDuration != 'undefined'){
setobj.scheme_info.buyDuration = qobj.buyDuration;
}
if (qobj.isRenew && qobj.isRenew != 'undefined'){
setobj.scheme_info.isRenew = qobj.isRenew;
}
if (qobj.creditCode && qobj.creditCode != 'undefined'){
setobj.scheme_info.creditCode = qobj.creditCode;
}
if (qobj.companyType && qobj.companyType != 'undefined'){
setobj.scheme_info.companyType = qobj.companyType;
}
if (qobj.establishedTime && qobj.establishedTime != 'undefined'){
setobj.scheme_info.establishedTime = qobj.establishedTime;
}
if (qobj.registeredCapital && qobj.registeredCapital != 'undefined'){
setobj.scheme_info.registeredCapital = qobj.registeredCapital;
}
if (qobj.shareholderName && qobj.shareholderName != 'undefined'){
setobj.scheme_info.shareholderName = qobj.shareholderName;
}
if (qobj.businessTerm && qobj.businessTerm != 'undefined'){
setobj.scheme_info.businessTerm = qobj.businessTerm;
}
if (qobj.residenceAddress && qobj.residenceAddress != 'undefined'){
setobj.scheme_info.residenceAddress = qobj.residenceAddress;
}
return await this.updateByWhere(setobj,whereobj,t);
}
else{
return -1;
}
} }
/*根据商机编号更新方案编号*/ /*根据商机编号更新方案编号*/
...@@ -38,40 +134,111 @@ class SchemeDao extends Dao { ...@@ -38,40 +134,111 @@ class SchemeDao extends Dao {
/*插入方案信息*/ /*插入方案信息*/
async insertInfo(qobj,t){ async insertInfo(qobj,t){
var obj = { var obj = {
"demand_code":qobj.businessMode, "demand_code":qobj.businessMode
"scheme_info":qobj.planInfo,
"scheme_status":qobj.currentStatus
}; };
if (qobj.currentStatus && qobj.currentStatus != 'undefined'){
obj["scheme_status"] = qobj.currentStatus;
}
if (qobj.schemeNumber && qobj.schemeNumber != 'undefined'){ if (qobj.schemeNumber && qobj.schemeNumber != 'undefined'){
obj["scheme_number"] = qobj.schemeNumber; obj["scheme_number"] = qobj.schemeNumber;
} }
if (qobj.statusReason && qobj.statusReason != 'undefined'){ if (qobj.statusReason && qobj.statusReason != 'undefined'){
obj["reject_reason"] = qobj.statusReason; obj["reject_reason"] = qobj.statusReason;
} }
if (qobj.memoInfo && qobj.memoInfo != 'undefined'){ if (qobj.memoInfo && qobj.memoInfo != 'undefined'){
obj["remark_info"] = qobj.memoInfo; obj["remark_info"] = qobj.memoInfo;
} }
if (qobj.businessId && qobj.businessId != 'undefined'){ if (qobj.businessId && qobj.businessId != 'undefined'){
obj["bizopt_id"] = qobj.businessId; obj["bizopt_id"] = qobj.businessId;
} }
if (qobj.servicerCode && qobj.servicerCode != 'undefined'){ if (qobj.servicerCode && qobj.servicerCode != 'undefined'){
obj["facilitator_id"] = qobj.servicerCode; obj["facilitator_id"] = qobj.servicerCode;
} }
if (qobj.servicerName && qobj.servicerName != 'undefined'){ if (qobj.servicerName && qobj.servicerName != 'undefined'){
obj["facilitator_name"] = qobj.servicerName; obj["facilitator_name"] = qobj.servicerName;
} }
if (qobj.clerkOpcode && qobj.clerkOpcode != 'undefined'){ if (qobj.clerkOpcode && qobj.clerkOpcode != 'undefined'){
obj["salesman_opcode"] = qobj.clerkOpcode; obj["salesman_opcode"] = qobj.clerkOpcode;
} }
if (qobj.clerkId && qobj.clerkId != 'undefined'){ if (qobj.clerkId && qobj.clerkId != 'undefined'){
obj["salesman_id"] = qobj.clerkId; obj["salesman_id"] = qobj.clerkId;
} }
if (qobj.clerkName && qobj.clerkName != 'undefined'){ if (qobj.clerkName && qobj.clerkName != 'undefined'){
obj["salesman_name"] = qobj.clerkName; obj["salesman_name"] = qobj.clerkName;
} }
if (qobj.clerkPhone && qobj.clerkPhone != 'undefined'){ if (qobj.clerkPhone && qobj.clerkPhone != 'undefined'){
obj["salesman_phone"] = qobj.clerkPhone; obj["salesman_phone"] = qobj.clerkPhone;
}
var scheme_info = {};
if (qobj.companyName && qobj.companyName != 'undefined'){
scheme_info.companyName = qobj.companyName;
}
if (qobj.taxpayerType && qobj.taxpayerType != 'undefined'){
scheme_info.taxpayerType = qobj.taxpayerType;
}
if (qobj.registeredType && qobj.registeredType != 'undefined'){
scheme_info.registeredType = qobj.registeredType;
}
if (qobj.companyProperties && qobj.companyProperties != 'undefined'){
scheme_info.companyProperties = qobj.companyProperties;
}
if (qobj.engagedIndustry && qobj.engagedIndustry != 'undefined'){
scheme_info.engagedIndustry = qobj.engagedIndustry;
}
if (qobj.addressType && qobj.addressType != 'undefined'){
scheme_info.addressType = qobj.addressType;
}
if (qobj.fullAddress && qobj.fullAddress != 'undefined'){
scheme_info.fullAddress = qobj.fullAddress;
}
if (qobj.businessScope && qobj.businessScope != 'undefined'){
scheme_info.businessScope = qobj.businessScope;
}
if (qobj.isWhether && qobj.isWhether != 'undefined'){
scheme_info.isWhether = qobj.isWhether;
}
if (qobj.whetherType && qobj.whetherType != 'undefined'){
scheme_info.whetherType = qobj.whetherType;
} }
if (qobj.subjectType && qobj.subjectType != 'undefined'){
scheme_info.subjectType = qobj.subjectType;
}
if (qobj.buyTime && qobj.buyTime != 'undefined'){
scheme_info.buyTime = qobj.buyTime;
}
if (qobj.buyDuration && qobj.buyDuration != 'undefined'){
scheme_info.buyDuration = qobj.buyDuration;
}
if (qobj.isRenew && qobj.isRenew != 'undefined'){
scheme_info.isRenew = qobj.isRenew;
}
if (qobj.creditCode && qobj.creditCode != 'undefined'){
scheme_info.creditCode = qobj.creditCode;
}
if (qobj.companyType && qobj.companyType != 'undefined'){
scheme_info.companyType = qobj.companyType;
}
if (qobj.establishedTime && qobj.establishedTime != 'undefined'){
scheme_info.establishedTime = qobj.establishedTime;
}
if (qobj.registeredCapital && qobj.registeredCapital != 'undefined'){
scheme_info.registeredCapital = qobj.registeredCapital;
}
if (qobj.shareholderName && qobj.shareholderName != 'undefined'){
scheme_info.shareholderName = qobj.shareholderName;
}
if (qobj.businessTerm && qobj.businessTerm != 'undefined'){
scheme_info.businessTerm = qobj.businessTerm;
}
if (qobj.residenceAddress && qobj.residenceAddress != 'undefined'){
scheme_info.residenceAddress = qobj.residenceAddress;
}
obj["scheme_info"] = scheme_info;
// console.log("SSSSSSSSSSSSSSSSSSSSSS");
// console.log(obj);
// console.log("SSSSSSSSSSSSSSSSSSSSSS");
return await this.create(obj,t); return await this.create(obj,t);
} }
......
...@@ -14,11 +14,12 @@ module.exports = { ...@@ -14,11 +14,12 @@ module.exports = {
"node_type":{"org":"组织","arc":"文档"}, "node_type":{"org":"组织","arc":"文档"},
"source": {//渠道来源 "source": {//渠道来源
"tencentCloud": "腾讯云" "tencentCloud": "腾讯云"
}, },
"businessType": {//商机类型 "businessType": {//商机类型
"companyCase": "公司注册", "companyCase": "公司注册",
"psCase": "个体户注册", "psCase":"园区注册",
"soleCase": "个人独资企业注册", // "psCase": "个体户注册",
// "soleCase": "个人独资企业注册",
"agentCase": "代理记账", "agentCase": "代理记账",
"regAddrCase": "注册地址", "regAddrCase": "注册地址",
"icCheckCase": "工商年报", "icCheckCase": "工商年报",
......
...@@ -25,5 +25,13 @@ class DeliverybillService extends ServiceBase { ...@@ -25,5 +25,13 @@ class DeliverybillService extends ServiceBase {
}); });
} }
/*插入交付单信息*/
async insertInfo(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.insertInfo(qobj,t);
});
}
} }
module.exports = DeliverybillService; module.exports = DeliverybillService;
\ No newline at end of file
...@@ -12,7 +12,7 @@ class MaterialService extends ServiceBase { ...@@ -12,7 +12,7 @@ class MaterialService extends ServiceBase {
// return apps; // return apps;
// } // }
/*根据交付单id获取缓存详情*/ /*根据交付单id获取注册材料信息详情*/
async findInfoByDeliverId(qobj){ async findInfoByDeliverId(qobj){
return await this.dao.findInfoByDeliverId(qobj); return await this.dao.findInfoByDeliverId(qobj);
} }
......
...@@ -30,6 +30,7 @@ class ExecClient { ...@@ -30,6 +30,7 @@ class ExecClient {
async execPost(subData, url) { async execPost(subData, url) {
let cmd = this.FetchPostCmd(subData, url); let cmd = this.FetchPostCmd(subData, url);
console.log("__________________" + cmd);
var result = await this.exec(cmd); var result = await this.exec(cmd);
return result; return result;
} }
......
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