Commit 7daf2464 by 高宇强

gyq

parent 83bda4e5
......@@ -16,7 +16,7 @@ class Dao {
var u2 = this.preCreate(u);
if (t) {
console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>");
console.log( this.model);
//console.log( this.model);
return this.model.create(u2, { transaction: t }).then(u => {
return u;
});
......
......@@ -5,12 +5,35 @@ class BizoptDao extends Dao {
super(Dao.getModelName(BizoptDao));
}
extraWhere(qobj, qw, qc) {
extraWhere(qobj, qw, qc) {//根据业务员id获取商机信息的组装条件
qc.raw = true;
qc.where.business_type = qc.where.business_type || {
[this.db.Op.notIn]: ["ICP", "EDI"]
}
if(qobj.bizpath && qobj.bizpath!=""){
if(qobj.bizpath.indexOf("myChance")>0){//说明是从商机列表过来的
qw["salesman_id"]=qobj.userid;
}
}
return qw;
}
/*根据商机编号获取商机详情*/
async findInfoByDemandCode(qobj){
var qcwhere = {"demand_code":qobj.businessMode};
return await this.findOne(qcwhere);
}
async updateStatusByDemandCode(qobj,t){
var setobj = {"business_status":qobj.currentStatus};
if (qobj.statusReason && qobj.statusReason != 'undefined'){
setobj["close_reason"] = qobj.statusReason;
}
var whereobj = {"demand_code":qobj.businessMode};
return await this.updateByWhere(setobj,whereobj,t);
}
}
module.exports = BizoptDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class CacheinfoDao extends Dao {
constructor() {
super(Dao.getModelName(CacheinfoDao));
}
// extraWhere(qobj, qw, qc) {//根据业务员id获取商机信息的组装条件
// qc.raw = true;
// qc.where.business_type = qc.where.business_type || {
// [this.db.Op.notIn]: ["ICP", "EDI"]
// }
// if(qobj.bizpath && qobj.bizpath!=""){
// if(qobj.bizpath.indexOf("myChance")>0){//说明是从商机列表过来的
// qw["salesman_id"]=qobj.userid;
// }
// }
// return qw;
// }
/*根据订单id获取缓存信息详情*/
async findInfoByDeliverId(qobj){
var qcwhere = {"deliver_id":qobj.deliver_id};
return await this.findOne(qcwhere);
}
/*更加订单id更新缓存信息*/
async updateInfoByDeliverId(qobj,t){
var setobj = {"cache_info":qobj.cache_info};
var whereobj = {"deliver_id":qobj.deliver_id};
return await this.updateByWhere(setobj,whereobj,t);
}
/*插入缓存信息*/
async insertInfo(qobj,t){
var obj = {
"deliver_id":qobj.deliver_id,
"cache_info":qobj.cache_info
};
return await this.create(obj,t);
}
}
module.exports = CacheinfoDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class DeliverybillDao extends Dao {
constructor() {
super(Dao.getModelName(DeliverybillDao));
}
extraWhere(qobj, qw, qc) {//根据业务员id获取交付单信息的组装条件
qc.raw = true;
qc.where.product_code = qc.where.product_code || {
[this.db.Op.notIn]: ["ICP", "EDI"]
}
if(qobj.bizpath && qobj.bizpath!=""){
if(qobj.bizpath.indexOf("myChance")>0){//说明是从商机列表过来的
qw["salesman_id"]=qobj.userid;
}
}
return qw;
}
/*根据交付单编号获取订单详情*/
async findInfoByDeliverCode(qobj){
var qcwhere = {"delivery_code":qobj.deliverNumber};
return await this.findOne(qcwhere);
}
/*根据交付单编号更新状态信息*/
async updateInfoByDeliverCode(qobj,t){
var setobj = {"delivery_status":qobj.deliverStatus};
if (qobj.statusReason && qobj.statusReason != 'undefined'){
setobj.close_reason = qobj.statusReason;
}
var whereobj = {"delivery_code":qobj.deliverNumber};
return await this.updateByWhere(setobj,whereobj,t);
}
/*插入缓存信息*/
// async insertInfo(qobj,t){
// var obj = {
// "deliver_id":qobj.deliver_id,
// "cache_info":qobj.cache_info
// };
// return await this.create(obj,t);
// }
}
module.exports = DeliverybillDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class MaterialDao extends Dao {
constructor() {
super(Dao.getModelName(MaterialDao));
}
/*根据交付单id获取注册材料信息详情*/
async findInfoByDeliverId(qobj){
var qcwhere = {"delivery_id":qobj.deliverId};
return await this.findOne(qcwhere);
}
/*根据交付单id更新交付单编号*/
async updateInfoByDeliverId(qobj,t){
var setobj = {"delivery_code":qobj.deliverNumber};
var whereobj = {"delivery_id":qobj.deliverId};
return await this.updateByWhere(setobj,whereobj,t);
}
/*插入注册材料信息*/
async insertInfo(qobj,t){
var obj = {
"delivery_id":qobj.deliverId
};
if (qobj.deliverNumber != 'undefined'){
obj["delivery_code"] = qobj.deliverNumber;
}
if (qobj.companyInfo != 'undefined'){
obj["company_info"] = qobj.companyInfo;
}
if (qobj.registeredInfo != 'undefined'){
obj["registered_info"] = qobj.registeredInfo;
}
if (qobj.contributionInfo != 'undefined'){
obj["contribution_info"] = qobj.contributionInfo;
}
if (qobj.positionInfo != 'undefined'){
obj["position_info"] = qobj.positionInfo;
}
if (qobj.regInfo != 'undefined'){
obj["file_info"] = qobj.regInfo;
}
if (qobj.expressInfo != 'undefined'){
obj["express_info"] = qobj.expressInfo;
}
return await this.create(obj,t);
}
}
module.exports = MaterialDao;
const system = require("../../../system");
const Dao = require("../../dao.base");
class SchemeDao extends Dao {
constructor() {
super(Dao.getModelName(SchemeDao));
}
/*根据方案编号获取方案信息详情*/
async findInfoBySchemeNumber(qobj){
var qcwhere = {"scheme_number":qobj.schemeNumber};
return await this.findOne(qcwhere);
}
/*根据方案编号更新方案状态及原因*/
async updateStatusBySchemeNumber(qobj,t){
var setobj = {"scheme_status":qobj.currentStatus};
if (qobj.statusReason && qobj.statusReason != 'undefined'){
setobj["reject_reason"] = qobj.statusReason;
}
var whereobj = {"scheme_number":qobj.schemeNumber};
return await this.updateByWhere(setobj,whereobj,t);
}
/*根据方案编号更新方案详情*/
async updateInfoBySchemeNumber(qobj,t){
var setobj = {"scheme_info":qobj.planInfo};
var whereobj = {"scheme_number":qobj.schemeNumber};
return await this.updateByWhere(setobj,whereobj,t);
}
/*根据商机编号更新方案编号*/
async updateSchemeNumberByDemandCode(qobj,t){
var setobj = {"scheme_number":qobj.schemeNumber};
var whereobj = {"demand_code":qobj.businessMode};
return await this.updateByWhere(setobj,whereobj,t);
}
/*插入方案信息*/
async insertInfo(qobj,t){
var obj = {
"demand_code":qobj.businessMode,
"scheme_info":qobj.planInfo,
"scheme_status":qobj.currentStatus
};
if (qobj.schemeNumber && qobj.schemeNumber != 'undefined'){
obj["scheme_number"] = qobj.schemeNumber;
}
if (qobj.statusReason && qobj.statusReason != 'undefined'){
obj["reject_reason"] = qobj.statusReason;
}
if (qobj.memoInfo && qobj.memoInfo != 'undefined'){
obj["remark_info"] = qobj.memoInfo;
}
if (qobj.businessId && qobj.businessId != 'undefined'){
obj["bizopt_id"] = qobj.businessId;
}
if (qobj.servicerCode && qobj.servicerCode != 'undefined'){
obj["facilitator_id"] = qobj.servicerCode;
}
if (qobj.servicerName && qobj.servicerName != 'undefined'){
obj["facilitator_name"] = qobj.servicerName;
}
if (qobj.clerkOpcode && qobj.clerkOpcode != 'undefined'){
obj["salesman_opcode"] = qobj.clerkOpcode;
}
if (qobj.clerkId && qobj.clerkId != 'undefined'){
obj["salesman_id"] = qobj.clerkId;
}
if (qobj.clerkName && qobj.clerkName != 'undefined'){
obj["salesman_name"] = qobj.clerkName;
}
if (qobj.clerkPhone && qobj.clerkPhone != 'undefined'){
obj["salesman_phone"] = qobj.clerkPhone;
}
return await this.create(obj,t);
}
}
module.exports = SchemeDao;
......@@ -11,7 +11,134 @@ module.exports = {
"sex": {"male": "男", "female": "女"},
"logLevel": {"debug": 0, "info": 1, "warn": 2, "error": 3, "fatal": 4},
"msgType": { "sys": "系统", "single": "单点", "multi": "群发"},
"node_type":{"org":"组织","arc":"文档"}
"node_type":{"org":"组织","arc":"文档"},
"source": {//渠道来源
"tencentCloud": "腾讯云"
},
"businessType": {//商机类型
"companyCase": "公司注册",
"psCase": "个体户注册",
"soleCase": "个人独资企业注册",
"agentCase": "代理记账",
"regAddrCase": "注册地址",
"icCheckCase": "工商年报",
"openBankAccountCase": "银行开户",
"taxCase": "税务报道",
"taxControlCase": "税控申请",
"sealSevCase": "刻章服务",
"icChangeCase": "工商变更",
"ssOpenCase": "社保开户"
},
"businessStatus": {//商机状态
"beforeSubmission": "待提交方案",
"beforeConfirmation": "待用户确认",
"isFinished": "已成交",
"isexpired":"已到期",// 注册地址和代理记账
"isClosed": "已关闭"
},
"diliverStatus1": {//公司注册交付单状态
"received":"已接单",//接单日期
"collecting":"收集工商注册材料",//请配合顾问尽快提供
"auditing":"工商审核环节",//10个工作日内
"engraving":"刻章环节",//5个工作日内,只有选择了刻章服务时才有该状态
"posting":"证件邮寄环节",//3个工作日内
"signed":"已签收",
"closed":"关闭交付"//只有在已接单和收集工商注册材料阶段才能关闭交付
},
"diliverSataus2": {//云上园区注册交付状态
"received":"已接单",//接单日期
"uploading":"上传注册材料",//请配合顾问尽快提供
"checking":"园区入驻审核",//1个工作日完成
"auditing":"工商审核环节",//10个工作日内
"engraving":"刻章环节",//5个工作日内,只有选择了刻章服务时才有该状态
"posting":"证件邮寄环节",//3个工作日内
"signed":"已签收",
"closed":"关闭交付"//只有在已接单和收集工商注册材料阶段才能关闭交付
},
"diliverSataus3":{// 税务报道、税控申请、银行开户、工商年报、工商变更、社保开户、刻章服务交付状态
"paid":"已付款",
"received":"已接单",
"inservice":"服务中",
"completed":"已完成"
},
"diliverSataus4": {//代理记账、注册地址交付状态
"paid":"已付款",
"received":"已接单",
"inservice":"服务中",
"expired":"已到期"
},
"registeredAreaDict": {//注册地区
"beijing": "北京市",
"shanghai": "上海市",
"hangzhou": "杭州市",
"qingdao": "青岛市",
"suzhou": "苏州市",
"tianjin": "天津市",
"ningbo": "宁波市",
"najing": "南京市",
"wuxi": "无锡市",
"jinan": "济南市",
"wenzhou": "温州市",
"shijiazhuang": "石家庄市",
"jinhua": "金华市",
"changzhou": "常州市",
"nantong":"南通市",
"xuzhou": "徐州市",
"jiaxing": "嘉兴市",
"taizhou":"台州市",
"shaoxing":"绍兴市",
"taiyuan": "太原市",
"yantai": "烟台市",
"yangzhou": "扬州市"
},
"TaxpayerTypeDict": {//纳税人类型
"smallScaleTaxpayer": "小规模纳税人",
"generalTaxpayer": "一般纳税人人"
},
"companyNatureDict": {//公司类型
"limitedLiabilityCompany": "有限责任公司",
"incorporatedCompany": "股份有限公司",
"groupLimitedCompany ": "集团有限公司"
},
"engagedIndustryDict": {//从事行业
"culturalMedia": "文化传媒类",
"scienceAndTechnology": "科技类",
"filmIndustry": "影业类",
"trade": "贸易类",
"consult": "咨询类",
"advertisement": "广告类",
"administration": "管理类",
"lease": "租赁类",
"proxy": "代理类",
"train": "培训类",
"design": "设计类",
"service": "服务类",
"engineering": "工程类"
},
"SealSevCaseDict": {//是否刻章
"yes": "需要",
"no": "不需要"
},
"addressTypeDict": {//经营地址类型
" practical ": "实际经营地址",
"virtual": "虚拟地址"
},
"registeredTypeDict": {//个体户类型
"selfEmployed": "个体商户",
"soleProprietorship": "个人独资"
},
"registeredParkDict":{//注册园区
"shanghai":"上海云上公司",
"beijing":"北京云上公司"
},
"sealSevTypeDict": {//刻章类型
"company": "公司章",
"individual": "个体工商户章"
},
"agentTypeDict": {//代理记账主体类型
"company": "公司",
"individual ": "个体户"
}
}
}
}
const system = require("../../../system");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
/**
* 交付信息缓存表
*/
module.exports = (db, DataTypes) => {
return db.define("cacheinfo", {
deliver_id: { // 交付单id
allowNull: false,
type: DataTypes.INTEGER
},
cache_info: { // 缓存信息
allowNull: false,
type: DataTypes.JSON
}
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'cache_information',
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 moment = require('moment');
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
/**
* 材料信息表
*/
module.exports = (db, DataTypes) => {
return db.define("material", {
delivery_id: { // 交付单id
allowNull: false,
type: DataTypes.INTEGER
},
delivery_code: { // 交付单编号
allowNull: true,
type: DataTypes.STRING
},
company_info: { // 企业信息
allowNull: true,
type: DataTypes.JSON
},
registered_info: { // 注册资本信息
allowNull: true,
type: DataTypes.JSON
},
contribution_info: { // 出资比例信息
allowNull: true,
type: DataTypes.JSON
},
position_info: { // 任职信息
allowNull: true,
type: DataTypes.JSON
},
file_info: { // 注册文件信息
allowNull: true,
type: DataTypes.JSON
},
express_info: { // 邮寄信息
allowNull: true,
type: DataTypes.JSON
}
}, {
paranoid: false,//假的删除
underscored: true,
version: true,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
tableName: 'material_information',
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}]
// }
]
});
}
\ No newline at end of file
......@@ -32,7 +32,7 @@ module.exports = (db, DataTypes) => {
type: DataTypes.STRING
},
bizopt_id: { //商机id
allowNull: false,
allowNull: true,
type: DataTypes.STRING
},
facilitator_id: { //服务商id
......
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 findAndCountAll(obj) {
// var self = this;
// const apps = await this.dao.findAndCountAll(obj);
// return apps;
// }
/*根据id获取方案信息*/
async findById(qobj){
var oid = qobj.id;
return await this.dao.findById(oid);
}
/*根据方案编号获取方案详情*/
async findInfoBySchemeNumber(qobj){
return await this.dao.findInfoBySchemeNumber(qobj);
}
/* 根据方案编号更新方案状态及原因 */
async updateStatusBySchemeNumber(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.updateStatusBySchemeNumber(qobj,t);
});
}
/*根据方案编号更新方案详情*/
async updateInfoBySchemeNumber(qobj){
var self = this;
return self.db.transaction(async function (t) {
return await self.dao.updateInfoBySchemeNumber(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
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
class BizOptService extends ServiceBase {
constructor() {
super("bizchance", ServiceBase.getDaoName(BizOptService));
}
async findAndCountAll(obj) {
var self = this;
const apps = await this.dao.findAndCountAll(obj);
return apps;
}
/*根据商机编号获取商机详情*/
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);
});
}
}
module.exports = BizOptService;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
class CacheInfoService extends ServiceBase {
constructor() {
super("bizchance", ServiceBase.getDaoName(CacheInfoService));
}
// async findAndCountAll(obj) {
// var self = this;
// const apps = await this.dao.findAndCountAll(obj);
// return apps;
// }
/*根据交付单id获取缓存详情*/
async findInfoByDeliverId(qobj){
return await this.dao.findInfoByDeliverId(qobj);
}
/* 根据交付单id更新缓存信息 */
async updateInfoByDeliverId(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.updateInfoByDeliverId(qobj,t);
});
}
/*插入缓存信息*/
async insertInfo(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.insertInfo(qobj,t);
});
}
}
module.exports = CacheInfoService;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
class DeliverybillService extends ServiceBase {
constructor() {
super("bizchance", ServiceBase.getDaoName(DeliverybillService));
}
async findAndCountAll(obj) {
var self = this;
const apps = await this.dao.findAndCountAll(obj);
return apps;
}
/*根据交付单编号获取交付单详情*/
async findInfoByDeliverCode(qobj){
return await this.dao.findInfoByDeliverCode(qobj);
}
/* 根据交付单编号更新交付单状态 */
async updateInfoByDeliverCode(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.updateInfoByDeliverCode(qobj,t);
});
}
}
module.exports = DeliverybillService;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
const appconfig = system.getSysConfig();
class MaterialService extends ServiceBase {
constructor() {
super("bizchance", ServiceBase.getDaoName(MaterialService));
}
// async findAndCountAll(obj) {
// var self = this;
// const apps = await this.dao.findAndCountAll(obj);
// return apps;
// }
/*根据交付单id获取缓存详情*/
async findInfoByDeliverId(qobj){
return await this.dao.findInfoByDeliverId(qobj);
}
/* 根据交付单id更新交付单编号信息 */
async updateInfoByDeliverId(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.updateInfoByDeliverId(qobj,t);
});
}
/*插入缓存信息*/
async insertInfo(qobj){
var self=this;
return self.db.transaction(async function (t) {
return await self.dao.insertInfo(qobj,t);
});
}
}
module.exports = MaterialService;
\ 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