Commit 3b7a4952 by 高宇强

Merge branch 'ic-deliver' of gitlab.gongsibao.com:jiangyong/zhichan into ic-deliver

parents c67ad416 6bca5559
...@@ -50,36 +50,41 @@ class BizOptCtl extends CtlBase { ...@@ -50,36 +50,41 @@ class BizOptCtl extends CtlBase {
var rarr = {} var rarr = {}
if (rs){ if (rs){
var statusInfo = {"currentStatus":rs.business_status};//商机状态 var statusInfo = {"currentStatus":rs.business_status};//商机状态
var bussinessInfo = {}; var businessInfo = {};
bussinessInfo.businessMode = rs.demand_code;//商机编号 businessInfo.businessMode = rs.demand_code;//商机编号
bussinessInfo.channelSource = rs.source_name;//渠道来源 businessInfo.channelSource = appconfig.pdict.source[rs.source_name];///渠道来源
bussinessInfo.businessType = rs.business_type;//商机类型代码 // businessInfo.businessType = rs.business_type;//商机类型代码
bussinessInfo.businessName = appconfig.pdict.businessType[rarr.businessType];//商机类型名称 businessInfo.businessType = appconfig.pdict.businessType[rs.business_type];//商机类型名称
bussinessInfo.serviceCode = rs.service_address;//服务地区 // businessInfo.serviceArea = rs.service_address;//服务地区
if (bussinessInfo.businessName == "云上园区注册"){ if (businessInfo.businessName == "云上园区注册"){
bussinessInfo.serviceName = appconfig.pdict.registeredParkDict[bussinessInfo.serviceCode];//服务地区名称 businessInfo.serviceArea = appconfig.pdict.registeredParkDict[rs.service_address];//服务地区名称
} }
else{ else{
bussinessInfo.serviceName = appconfig.pdict.registeredAreaDict[bussinessInfo.serviceCode];//服务地区名称 businessInfo.serviceArea = appconfig.pdict.registeredAreaDict[rs.service_address];//服务地区名称
} }
bussinessInfo.statusReason = rs.close_reason;//商机关闭原因 if (businessInfo.businessName == "注册地址"){
bussinessInfo.memoInfo = rs.business_info.memoInfo;//备注信息 businessInfo.registeredAddress = appconfig.pdict.registeredAreaDict[rs.service_address];//注册地址名称
bussinessInfo.contactsName = rs.business_info.contactsName;//联系人名称 }
bussinessInfo.contactsPhone = rs.business_info.contactsPhone;//联系人联系方式 businessInfo.statusReason = rs.close_reason;//商机关闭原因
bussinessInfo.createdTime = this.timeFormat(rs.created_at);//商机创建时间 businessInfo.memoInfo = rs.business_info.memoInfo;//备注信息
rarr.push(statusInfo); businessInfo.contactsName = rs.business_info.contactsName;//联系人名称
rarr.push(bussinessInfo); businessInfo.contactsPhone = rs.business_info.contactsPhone;//联系人联系方式
businessInfo.createdTime = this.timeFormat(rs.created_at);//商机创建时间
rarr.statusInfo = statusInfo;
rarr.businessInfo = businessInfo;
} }
if (ms){ if (ms){
var planInfo = ms.scheme_info; var planInfo = ms.scheme_info;
planInfo.schemeNumber = ms.scheme_number; planInfo.schemeNumber = ms.scheme_number;
planInfo.currentStatus = ms.scheme_status; planInfo.currentStatus = ms.scheme_status;
planInfo.statusReason = ms.reject_reason; planInfo.statusReason = ms.reject_reason;
rarr.push(planInfo); rarr.planInfo = planInfo;
} }
return system.getResult(rarr); return system.getResult(rarr);
} }
catch(error){ catch(error){
console.log("eeeeeeeeeeeeeeeeeeeeee");
console.log(error);
return system.getResultError(error); return system.getResultError(error);
} }
} }
......
...@@ -134,30 +134,34 @@ class DeliverybillCtl extends CtlBase { ...@@ -134,30 +134,34 @@ class DeliverybillCtl extends CtlBase {
} }
} }
async UpdateofficialSealByDeliverCode(pobj,qobj,req){//
if ((pobj.deliverNumber && pobj.deliverNumber != 'undefined' && ((pobj.baseInfo.officialSeal && pobj.baseInfo.officialSeal != 'undefined') || (pobj.baseInfo.businessLicense && pobj.baseInfo.businessLicense != 'undefined')))){
var rs = await this.service.findInfoByDeliverCode(pobj)//先得到交付单详情
if (pobj.baseInfo.officialSeal && pobj.baseInfo.officialSeal != 'undefined'){
rs.delivery_info.officialSeal = pobj.baseInfo.officialSeal;
}
if (pobj.baseInfo.businessLicense && pobj.baseInfo.businessLicense != 'undefined'){
rs.delivery_info.businessLicense = pobj.baseInfo.businessLicense;
}
//更新详情
var uarr = {
"deliverNumber":pobj.deliverNumber,
"baseInfo":rs.delivery_info
};
await this.service.updateInfoByDeliverCode(uarr);
return system.getResult("更新成功");
}
else{
return system.getResultError("参数错误!");
}
}
/*根据交付单编号更新交付单详情*/ /*根据交付单编号更新交付单详情*/
async updateInfoByDeliverCode(pobj,qobj,req){// async updateInfoByDeliverCode(pobj,qobj,req){//
if (pobj.deliverNumber && pobj.deliverNumber != 'undefined'){ if (pobj.deliverNumber && pobj.deliverNumber != 'undefined'){
try{ try{
//更新详情
//判断工商扫描件和营业执照扫描件是否存在,若存在更新交付单的详情 await this.service.updateInfoByDeliverCode(pobj);
if ((pobj.baseInfo.officialSeal && pobj.baseInfo.officialSeal != 'undefined') || (pobj.baseInfo.businessLicense && pobj.baseInfo.businessLicense != 'undefined')){
var rs = await this.service.findInfoByDeliverCode(pobj)//先得到交付单详情
var deliveryInfo = rs.delivery_info;
if (pobj.baseInfo.officialSeal && pobj.baseInfo.officialSeal != 'undefined'){
deliveryInfo.officialSeal = pobj.baseInfo.officialSeal;
}
if (pobj.baseInfo.businessLicense && pobj.baseInfo.businessLicense != 'undefined'){
deliveryInfo.businessLicense = pobj.baseInfo.businessLicense;
}
//更新详情
var uarr = {
"deliverNumber":pobj.deliverNumber,
"deliveryInfo":deliveryInfo
};
await this.service.updateInfoByDeliverCode(uarr);
}
//更新材料信息 //更新材料信息
await this.materialService.updateInfoByDeliverNumber(pobj); await this.materialService.updateInfoByDeliverNumber(pobj);
var statusInfo = { var statusInfo = {
...@@ -213,7 +217,7 @@ class DeliverybillCtl extends CtlBase { ...@@ -213,7 +217,7 @@ class DeliverybillCtl extends CtlBase {
"actionType":"updateOrderStatus", "actionType":"updateOrderStatus",
"actionBody":{ "actionBody":{
"orderNum": pobj.businessMode,//订单编码 "orderNum": pobj.businessMode,//订单编码
"status":2,//已接单 "status":20,//已接单
"deliverContent":pobj "deliverContent":pobj
} }
} }
......
...@@ -9,6 +9,12 @@ class DeliverybillDao extends Dao { ...@@ -9,6 +9,12 @@ class DeliverybillDao extends Dao {
qc.raw = true; qc.raw = true;
//检查查询的用户所属公司是否是平台运营公司-1,如果是则不添加公司查询条件, 不添加路径条件,返回所有数据 //检查查询的用户所属公司是否是平台运营公司-1,如果是则不添加公司查询条件, 不添加路径条件,返回所有数据
if (qobj.company_id == 1) { if (qobj.company_id == 1) {
if (qobj.bizpath && qobj.bizpath != "") {
if (qobj.bizpath.indexOf("pmxdeliverrequest") > 0) {//说明是从商机列表过来的
qw["delivery_status"] = "success";
qw["settle_status"] = "waittosettle";
}
}
return qw return qw
} else { } else {
//需要添加公司查询条件 //需要添加公司查询条件
...@@ -27,7 +33,6 @@ class DeliverybillDao extends Dao { ...@@ -27,7 +33,6 @@ class DeliverybillDao extends Dao {
qw["salesman_id"] = qobj.userid; qw["salesman_id"] = qobj.userid;
} }
} }
} }
} }
return qw; return qw;
...@@ -52,7 +57,7 @@ class DeliverybillDao extends Dao { ...@@ -52,7 +57,7 @@ class DeliverybillDao extends Dao {
/*根据交付单更新交付材料信息*/ /*根据交付单更新交付材料信息*/
async UpdateInfoByDeliverCode(qobj, t) {//公司注册、云上园区注册时填写交付材料 async UpdateInfoByDeliverCode(qobj, t) {//公司注册、云上园区注册时填写交付材料
var whereobj = { "delivery_code": qobj.deliverNumber }; var whereobj = { "delivery_code": qobj.deliverNumber };
var setobj = { "delivery_info": qobj.deliveryInfo }; var setobj = { "delivery_info": qobj.baseInfo };
return await this.updateByWhere(setobj, whereobj, t); return await this.updateByWhere(setobj, whereobj, t);
} }
......
...@@ -28,7 +28,7 @@ class MaterialDao extends Dao { ...@@ -28,7 +28,7 @@ class MaterialDao extends Dao {
setobj.position_info = qobj.positionInfo; setobj.position_info = qobj.positionInfo;
} }
if (qobj.managerInfo && qobj.managerInfo != 'undefined'){ if (qobj.managerInfo && qobj.managerInfo != 'undefined'){
setobj.position_info = setobj.position_info; setobj.position_info = qobj.managerInfo;
} }
if (qobj.regInfo && qobj.regInfo != 'undefined'){ if (qobj.regInfo && qobj.regInfo != 'undefined'){
setobj.file_info = qobj.regInfo; setobj.file_info = qobj.regInfo;
......
...@@ -24,7 +24,7 @@ class SchemeDao extends Dao { ...@@ -24,7 +24,7 @@ class SchemeDao extends Dao {
/*根据商机编号更新方案详情*/ /*根据商机编号更新方案详情*/
async updateInfoByDemandCode(qobj,t){ async updateInfoByDemandCode(qobj,t){
var whereobj = {"demand_code":qobj.businessMode}; var whereobj = {"demand_code":qobj.businessMode};
var setobj = {"scheme_info":qobj.planInfo,"scheme_status":qobj.currentStatus}; var setobj = {"scheme_info":qobj.baseInfo,"scheme_status":qobj.currentStatus};
return await this.updateByWhere(setobj,whereobj,t); return await this.updateByWhere(setobj,whereobj,t);
} }
......
...@@ -113,7 +113,7 @@ module.exports = { ...@@ -113,7 +113,7 @@ module.exports = {
}, },
"TaxpayerTypeDict": {//纳税人类型 "TaxpayerTypeDict": {//纳税人类型
"smallScaleTaxpayer": "小规模纳税人", "smallScaleTaxpayer": "小规模纳税人",
"generalTaxpayer": "一般纳税人" "generalTaxpayer": "一般纳税人"
}, },
"companyNatureDict": {//公司类型 "companyNatureDict": {//公司类型
"limitedLiabilityCompany": "有限责任公司", "limitedLiabilityCompany": "有限责任公司",
...@@ -159,6 +159,12 @@ module.exports = { ...@@ -159,6 +159,12 @@ module.exports = {
"company": "公司", "company": "公司",
"individual": "个体户" "individual": "个体户"
}, },
"buyDurationDict": {//购买时长
"buyDuration": "1年",
},
"isRenewDict": {//是否自动续费
"isRenew": "开启",
},
"dyDict":{//产品对应关系 "dyDict":{//产品对应关系
"/ic/gsreg/":"companyCase", "/ic/gsreg/":"companyCase",
"/ic/kzfw/":"sealSevCase", "/ic/kzfw/":"sealSevCase",
...@@ -168,7 +174,7 @@ module.exports = { ...@@ -168,7 +174,7 @@ module.exports = {
"/ic/sksq/":"taxControlCase", "/ic/sksq/":"taxControlCase",
"/ic/dljz/":"agentCase", "/ic/dljz/":"agentCase",
"/ic/regaddr/":"regAddrCase", "/ic/regaddr/":"regAddrCase",
"/ic/gsnj/":"icCheckCase", "/ic/gsnb/":"icCheckCase",
"/ic/gschangs/":"icChangeCase", "/ic/gschangs/":"icChangeCase",
"/ic/sbopen/":"ssOpenCase" "/ic/sbopen/":"ssOpenCase"
}, },
...@@ -181,7 +187,7 @@ module.exports = { ...@@ -181,7 +187,7 @@ module.exports = {
"taxControlCase":"/ic/sksq/", "taxControlCase":"/ic/sksq/",
"agentCase":"/ic/dljz/", "agentCase":"/ic/dljz/",
"regAddrCase":"/ic/regaddr/", "regAddrCase":"/ic/regaddr/",
"icCheckCase":"/ic/gsnj/", "icCheckCase":"/ic/gsnb/",
"icChangeCase":"/ic/gschangs/", "icChangeCase":"/ic/gschangs/",
"ssOpenCase":"/ic/sbopen/" "ssOpenCase":"/ic/sbopen/"
}, },
......
...@@ -50,6 +50,11 @@ module.exports = (db, DataTypes) => { ...@@ -50,6 +50,11 @@ module.exports = (db, DataTypes) => {
allowNull: false, allowNull: false,
type: DataTypes.STRING type: DataTypes.STRING
}, },
settle_status: {// 服务单流转状态
allowNull: false,
type: DataTypes.STRING,
defaultValue:'waittosettle'
},
selling_price: {//售价 selling_price: {//售价
allowNull: false, allowNull: false,
type: DataTypes.INTEGER type: DataTypes.INTEGER
......
const system = require("../../../system");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
/**
* 交付单表
*/
module.exports = (db, DataTypes) => {
return db.define("settlebill", {
code: { //交付单编号
allowNull: true,
type: DataTypes.STRING
},
audit_status: {// 审核状态
allowNull: false,
type: DataTypes.STRING,
defaultValue:'waittoaudit'
},
settle_amount: {//结算金额
allowNull: true,
type: DataTypes.INTEGER
},
isPayed:{
type:DataTypes.BOOLEAN,
defaultValue: false
}
}, {
paranoid: true,//真的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'fi_settlebill',
validate: {
},
indexes: [
// Create a unique index on email
// {
// unique: true,
// fields: ['email']
// },
//
// // Creates a gin index on data with the jsonb_path_ops operator
// {
// fields: ['data'],
// using: 'gin',
// operator: 'jsonb_path_ops'
// },
//
// // By default index name will be [table]_[fields]
// // Creates a multi column partial index
// {
// name: 'public_by_author',
// fields: ['author', 'status'],
// where: {
// status: 'public'
// }
// },
//
// // A BTREE index with a ordered field
// {
// name: 'title_index',
// method: 'BTREE',
// fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
// }
]
});
}
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
class SchemeService extends ServiceBase {
constructor() {
super("bizchance", ServiceBase.getDaoName(SchemeService));
}
async findById(qobj){//根据id获取方案信息
var oid = qobj.id;
return await this.dao.findById(oid);
}
async findInfoByDemandCode(qobj){//根据方案编号获取方案详情
return await this.dao.findInfoByDemandCode(qobj);
}
async updateStatusByDemandCode(qobj){//根据商机编号号更新方案状态及原因
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.updateStatusByDemandCode(qobj,t);
});
}
async updateInfoByDemandCode(qobj){//根据商机编号更新方案详情
var self = this;
return self.db.transaction(async function (t) {
return await self.dao.updateInfoByDemandCode(qobj,t);
});
}
async updateSchemeNumberByDemandCode(qobj){//根据商机编号更新方案编号
var self = this;
return self.db.transaction(async function (t) {
return await self.dao.updateSchemeNumberByDemandCode(qobj,t);
});
}
async insertInfo(qobj){//插入方案信息
var self = this;
return await self.db.transaction(async function (t) {
return await self.dao.insertInfo(qobj,t);
});
}
}
module.exports = SchemeService;
\ No newline at end of file
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