Commit 3977b6c4 by zhaoxiqing

gsb

parent 0f6ec154
...@@ -46,5 +46,12 @@ class TestAPI extends APIBase { ...@@ -46,5 +46,12 @@ class TestAPI extends APIBase {
} }
]; ];
} }
} }
module.exports = TestAPI; module.exports = TestAPI;
\ No newline at end of file
...@@ -6,6 +6,7 @@ class MerchantCtl extends CtlBase { ...@@ -6,6 +6,7 @@ class MerchantCtl extends CtlBase {
super("all", CtlBase.getServiceName(MerchantCtl)); super("all", CtlBase.getServiceName(MerchantCtl));
} }
//商户列表
async allList(qobj){ async allList(qobj){
var params = qobj || {}; var params = qobj || {};
this.doTimeCondition(params, ["signBegin", "signEnd"]); this.doTimeCondition(params, ["signBegin", "signEnd"]);
...@@ -17,6 +18,21 @@ class MerchantCtl extends CtlBase { ...@@ -17,6 +18,21 @@ class MerchantCtl extends CtlBase {
return system.getErrResult2("您的网络不稳, 请稍后重试"); return system.getErrResult2("您的网络不稳, 请稍后重试");
} }
} }
//商户查看
async merchantInfo(qobj){
var params = qobj || {};
try {
var page = await this.service.merchantInfo(params);
return system.getResult2(page);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
}
}
//数据概览 //数据概览
async dataSummarize(qobj){ async dataSummarize(qobj){
var params = qobj || {}; var params = qobj || {};
...@@ -123,58 +139,58 @@ class MerchantCtl extends CtlBase { ...@@ -123,58 +139,58 @@ class MerchantCtl extends CtlBase {
} }
} }
async merchantInfo(qobj) { // async merchantInfo(qobj) {
var obj = [ // var obj = [
{ // {
label: '服务商名称:', // label: '服务商名称:',
value: '舟山兰和科技有限公司' // value: '舟山兰和科技有限公司'
}, { // }, {
label: '联系人姓名:', // label: '联系人姓名:',
value: '钟韬晨' // value: '钟韬晨'
}, { // }, {
label: '联系人手机:', // label: '联系人手机:',
value: '17780611107' // value: '17780611107'
}, { // }, {
label: '联系地址:', // label: '联系地址:',
value: '浙江省舟山市定海区舟山港总和保税区企业服务中心01-3045室' // value: '浙江省舟山市定海区舟山港总和保税区企业服务中心01-3045室'
}, { // }, {
label: '开户行:', // label: '开户行:',
value: '浙商银行舟山分行营业部' // value: '浙商银行舟山分行营业部'
}, { // }, {
label: '对公账户:', // label: '对公账户:',
value: '3420020010120100174002' // value: '3420020010120100174002'
} // }
]; // ];
var obj1 = [ // var obj1 = [
{ // {
label: '合作方:', // label: '合作方:',
value: '开封市薪企云服人力资源服务有限公司' // value: '开封市薪企云服人力资源服务有限公司'
}, { // }, {
label: '合作方地址:', // label: '合作方地址:',
value: '开封市鼓楼区省府西街33号嘉斯茂金品数码广场2层1区202' // value: '开封市鼓楼区省府西街33号嘉斯茂金品数码广场2层1区202'
}, { // }, {
label: '合作方开户行:', // label: '合作方开户行:',
value: '中原银行股份有限公司开封卧龙支行' // value: '中原银行股份有限公司开封卧龙支行'
}, { // }, {
label: '合作方对公账户:', // label: '合作方对公账户:',
value: '410214010160010701' // value: '410214010160010701'
}, { // }, {
label: '签约合同:', // label: '签约合同:',
value: '浙商银行舟山分行营业部' // value: '浙商银行舟山分行营业部'
} // }
]; // ];
//
var contractUrl = "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_7711157622797891420191317618914兰和-开封.pdf"; // var contractUrl = "https://gsb-zc.oss-cn-beijing.aliyuncs.com//zc_7711157622797891420191317618914兰和-开封.pdf";
if (qobj.sign_body != "舟山兰和科技有限公司") { // if (qobj.sign_body != "舟山兰和科技有限公司") {
let config = await this.service.getConfig(qobj.sign_body); // let config = await this.service.getConfig(qobj.sign_body);
return system.getResultSuccess(config); // return system.getResultSuccess(config);
} // }
var rs = {}; // var rs = {};
rs.obj = obj; // rs.obj = obj;
rs.obj1 = obj1; // rs.obj1 = obj1;
rs.contractUrl = contractUrl; // rs.contractUrl = contractUrl;
return system.getResultSuccess(rs); // return system.getResultSuccess(rs);
} // }
async getMcht() { async getMcht() {
...@@ -186,4 +202,4 @@ class MerchantCtl extends CtlBase { ...@@ -186,4 +202,4 @@ class MerchantCtl extends CtlBase {
module.exports = MerchantCtl; module.exports = MerchantCtl;
\ No newline at end of file
var system = require("../../../system")
const CtlBase = require("../../ctl.base");
//招聘需求
class SignbodyCtl extends CtlBase {
constructor() {
super("all", CtlBase.getServiceName(SignbodyCtl));
}
async allList(qobj){
var params = qobj || {};
this.doTimeCondition(params, ["signBegin", "signEnd"]);
try {
var page = await this.service.signPage(params);
return system.getResult2(page);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
}
}
async signBodyInfo(qobj){
var params = qobj || {};
try {
if(!params.sign_body_id){
return system.getResultFail(-1,"参数错误");
}
var info = await this.service.findById(params.sign_body_id);
return system.getResult2(info);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
}
}
}
module.exports = SignbodyCtl;
...@@ -3,58 +3,59 @@ const CtlBase = require("../../ctl.base"); ...@@ -3,58 +3,59 @@ const CtlBase = require("../../ctl.base");
const uuidv4 = require('uuid/v4'); const uuidv4 = require('uuid/v4');
class UserCtl extends CtlBase { class UserCtl extends CtlBase {
constructor() { constructor() {
super("auth", CtlBase.getServiceName(UserCtl)); super("auth", CtlBase.getServiceName(UserCtl));
this.redisClient = system.getObject("util.redisClient"); this.redisClient = system.getObject("util.redisClient");
}
async login(pobj, qobj, req) {
let loginName = this.trim(pobj.loginName);
let password = this.trim(pobj.password);
try {
let user = await this.service.findOne({"userName": loginName});
if (!user) {
return system.getResultFail(-1, "用户不存在");
}
if (user.password !== this.encryptPasswd(password)) {
return system.getResultFail(-1, "用户名或密码错误");
}
let sid = await this.setLogin(user);
return system.getResultSuccess(sid);
} catch (error) {
console.log(error);
return system.getResultFail(500, "接口异常:" + error.message);
} }
}
async login(pobj, qobj, req) {
async register(pobj, qobj, req) { let loginName = this.trim(pobj.loginName);
try { let password = this.trim(pobj.password);
let user = await this.service.create({ try {
userName: this.trim(pobj.userName), let user = await this.service.findOne({"userName": loginName});
password: this.encryptPasswd(pobj.password), if (!user) {
mobile: this.trim(pobj.mobile), return system.getResultFail(-1, "用户不存在");
nickName: this.trim(pobj.nickName), }
sign_body: this.trim(pobj.sign_body),
isAdmin: Number(pobj.isAdmin) ? true : false, if (user.password !== this.encryptPasswd(password)) {
}); return system.getResultFail(-1, "用户名或密码错误");
}
return system.getResultSuccess(user);
} catch (error) { let sid = await this.setLogin(user);
console.log(error); return system.getResultSuccess(sid);
if (error.message == 'Validation error') { } catch (error) {
return system.getResult(-1, "用户名已存在"); console.log(error);
} return system.getResultFail(500, "接口异常:" + error.message);
return system.getResultFail(500, "接口异常:" + error.message); }
}
async register(pobj, qobj, req) {
try {
let user = await this.service.create({
userName: this.trim(pobj.userName),
password: this.encryptPasswd(pobj.password),
mobile: this.trim(pobj.mobile),
nickName: this.trim(pobj.nickName),
sign_body: this.trim(pobj.sign_body),
sign_body_id: this.trim(pobj.sign_body_id),
isAdmin: Number(pobj.isAdmin) ? true : false,
});
return system.getResultSuccess(user);
} catch (error) {
console.log(error);
if (error.message == 'Validation error') {
return system.getResult(-1, "用户名已存在");
}
return system.getResultFail(500, "接口异常:" + error.message);
}
} }
}
async setLogin(user) { async setLogin(user) {
let sid = uuidv4(); let sid = uuidv4();
await this.redisClient.setWithEx(sid, JSON.stringify(user), 60 * 60 * 5); await this.redisClient.setWithEx(sid, JSON.stringify(user), 60 * 60 * 5);
return sid; return sid;
} }
} }
module.exports = UserCtl; module.exports = UserCtl;
\ No newline at end of file
...@@ -6,19 +6,19 @@ class electroniccontractDao extends Dao { ...@@ -6,19 +6,19 @@ class electroniccontractDao extends Dao {
super(Dao.getModelName(electroniccontractDao)); super(Dao.getModelName(electroniccontractDao));
} }
async statCount(companyNames, sign_body) { async statCount(companyNames, sign_body_id) {
var result = {}; var result = {};
if(!companyNames || companyNames.length == 0) { if(!companyNames || companyNames.length == 0) {
return result; return result;
} }
let and = []; let and = [];
and.push("company_name IN (:companyNames)"); and.push("company_name IN (:companyNames)");
if (sign_body) { if (sign_body_id) {
and.push("AND sign_body = :sign_body"); and.push("AND sign_body_id = :sign_body_id");
} }
var sql = `SELECT company_name, COUNT(1) AS num FROM electronic_contract_info WHERE ${and.join(" ")} GROUP BY company_name`; var sql = `SELECT company_name, COUNT(1) AS num FROM electronic_contract_info WHERE ${and.join(" ")} GROUP BY company_name`;
let list = await this.customQuery(sql, {companyNames: companyNames, sign_body: sign_body}); let list = await this.customQuery(sql, {companyNames: companyNames, sign_body_id: sign_body_id});
if(!list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
} }
...@@ -77,8 +77,8 @@ class electroniccontractDao extends Dao { ...@@ -77,8 +77,8 @@ class electroniccontractDao extends Dao {
if (params.company_name) { if (params.company_name) {
sql.push("AND company_name = :company_name"); sql.push("AND company_name = :company_name");
} }
if(params.sign_body){ if(params.sign_body_id){
sql.push("AND sign_body = :sign_body"); sql.push("AND sign_body_id = :sign_body_id");
} }
if(params.id_no) { if(params.id_no) {
sql.push("AND id_no = :id_no"); sql.push("AND id_no = :id_no");
...@@ -92,4 +92,4 @@ class electroniccontractDao extends Dao { ...@@ -92,4 +92,4 @@ class electroniccontractDao extends Dao {
} }
} }
module.exports = electroniccontractDao; module.exports = electroniccontractDao;
\ No newline at end of file
...@@ -6,20 +6,20 @@ class LoadDao extends Dao { ...@@ -6,20 +6,20 @@ class LoadDao extends Dao {
super(Dao.getModelName(LoadDao)); super(Dao.getModelName(LoadDao));
} }
async statCount(companyNames, sign_body) { async statCount(companyNames, sign_body_id) {
var result = {}; var result = {};
if(!companyNames || companyNames.length == 0) { if(!companyNames || companyNames.length == 0) {
return result; return result;
} }
let and = []; let and = [];
and.push("company_name IN (:companyNames)"); and.push("company_name IN (:companyNames)");
if (sign_body) { if (sign_body_id) {
and.push("AND sign_body = :sign_body"); and.push("AND sign_body_id = :sign_body_id");
} }
var sql = `SELECT company_name, COUNT(1) AS num FROM load_info WHERE ${and.join(" ")} GROUP BY company_name`; var sql = `SELECT company_name, COUNT(1) AS num FROM load_info WHERE ${and.join(" ")} GROUP BY company_name`;
let list = await this.customQuery(sql, {companyNames: companyNames, sign_body: sign_body}); let list = await this.customQuery(sql, {companyNames: companyNames, sign_body_id: sign_body_id});
if(!list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
...@@ -51,4 +51,4 @@ class LoadDao extends Dao { ...@@ -51,4 +51,4 @@ class LoadDao extends Dao {
} }
} }
module.exports = LoadDao; module.exports = LoadDao;
\ No newline at end of file
...@@ -5,6 +5,24 @@ class MerchantDao extends Dao { ...@@ -5,6 +5,24 @@ class MerchantDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(MerchantDao)); super(Dao.getModelName(MerchantDao));
} }
async merchantInfo(params){
let sql = [];
sql.push("SELECT * FROM merchant_info WHERE 1 = 1 ");
this.setSqlParams(params, sql);
return await this.customQuery(sql.join(" "), params);
}
setSqlParams(params, sql) {
if(params.sign_body_id){
sql.push("AND sign_body_id = :sign_body_id");
}
if (params.id) {
sql.push("AND id = :id");
}
}
} }
module.exports = MerchantDao; module.exports = MerchantDao;
\ No newline at end of file
...@@ -6,7 +6,7 @@ class RecruitDao extends Dao { ...@@ -6,7 +6,7 @@ class RecruitDao extends Dao {
super(Dao.getModelName(RecruitDao)); super(Dao.getModelName(RecruitDao));
} }
async statCount(companyNames, sign_body) { async statCount(companyNames, sign_body_id) {
var result = {}; var result = {};
if(!companyNames || companyNames.length == 0) { if(!companyNames || companyNames.length == 0) {
return result; return result;
...@@ -14,12 +14,12 @@ class RecruitDao extends Dao { ...@@ -14,12 +14,12 @@ class RecruitDao extends Dao {
let and = []; let and = [];
and.push("company_name IN (:companyNames)"); and.push("company_name IN (:companyNames)");
if (sign_body) { if (sign_body_id) {
and.push("AND sign_body = :sign_body"); and.push("AND sign_body_id = :sign_body_id");
} }
var sql = `SELECT company_name, COUNT(1) AS num FROM recruit_info WHERE ${and.join(" ")} GROUP BY company_name `; var sql = `SELECT company_name, COUNT(1) AS num FROM recruit_info WHERE ${and.join(" ")} GROUP BY company_name `;
let list = await this.customQuery(sql, {companyNames: companyNames, sign_body: sign_body}); let list = await this.customQuery(sql, {companyNames: companyNames, sign_body_id: sign_body_id});
if(!list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
...@@ -32,4 +32,4 @@ class RecruitDao extends Dao { ...@@ -32,4 +32,4 @@ class RecruitDao extends Dao {
} }
} }
module.exports = RecruitDao; module.exports = RecruitDao;
\ No newline at end of file
const system = require("../../../system");
const Dao = require("../../dao.base");
class SignbodyDao extends Dao {
constructor() {
super(Dao.getModelName(SignbodyDao));
}
}
module.exports = SignbodyDao;
...@@ -5,7 +5,7 @@ class TaxinfoDao extends Dao { ...@@ -5,7 +5,7 @@ class TaxinfoDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(TaxinfoDao)); super(Dao.getModelName(TaxinfoDao));
} }
async statCount(companyNames, sign_body) { async statCount(companyNames, sign_body_id) {
var result = {}; var result = {};
if(!companyNames || companyNames.length == 0) { if(!companyNames || companyNames.length == 0) {
return result; return result;
...@@ -13,13 +13,13 @@ class TaxinfoDao extends Dao { ...@@ -13,13 +13,13 @@ class TaxinfoDao extends Dao {
let and = []; let and = [];
and.push("company_name IN (:companyNames)"); and.push("company_name IN (:companyNames)");
if (sign_body) { if (sign_body_id) {
and.push("AND sign_body = :sign_body"); and.push("AND sign_body_id = :sign_body_id");
} }
var sql = `SELECT company_name, COUNT(1) AS num FROM tax_info WHERE ${and.join(" ")} GROUP BY company_name`; var sql = `SELECT company_name, COUNT(1) AS num FROM tax_info WHERE ${and.join(" ")} GROUP BY company_name`;
let list = await this.customQuery(sql, {companyNames: companyNames, sign_body: sign_body}); let list = await this.customQuery(sql, {companyNames: companyNames, sign_body_id: sign_body_id});
if(!list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
...@@ -30,19 +30,19 @@ class TaxinfoDao extends Dao { ...@@ -30,19 +30,19 @@ class TaxinfoDao extends Dao {
} }
return result; return result;
} }
async statCounts(companyNames, sign_body) { async statCounts(companyNames, sign_body_id) {
var result = {}; var result = {};
if(!companyNames || companyNames.length == 0) { if(!companyNames || companyNames.length == 0) {
return result; return result;
} }
let and = []; let and = [];
and.push("company_name IN (:companyNames)"); and.push("company_name IN (:companyNames)");
if (sign_body) { if (sign_body_id) {
and.push("AND sign_body = :sign_body"); and.push("AND sign_body_id = :sign_body_id");
} }
var sql = `SELECT company_name, SUM(income_tax) AS num FROM tax_info WHERE ${and.join(" ")} GROUP BY company_name`; var sql = `SELECT company_name, SUM(income_tax) AS num FROM tax_info WHERE ${and.join(" ")} GROUP BY company_name`;
let list = await this.customQuery(sql, {companyNames: companyNames, sign_body: sign_body}); let list = await this.customQuery(sql, {companyNames: companyNames, sign_body_id: sign_body_id});
if(!list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
...@@ -93,4 +93,4 @@ class TaxinfoDao extends Dao { ...@@ -93,4 +93,4 @@ class TaxinfoDao extends Dao {
} }
} }
module.exports = TaxinfoDao; module.exports = TaxinfoDao;
\ No newline at end of file
...@@ -5,7 +5,7 @@ class TransactioninDao extends Dao { ...@@ -5,7 +5,7 @@ class TransactioninDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(TransactioninDao)); super(Dao.getModelName(TransactioninDao));
} }
async statCount(companyNames, sign_body) { async statCount(companyNames, sign_body_id) {
var result = {}; var result = {};
if(!companyNames || companyNames.length == 0) { if(!companyNames || companyNames.length == 0) {
return result; return result;
...@@ -13,13 +13,13 @@ class TransactioninDao extends Dao { ...@@ -13,13 +13,13 @@ class TransactioninDao extends Dao {
let and = []; let and = [];
and.push("company_name IN (:companyNames)"); and.push("company_name IN (:companyNames)");
if (sign_body) { if (sign_body_id) {
and.push("AND sign_body = :sign_body"); and.push("AND sign_body_id = :sign_body_id");
} }
var sql = `SELECT company_name, COUNT(1) AS num FROM transaction_info WHERE ${and.join(" ")} GROUP BY company_name`; var sql = `SELECT company_name, COUNT(1) AS num FROM transaction_info WHERE ${and.join(" ")} GROUP BY company_name`;
let list = await this.customQuery(sql, {companyNames: companyNames, sign_body: sign_body}); let list = await this.customQuery(sql, {companyNames: companyNames, sign_body_id: sign_body_id});
if(!list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
...@@ -31,19 +31,19 @@ class TransactioninDao extends Dao { ...@@ -31,19 +31,19 @@ class TransactioninDao extends Dao {
return result; return result;
} }
async statCounts(companyNames, sign_body) { async statCounts(companyNames, sign_body_id) {
var result = {}; var result = {};
if(!companyNames || companyNames.length == 0) { if(!companyNames || companyNames.length == 0) {
return result; return result;
} }
let and = []; let and = [];
and.push("company_name IN (:companyNames)"); and.push("company_name IN (:companyNames)");
if (sign_body) { if (sign_body_id) {
and.push("AND sign_body = :sign_body"); and.push("AND sign_body_id = :sign_body_id");
} }
var sql = `SELECT company_name, SUM(actual_amount) amount FROM transaction_info WHERE ${and.join(" ")} GROUP BY company_name`; var sql = `SELECT company_name, SUM(actual_amount) amount FROM transaction_info WHERE ${and.join(" ")} GROUP BY company_name`;
let list = await this.customQuery(sql, {companyNames: companyNames, sign_body: sign_body}); let list = await this.customQuery(sql, {companyNames: companyNames, sign_body_id: sign_body_id});
if(!list || list.length == 0) { if(!list || list.length == 0) {
return result; return result;
...@@ -94,4 +94,4 @@ class TransactioninDao extends Dao { ...@@ -94,4 +94,4 @@ class TransactioninDao extends Dao {
} }
} }
module.exports = TransactioninDao; module.exports = TransactioninDao;
\ No newline at end of file
/* jshint indent: 2 */ module.exports = function (sequelize, DataTypes) {
module.exports = function(sequelize, DataTypes) {
return sequelize.define('electroniccontract', { return sequelize.define('electroniccontract', {
id: { company_id: DataTypes.INTEGER,
type: DataTypes.INTEGER(11), company_name: DataTypes.STRING,
allowNull: false, usc_code: DataTypes.DATE,
primaryKey: true, name: DataTypes.STRING,
autoIncrement: true id_no: DataTypes.STRING,
}, phone_no: DataTypes.INTEGER,
company_name: { bank_no: DataTypes.STRING,
type: DataTypes.STRING(255), completed_date: DataTypes.STRING,
allowNull: true file_url: DataTypes.STRING,
}, sign_body_id: DataTypes.INTEGER,
usc_code: { sign_body: DataTypes.STRING,
type: DataTypes.STRING(255), redundance_1: DataTypes.STRING,
allowNull: true redundance_2: DataTypes.STRING,
}, redundance_3: DataTypes.STRING,
name: { redundance_4: DataTypes.STRING,
type: DataTypes.STRING(255),
allowNull: true
},
id_no: {
type: DataTypes.STRING(255),
allowNull: true
},
phone_no: {
type: DataTypes.STRING(255),
allowNull: true
},
bank_no: {
type: DataTypes.STRING(255),
allowNull: true
},
completed_date: {
type: DataTypes.STRING(255),
allowNull: true
},
file_url: {
type: DataTypes.STRING(255),
allowNull: true
},
created_at: {
type: DataTypes.DATE,
allowNull: true
},
updated_at: {
type: DataTypes.DATE,
allowNull: true
},
deleted_at: {
type: DataTypes.DATE,
allowNull: true
},
version: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
redundance_1: {
type: DataTypes.STRING(255),
allowNull: true
},
redundance_2: {
type: DataTypes.STRING(255),
allowNull: true
},
redundance_3: {
type: DataTypes.STRING(255),
allowNull: true
},
redundance_4: {
type: DataTypes.STRING(255),
allowNull: true
}
}, { }, {
tableName: 'electronic_contract_info' tableName: 'electronic_contract_info',
paranoid: true,//假的删除
underscored: true,
version: false,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
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}]
// }
]
}); });
}; };
...@@ -9,6 +9,7 @@ module.exports = function (sequelize, DataTypes) { ...@@ -9,6 +9,7 @@ module.exports = function (sequelize, DataTypes) {
invoiceImg: DataTypes.STRING, invoiceImg: DataTypes.STRING,
invoiceType: DataTypes.INTEGER, invoiceType: DataTypes.INTEGER,
sign_body: DataTypes.STRING, sign_body: DataTypes.STRING,
sign_body_id :DataTypes.INTEGER,
}, { }, {
tableName: 'stat_invoice', tableName: 'stat_invoice',
paranoid: true,//假的删除 paranoid: true,//假的删除
......
/* jshint indent: 2 */ /* jshint indent: 2 */
module.exports = function(sequelize, DataTypes) { module.exports = function (sequelize, DataTypes) {
return sequelize.define('merchant', { return sequelize.define('merchant', {
id: { company_name: DataTypes.STRING,
type: DataTypes.INTEGER(11), usc_code: DataTypes.STRING,
allowNull: false, type: DataTypes.STRING,
primaryKey: true, link_man: DataTypes.STRING,
autoIncrement: true link_no: DataTypes.STRING,
}, link_email: DataTypes.INTEGER,
company_name: { link_addr: DataTypes.STRING,
type: DataTypes.STRING(255), bank_account_name: DataTypes.STRING,
allowNull: true bank_no: DataTypes.STRING,
}, open_bank: DataTypes.STRING,
usc_code: { sign_body_id: DataTypes.INTEGER,
type: DataTypes.STRING(255), sign_body: DataTypes.STRING,
allowNull: true begin_time: DataTypes.DATE,
}, invalid_time: DataTypes.STRING,
type: { sign_contract: DataTypes.STRING,
type: DataTypes.CHAR(2), industry: DataTypes.STRING,
allowNull: false legal_idcard_front: DataTypes.STRING,
}, legal_idcard_back: DataTypes.STRING,
link_man: { business_license_img: DataTypes.STRING,
type: DataTypes.STRING(32), company_logo_img: DataTypes.STRING,
allowNull: false bd_name: DataTypes.STRING,
}, bd_mobile: DataTypes.STRING,
link_no: { bd_email: DataTypes.STRING,
type: DataTypes.STRING(20), redundance_1: DataTypes.STRING,
allowNull: true redundance_2: DataTypes.STRING,
}, redundance_3: DataTypes.STRING,
link_email: { redundance_4: DataTypes.STRING,
type: DataTypes.STRING(50), contract_url: DataTypes.STRING,
allowNull: true flexible_scene: DataTypes.STRING,
}, office_scenario_img : DataTypes.STRING,
bank_account_name: {
type: DataTypes.STRING(30),
allowNull: false
},
bank_no: {
type: DataTypes.STRING(30),
allowNull: false
},
open_bank: {
type: DataTypes.STRING(255),
allowNull: false
},
sign_body: {
type: DataTypes.STRING(255),
allowNull: true
},
begin_time: {
type: DataTypes.DATE,
allowNull: true
},
invalid_time: {
type: DataTypes.DATE,
allowNull: true
},
created_at: {
type: DataTypes.DATE,
allowNull: true
},
updated_at: {
type: DataTypes.DATE,
allowNull: true
},
deleted_at: {
type: DataTypes.DATE,
allowNull: true
},
version: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
},
redundance_1: {
type: DataTypes.STRING(255),
allowNull: true
},
redundance_2: {
type: DataTypes.STRING(255),
allowNull: true
},
redundance_3: {
type: DataTypes.STRING(255),
allowNull: true
},
redundance_4: {
type: DataTypes.STRING(255),
allowNull: true
},
contract_url: {
type: DataTypes.STRING(300),
allowNull: true
},
business_license: {
type: DataTypes.STRING(300),
allowNull: true
}
}, { }, {
tableName: 'merchant_info' tableName: 'merchant_info',
paranoid: true,//假的删除
underscored: true,
version: false,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
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}]
// }
]
}); });
}; };
/* jshint indent: 2 */ module.exports = function (sequelize, DataTypes) {
module.exports = function(sequelize, DataTypes) {
return sequelize.define('recruit', { return sequelize.define('recruit', {
id: { company_name: DataTypes.STRING,
type: DataTypes.INTEGER(11), usc_code: DataTypes.STRING,
allowNull: false, recruit_name: DataTypes.DATE,
primaryKey: true, publish_date: DataTypes.DATE,
autoIncrement: true phone_no: DataTypes.STRING,
}, recruit_count: DataTypes.INTEGER,
company_name: { pay_type: DataTypes.INTEGER,
type: DataTypes.STRING(255), age_range: DataTypes.STRING,
allowNull: true compre_salary: DataTypes.BIGINT,
}, work_address: DataTypes.STRING,
recruit_name: { sign_body_id: DataTypes.INTEGER,
type: DataTypes.STRING(255), sign_body: DataTypes.STRING,
allowNull: true redundance_1: DataTypes.STRING,
}, redundance_2: DataTypes.STRING,
publish_date: { redundance_3: DataTypes.STRING,
type: DataTypes.DATE, redundance_4: DataTypes.STRING,
allowNull: true
},
phone_no: {
type: DataTypes.STRING(20),
allowNull: true
},
recruit_count: {
type: DataTypes.INTEGER(11),
allowNull: true
},
pay_type: {
type: DataTypes.INTEGER(11),
allowNull: true
},
age_range: {
type: DataTypes.STRING(255),
allowNull: true
},
compre_salary: {
type: DataTypes.BIGINT,
allowNull: true
},
work_address: {
type: DataTypes.STRING(255),
allowNull: true
},
created_at: {
type: DataTypes.DATE,
allowNull: true
},
updated_at: {
type: DataTypes.DATE,
allowNull: true
},
deleted_at: {
type: DataTypes.DATE,
allowNull: true
},
version: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: '0'
}
}, { }, {
tableName: 'recruit_info' tableName: 'recruit_info',
paranoid: true,//假的删除
underscored: true,
version: false,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
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}]
// }
]
}); });
}; };
/* jshint indent: 2 */
module.exports = function (sequelize, DataTypes) {
return sequelize.define('signbody', {
name: DataTypes.INTEGER,
link_man: DataTypes.STRING,
link_no: DataTypes.STRING,
link_addr: DataTypes.STRING,
bank_account_name: DataTypes.STRING,
bank_no: DataTypes.STRING,
open_bank: DataTypes.STRING,
is_partner: DataTypes.INTEGER,
partner_name: DataTypes.STRING,
partner_addr: DataTypes.STRING,
partner_bank: DataTypes.STRING,
partner_bank_no: DataTypes.STRING,
partner_contract: DataTypes.STRING,
business_license_url : DataTypes.STRING,
}, {
tableName: 'sign_body',
paranoid: true,//假的删除
underscored: true,
version: false,
freezeTableName: true,
//freezeTableName: true,
// define the table's name
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}]
// }
]
});
};
...@@ -2,30 +2,20 @@ ...@@ -2,30 +2,20 @@
module.exports = function(sequelize, DataTypes) { module.exports = function(sequelize, DataTypes) {
return sequelize.define('taxinfo', { return sequelize.define('taxinfo', {
name: { company_name : DataTypes.STRING,
type: DataTypes.STRING(255), usc_code : DataTypes.STRING,
allowNull: true name : DataTypes.STRING,
}, id_no : DataTypes.STRING,
id_no: { actual_amount : DataTypes.STRING,
type: DataTypes.STRING(30), income_tax : DataTypes.STRING,
allowNull: true tax_time : DataTypes.DATE,
}, sign_body_id : DataTypes.INTEGER,
actual_amount: { sign_body : DataTypes.STRING,
type: DataTypes.STRING(20), tax_url : DataTypes.STRING,
allowNull: true redundance_1 : DataTypes.STRING,
}, redundance_2 : DataTypes.STRING,
income_tax: { redundance_3 : DataTypes.STRING,
type: DataTypes.STRING(20), redundance_4 : DataTypes.STRING,
allowNull: true
},
tax_time: {
type: DataTypes.DATE,
allowNull: true
},
tax_url: {
type: DataTypes.STRING,
allowNull: true
},
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
/* jshint indent: 2 */ module.exports = function (sequelize, DataTypes) {
return sequelize.define('transactionin', {
module.exports = function(sequelize, DataTypes) { company_name: DataTypes.STRING,
return sequelize.define('transactionin', { usc_code: DataTypes.STRING,
id: { id_name: DataTypes.DATE,
type: DataTypes.INTEGER(11), id_no: DataTypes.STRING,
allowNull: false, phone_no: DataTypes.STRING,
primaryKey: true, bank_no: DataTypes.INTEGER,
autoIncrement: true amt: DataTypes.STRING,
}, actual_amount: DataTypes.STRING,
invoiceId: { deduct_amt: DataTypes.STRING,
type: DataTypes.INTEGER(11), service_fee: DataTypes.STRING,
field: 'invoice_id', value_added_fee: DataTypes.STRING,
}, transaction_time: DataTypes.STRING,
company_name: { sign_body_id: DataTypes.INTEGER,
type: DataTypes.STRING(255), sign_body: DataTypes.STRING,
allowNull: true income_tax: DataTypes.STRING,
}, channel_rsp_no: DataTypes.STRING,
id_name: { order_item_id: DataTypes.STRING,
type: DataTypes.STRING(20), invoice_id: DataTypes.INTEGER,
allowNull: true merchant_account_id: DataTypes.INTEGER,
}, redundance_1: DataTypes.STRING,
id_no: { redundance_2: DataTypes.STRING,
type: DataTypes.STRING(50), redundance_3: DataTypes.STRING,
allowNull: true redundance_4: DataTypes.STRING,
}, }, {
bank_no: { tableName: 'transaction_info',
type: DataTypes.STRING(50), paranoid: true,//假的删除
allowNull: true underscored: true,
}, version: false,
actual_amount: { freezeTableName: true,
type: DataTypes.STRING(20), //freezeTableName: true,
allowNull: true // define the table's name
}, validate: {},
transaction_time: { indexes: [
type: DataTypes.DATE, // Create a unique index on email
allowNull: true // {
}, // unique: true,
order_item_id: { // fields: ['email']
type: DataTypes.STRING, // },
allowNull: true //
}, // // Creates a gin index on data with the jsonb_path_ops operator
channel_rsp_no: { // {
type: DataTypes.STRING, // fields: ['data'],
allowNull: true // using: 'gin',
}, // operator: 'jsonb_path_ops'
merchant_account_id: { // },
type: DataTypes.INTEGER, //
allowNull: true // // By default index name will be [table]_[fields]
}, // // Creates a multi column partial index
created_at: { // {
type: DataTypes.DATE, // name: 'public_by_author',
allowNull: true // fields: ['author', 'status'],
}, // where: {
updated_at: { // status: 'public'
type: DataTypes.DATE, // }
allowNull: true // },
}, //
deleted_at: { // // A BTREE index with a ordered field
type: DataTypes.DATE, // {
allowNull: true // name: 'title_index',
}, // method: 'BTREE',
version: { // fields: ['author', {attribute: 'title', collate: 'en_US', order: 'DESC', length: 5}]
type: DataTypes.INTEGER(11), // }
allowNull: true, ]
defaultValue: '0' });
}, };
redundance_1: {
type: DataTypes.STRING(255),
allowNull: true
},
redundance_2: {
type: DataTypes.STRING(255),
allowNull: true
},
redundance_3: {
type: DataTypes.STRING(255),
allowNull: true
},
redundance_4: {
type: DataTypes.STRING(255),
allowNull: true
}
}, {
tableName: 'transaction_info'
});
};
...@@ -8,6 +8,7 @@ module.exports = (db, DataTypes) => { ...@@ -8,6 +8,7 @@ module.exports = (db, DataTypes) => {
nickName: DataTypes.STRING, nickName: DataTypes.STRING,
mobile: DataTypes.STRING, mobile: DataTypes.STRING,
sign_body: DataTypes.STRING, sign_body: DataTypes.STRING,
sign_body_id :DataTypes.INTEGER,
isAdmin: { isAdmin: {
type: DataTypes.BOOLEAN, type: DataTypes.BOOLEAN,
defaultValue: false defaultValue: false
...@@ -53,4 +54,4 @@ module.exports = (db, DataTypes) => { ...@@ -53,4 +54,4 @@ module.exports = (db, DataTypes) => {
// } // }
] ]
}); });
} }
\ No newline at end of file
...@@ -17,8 +17,8 @@ class ElectronicContractService extends ServiceBase { ...@@ -17,8 +17,8 @@ class ElectronicContractService extends ServiceBase {
[this.db.Op.like]: "%" + params.company_name + "%" [this.db.Op.like]: "%" + params.company_name + "%"
}; };
} }
if(params.sign_body){ if(params.sign_body_id){
where.sign_body = params.sign_body; where.sign_body_id = params.sign_body_id;
} }
if(params.id_no){ if(params.id_no){
where.id_no = params.id_no where.id_no = params.id_no
...@@ -27,8 +27,7 @@ class ElectronicContractService extends ServiceBase { ...@@ -27,8 +27,7 @@ class ElectronicContractService extends ServiceBase {
var orderby = [ var orderby = [
["id", 'desc'] ["id", 'desc']
]; ];
var attributes = [`id`, `company_name`, `name`, `id_no`, `phone_no`, `bank_no`, `completed_date`, `file_url`, `sign_body`]; var page = await this.getPageList(currentPage, pageSize, where, orderby);
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
// if (page && page.rows) { // if (page && page.rows) {
// for (var row of page.rows) { // for (var row of page.rows) {
// this.handleDate(row, ["begin_time", "invalid_time"]); // this.handleDate(row, ["begin_time", "invalid_time"]);
...@@ -41,7 +40,7 @@ class ElectronicContractService extends ServiceBase { ...@@ -41,7 +40,7 @@ class ElectronicContractService extends ServiceBase {
params.currentPage = Number(params.currentPage || 1); params.currentPage = Number(params.currentPage || 1);
params.pageSize = Number(params.pageSize || 10); params.pageSize = Number(params.pageSize || 10);
params.company_name = this.trim(params.company_name); params.company_name = this.trim(params.company_name);
params.sign_body = this.trim(params.sign_body); params.sign_body_id = this.trim(params.sign_body_id);
params.id_no = this.trim(params.id_no); params.id_no = this.trim(params.id_no);
let total = await this.dao.countByIdNo(params); let total = await this.dao.countByIdNo(params);
...@@ -57,4 +56,4 @@ class ElectronicContractService extends ServiceBase { ...@@ -57,4 +56,4 @@ class ElectronicContractService extends ServiceBase {
} }
module.exports = ElectronicContractService; module.exports = ElectronicContractService;
\ No newline at end of file
...@@ -29,8 +29,8 @@ class InvoiceService extends ServiceBase { ...@@ -29,8 +29,8 @@ class InvoiceService extends ServiceBase {
where.invoiceType = Number(params.invoiceType); where.invoiceType = Number(params.invoiceType);
} }
if(params.sign_body) { if(params.sign_body_id) {
where.sign_body = params.sign_body; where.sign_body_id = params.sign_body_id;
} }
if(params.invoiceId) { if(params.invoiceId) {
...@@ -51,4 +51,4 @@ class InvoiceService extends ServiceBase { ...@@ -51,4 +51,4 @@ class InvoiceService extends ServiceBase {
} }
} }
module.exports = InvoiceService; module.exports = InvoiceService;
\ No newline at end of file
...@@ -19,8 +19,8 @@ class LoadService extends ServiceBase { ...@@ -19,8 +19,8 @@ class LoadService extends ServiceBase {
[this.db.Op.like]: "%" + params.company_name + "%" [this.db.Op.like]: "%" + params.company_name + "%"
}; };
} }
if(params.sign_body){ if(params.sign_body_id){
where.sign_body = params.sign_body; where.sign_body_id = params.sign_body_id;
} }
if(params.id_no){ if(params.id_no){
where.id_no = params.id_no where.id_no = params.id_no
...@@ -32,8 +32,7 @@ class LoadService extends ServiceBase { ...@@ -32,8 +32,7 @@ class LoadService extends ServiceBase {
var orderby = [ var orderby = [
["id", 'desc'] ["id", 'desc']
]; ];
var attributes = [`id`, `company_name`, `name`, `phone_no`, `id_no`, `bankno`, `workload`, `compre_salary`, `affirm_time`, `sign_body`]; var page = await this.getPageList(currentPage, pageSize, where, orderby);
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
if (page && page.rows) { if (page && page.rows) {
for (var row of page.rows) { for (var row of page.rows) {
this.handleDate(row, ["begin_time", "invalid_time"], "YYYY-MM-DD", -8); this.handleDate(row, ["begin_time", "invalid_time"], "YYYY-MM-DD", -8);
...@@ -45,4 +44,4 @@ class LoadService extends ServiceBase { ...@@ -45,4 +44,4 @@ class LoadService extends ServiceBase {
} }
module.exports = LoadService; module.exports = LoadService;
\ No newline at end of file
...@@ -24,23 +24,26 @@ class MerchantService extends ServiceBase { ...@@ -24,23 +24,26 @@ class MerchantService extends ServiceBase {
var pageSize = Number(params.pageSize || 10); var pageSize = Number(params.pageSize || 10);
var where = {}; var where = {};
if (params.id) {
where.id = params.id;
}
if (params.company_name) { if (params.company_name) {
where.company_name = { where.company_name = {
[this.db.Op.like]: "%" + params.company_name + "%" [this.db.Op.like]: "%" + params.company_name + "%"
}; };
} }
if (params.sign_body) { if (params.sign_body_id) {
where.sign_body = params.sign_body; where.sign_body_id = params.sign_body_id;
} }
if(params.id_no){ if (params.id_no) {
where.id_no = params.id_no; where.id_no = params.id_no;
} }
this.addWhereTime(where, 'begin_time', params.signBegin, params.signEnd, true); this.addWhereTime(where, 'begin_time', params.signBegin, params.signEnd, true);
var orderby = [ var orderby = [
["id", 'desc'] ["id", 'desc']
]; ];
var attributes = [`id`, `company_name`, `type`, `link_man`, `link_no`, `link_email`, `bank_account_name`, `bank_no`, `open_bank`, `sign_body`, `begin_time`, `invalid_time`,`contract_url`,`business_license`]; var page = await this.getPageList(currentPage, pageSize, where, orderby);
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
if (page && page.rows) { if (page && page.rows) {
for (var row of page.rows) { for (var row of page.rows) {
this.handleDate(row, ["begin_time", "invalid_time"], "YYYY-MM-DD"); this.handleDate(row, ["begin_time", "invalid_time"], "YYYY-MM-DD");
...@@ -49,12 +52,21 @@ class MerchantService extends ServiceBase { ...@@ -49,12 +52,21 @@ class MerchantService extends ServiceBase {
return page; return page;
} }
async merchantInfo(params) {
if (!params.id) {
return system.getResultFail(-1, "id不能为空");
}
return await this.dao.merchantInfo({id: params.id, sign_body_id: params.sign_body_id});
}
async dataSummarize(params) { async dataSummarize(params) {
var where = {}; var where = {};
var wheres = {}; var wheres = {};
if (params.sign_body) { if (params.sign_body_id) {
where.sign_body = params.sign_body; where.sign_body_id = params.sign_body_id;
wheres.sign_body = params.sign_body; wheres.sign_body_id = params.sign_body_id;
} }
this.addWhereTime(where, 'begin_time', params.signBegin, params.signEnd, true); this.addWhereTime(where, 'begin_time', params.signBegin, params.signEnd, true);
...@@ -62,8 +74,8 @@ class MerchantService extends ServiceBase { ...@@ -62,8 +74,8 @@ class MerchantService extends ServiceBase {
var addMer = await this.findCount({where: where});//商户新增 var addMer = await this.findCount({where: where});//商户新增
var upMer = await this.findCount({where: wheres});//累积 var upMer = await this.findCount({where: wheres});//累积
var where_ele = {}; var where_ele = {};
if (params.sign_body) { if (params.sign_body_id) {
where_ele.sign_body = params.sign_body; where_ele.sign_body_id = params.sign_body_id;
} }
this.addWhereTime(where_ele, 'completed_date', params.signBegin, params.signEnd, true); this.addWhereTime(where_ele, 'completed_date', params.signBegin, params.signEnd, true);
...@@ -72,8 +84,8 @@ class MerchantService extends ServiceBase { ...@@ -72,8 +84,8 @@ class MerchantService extends ServiceBase {
var where_loa = {}; var where_loa = {};
if (params.sign_body) { if (params.sign_body_id) {
where_loa.sign_body = params.sign_body; where_loa.sign_body_id = params.sign_body_id;
} }
this.addWhereTime(where_loa, 'affirm_time', params.signBegin, params.signEnd, true); this.addWhereTime(where_loa, 'affirm_time', params.signBegin, params.signEnd, true);
...@@ -82,8 +94,8 @@ class MerchantService extends ServiceBase { ...@@ -82,8 +94,8 @@ class MerchantService extends ServiceBase {
var where_rec = {}; var where_rec = {};
if (params.sign_body) { if (params.sign_body_id) {
where_rec.sign_body = params.sign_body; where_rec.sign_body_id = params.sign_body_id;
} }
this.addWhereTime(where_rec, 'publish_date', params.signBegin, params.signEnd, true); this.addWhereTime(where_rec, 'publish_date', params.signBegin, params.signEnd, true);
...@@ -91,8 +103,8 @@ class MerchantService extends ServiceBase { ...@@ -91,8 +103,8 @@ class MerchantService extends ServiceBase {
var upRec = await this.recruitDao.findCount({where: wheres}); var upRec = await this.recruitDao.findCount({where: wheres});
var where_tax = {}; var where_tax = {};
if (params.sign_body) { if (params.sign_body_id) {
where_tax.sign_body = params.sign_body; where_tax.sign_body_id = params.sign_body_id;
} }
this.addWhereTime(where_tax, 'tax_time', params.signBegin, params.signEnd, true); this.addWhereTime(where_tax, 'tax_time', params.signBegin, params.signEnd, true);
...@@ -103,8 +115,8 @@ class MerchantService extends ServiceBase { ...@@ -103,8 +115,8 @@ class MerchantService extends ServiceBase {
var upTacSum = await this.taxinfoDao.findSum("income_tax", {where: wheres}); var upTacSum = await this.taxinfoDao.findSum("income_tax", {where: wheres});
var where_tra = {}; var where_tra = {};
if (params.sign_body) { if (params.sign_body_id) {
where_tra.sign_body = params.sign_body; where_tra.sign_body_id = params.sign_body_id;
} }
this.addWhereTime(where_tra, 'transaction_time', params.signBegin, params.signEnd, true); this.addWhereTime(where_tra, 'transaction_time', params.signBegin, params.signEnd, true);
var addTra = await this.transactioninDao.findCount({where: where_tra});//交易比数 var addTra = await this.transactioninDao.findCount({where: where_tra});//交易比数
...@@ -151,9 +163,9 @@ class MerchantService extends ServiceBase { ...@@ -151,9 +163,9 @@ class MerchantService extends ServiceBase {
sql = sql + " AND company_name = '" + params.company_name + "'"; sql = sql + " AND company_name = '" + params.company_name + "'";
sqls = sqls + " AND company_name = '" + params.company_name + "'"; sqls = sqls + " AND company_name = '" + params.company_name + "'";
} }
if (params.sign_body) { if (params.sign_body_id) {
sql = sql + " AND sign_body = '" + params.sign_body + "'"; sql = sql + " AND sign_body_id = '" + params.sign_body_id + "'";
sqls = sqls + " AND sign_body = '" + params.sign_body + "'"; sqls = sqls + " AND sign_body_id = '" + params.sign_body_id + "'";
} }
if (params.signBegin || params.signEnd) { if (params.signBegin || params.signEnd) {
sql = sql + " AND completed_date >= '" + params.signBegin + "' AND completed_date <= '" + params.signEnd + "'"; sql = sql + " AND completed_date >= '" + params.signBegin + "' AND completed_date <= '" + params.signEnd + "'";
...@@ -197,23 +209,23 @@ class MerchantService extends ServiceBase { ...@@ -197,23 +209,23 @@ class MerchantService extends ServiceBase {
companyNames.push(row.company_name); companyNames.push(row.company_name);
} }
// 电子签约数量 company_name --> num // 电子签约数量 company_name --> num
let electronMap = await this.electroniccontractDao.statCount(companyNames, params.sign_body); let electronMap = await this.electroniccontractDao.statCount(companyNames, params.sign_body_id);
// 招工需求 // 招工需求
let recruitMap = await this.recruitDao.statCount(companyNames, params.sign_body); let recruitMap = await this.recruitDao.statCount(companyNames, params.sign_body_id);
// 工作量确认单 // 工作量确认单
let loadMap = await this.loadDao.statCount(companyNames, params.sign_body); let loadMap = await this.loadDao.statCount(companyNames, params.sign_body_id);
// 交易笔数、交易金额 // 交易笔数、交易金额
let traMap = await this.transactioninDao.statCount(companyNames, params.sign_body); let traMap = await this.transactioninDao.statCount(companyNames, params.sign_body_id);
//交易金额 //交易金额
let traSUm = await this.transactioninDao.statCounts(companyNames, params.sign_body); let traSUm = await this.transactioninDao.statCounts(companyNames, params.sign_body_id);
// 完税人次 // 完税人次
let taxMap = await this.taxinfoDao.statCount(companyNames, params.sign_body); let taxMap = await this.taxinfoDao.statCount(companyNames, params.sign_body_id);
// 完税金额 // 完税金额
let taxSUm = await this.taxinfoDao.statCounts(companyNames, params.sign_body); let taxSUm = await this.taxinfoDao.statCounts(companyNames, params.sign_body_id);
for (var row of rows) { for (var row of rows) {
row.dzCount = electronMap[row.company_name] || 0; row.dzCount = electronMap[row.company_name] || 0;
...@@ -355,10 +367,10 @@ class MerchantService extends ServiceBase { ...@@ -355,10 +367,10 @@ class MerchantService extends ServiceBase {
if (params.sign_body) { if (params.sign_body) {
sql = sql + " AND sign_body = '" + params.sign_body + "'"; sql = sql + " AND sign_body = '" + params.sign_body + "'";
} }
if(params.idno){ if (params.idno) {
sql = sql + " AND id_no = '" + params.idno + "'"; sql = sql + " AND id_no = '" + params.idno + "'";
} }
if(params.id_no){ if (params.id_no) {
sql = sql + " AND id_no = '" + params.id_no + "'"; sql = sql + " AND id_no = '" + params.id_no + "'";
} }
sql = sql + " GROUP BY days ORDER BY days ASC"; sql = sql + " GROUP BY days ORDER BY days ASC";
...@@ -373,14 +385,14 @@ class MerchantService extends ServiceBase { ...@@ -373,14 +385,14 @@ class MerchantService extends ServiceBase {
return page; return page;
} }
async tenantSel(params){ async tenantSel(params) {
var sql = " SELECT company_name FROM merchant_info WHERE 1=1 "; var sql = " SELECT company_name FROM merchant_info WHERE 1=1 ";
if (params.sign_body) { if (params.sign_body_id) {
sql = sql + "AND sign_body = '"+params.sign_body+"'"; sql = sql + "AND sign_body_id = '" + params.sign_body_id + "'";
} }
var page = await this.customQuery(sql); var page = await this.customQuery(sql);
var result = []; var result = [];
for (let i=0;i<page.length;i++){ for (let i = 0; i < page.length; i++) {
var data = {}; var data = {};
data.value = page[i].company_name; data.value = page[i].company_name;
data.label = page[i].company_name; data.label = page[i].company_name;
...@@ -452,4 +464,4 @@ class MerchantService extends ServiceBase { ...@@ -452,4 +464,4 @@ class MerchantService extends ServiceBase {
} }
module.exports = MerchantService; module.exports = MerchantService;
\ No newline at end of file
...@@ -17,15 +17,14 @@ class RecruitService extends ServiceBase { ...@@ -17,15 +17,14 @@ class RecruitService extends ServiceBase {
[this.db.Op.like]: "%" + params.company_name + "%" [this.db.Op.like]: "%" + params.company_name + "%"
}; };
} }
if(params.sign_body){ if(params.sign_body_id){
where.sign_body = params.sign_body; where.sign_body_id = params.sign_body_id;
} }
this.addWhereTime(where, 'publish_date', params.signBegin, params.signEnd, true); this.addWhereTime(where, 'publish_date', params.signBegin, params.signEnd, true);
var orderby = [ var orderby = [
["id", 'desc'] ["id", 'desc']
]; ];
var attributes = [`id`, `company_name`, `recruit_name`, `publish_date`, `phone_no`, `recruit_count`, `pay_type`, `age_range`, `compre_salary`, `work_address`]; var page = await this.getPageList(currentPage, pageSize, where, orderby);
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
if (page && page.rows) { if (page && page.rows) {
for (var row of page.rows) { for (var row of page.rows) {
this.handleDate(row, ["publish_date"], "YYYY-MM-DD", -8); this.handleDate(row, ["publish_date"], "YYYY-MM-DD", -8);
...@@ -36,4 +35,4 @@ class RecruitService extends ServiceBase { ...@@ -36,4 +35,4 @@ class RecruitService extends ServiceBase {
} }
module.exports = RecruitService; module.exports = RecruitService;
\ No newline at end of file
const system = require("../../../system");
const ServiceBase = require("../../sve.base");
const settings = require("../../../../config/settings");
class SignbodyService extends ServiceBase {
constructor() {
super("all", ServiceBase.getDaoName(SignbodyService));
}
}
module.exports = SignbodyService;
...@@ -18,9 +18,9 @@ class TaxinfoService extends ServiceBase { ...@@ -18,9 +18,9 @@ class TaxinfoService extends ServiceBase {
[this.db.Op.like]: "%" + params.company_name + "%" [this.db.Op.like]: "%" + params.company_name + "%"
}; };
} }
if(params.sign_body){ if(params.sign_body_id){
where.sign_body = params.sign_body; where.sign_body_id = params.sign_body_id;
} }
let id_no = this.trim(params.id_no); let id_no = this.trim(params.id_no);
...@@ -42,4 +42,4 @@ class TaxinfoService extends ServiceBase { ...@@ -42,4 +42,4 @@ class TaxinfoService extends ServiceBase {
} }
module.exports = TaxinfoService; module.exports = TaxinfoService;
\ No newline at end of file
...@@ -11,8 +11,8 @@ class TransactioninService extends ServiceBase { ...@@ -11,8 +11,8 @@ class TransactioninService extends ServiceBase {
/** /**
* @param {int} invoiceId 发票ID * @param {int} invoiceId 发票ID
* @param {*} params * @param {*} params
* *
*/ */
async signPage(params) { async signPage(params) {
var currentPage = Number(params.currentPage || 0); var currentPage = Number(params.currentPage || 0);
...@@ -24,8 +24,8 @@ class TransactioninService extends ServiceBase { ...@@ -24,8 +24,8 @@ class TransactioninService extends ServiceBase {
[this.db.Op.like]: "%" + params.company_name + "%" [this.db.Op.like]: "%" + params.company_name + "%"
}; };
} }
if(params.sign_body){ if(params.sign_body_id){
where.sign_body = params.sign_body; where.sign_body_id = params.sign_body_id;
} }
if(params.id_no){ if(params.id_no){
where.id_no = params.id_no where.id_no = params.id_no
...@@ -37,14 +37,13 @@ class TransactioninService extends ServiceBase { ...@@ -37,14 +37,13 @@ class TransactioninService extends ServiceBase {
if(params.compreSalary){ if(params.compreSalary){
where.deduct_amt = this.trim(params.compreSalary); where.deduct_amt = this.trim(params.compreSalary);
} }
this.addWhereTime(where, 'transaction_time', params.signBegin, params.signEnd, true); this.addWhereTime(where, 'transaction_time', params.signBegin, params.signEnd, true);
var orderby = [ var orderby = [
["id", 'desc'] ["id", 'desc']
]; ];
var attributes = [`id`, `company_name`, `id_name`, `id_no`, `bank_no`,`invoiceId`, `actual_amount`,`deduct_amt`, `transaction_time`, `sign_body`,`order_item_id`, `channel_rsp_no`, `merchant_account_id`]; var page = await this.getPageList(currentPage, pageSize, where, orderby);
var page = await this.getPageList(currentPage, pageSize, where, orderby, attributes);
if (page && page.rows) { if (page && page.rows) {
for (var row of page.rows) { for (var row of page.rows) {
this.handleDate(row, ["transaction_time"], null, -8); this.handleDate(row, ["transaction_time"], null, -8);
...@@ -55,4 +54,4 @@ class TransactioninService extends ServiceBase { ...@@ -55,4 +54,4 @@ class TransactioninService extends ServiceBase {
} }
module.exports = TransactioninService; module.exports = TransactioninService;
\ No newline at end of file
var settings={ var settings = {
redis:{ redis: {
host: "43.247.184.32", host: "43.247.184.32",
port: 8967, port: 8967,
password: "Gongsibao2018", password: "Gongsibao2018",
db:10, db: 10,
}, },
database:{ database: {
dbname : "stat", dbname: "bpo_stat",
user: "root", user: "write",
password: "!@#Qaz741", password: "write",
config: { config: {
host: 'rm-2ze5muw8tb37i3ig4lo.mysql.rds.aliyuncs.com', //host: 'rm-2ze5muw8tb37i3ig4lo.mysql.rds.aliyuncs.com',
// dbname : "bpo_stat", // dbname : "bpo_stat",
// user: "write", // user: "write",
// password: "write", // password: "write",
// config: { // config: {
// host: '192.168.18.237', // host: '192.168.18.237',
port: 3306, //port: 3306,
// host: '43.247.184.35', host: '43.247.184.35',
// port: 8899, port: 8899,
dialect: 'mysql', dialect: 'mysql',
operatorsAliases: false, operatorsAliases: false,
pool: { pool: {
max: 5, max: 5,
min: 0, min: 0,
acquire: 90000000, acquire: 90000000,
idle: 1000000 idle: 1000000
}, },
debug:false, debug: false,
dialectOptions:{ dialectOptions: {
requestTimeout: 999999, requestTimeout: 999999,
// instanceName:'DEV' // instanceName:'DEV'
} //设置MSSQL超时时间 } //设置MSSQL超时时间
} }
}, },
reqEsDevUrl:"http://192.168.4.249:9200/", reqEsDevUrl: "http://192.168.4.249:9200/",
reqHomePageDevUrl:"http://sj.app.com:3002/", reqHomePageDevUrl: "http://sj.app.com:3002/",
reqAuthUrl:"http://sj.app.com:3002/auth" reqAuthUrl: "http://sj.app.com:3002/auth"
}; };
module.exports = settings; module.exports = settings;
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