Commit d05832ff by 宋毅

tj

parent 7becd053
...@@ -87,20 +87,19 @@ class APIBase { ...@@ -87,20 +87,19 @@ class APIBase {
const element = result[tKey]; const element = result[tKey];
if (element) { if (element) {
if (tKey != "data") { if (tKey != "data") {
if (tKey != "status") { if (typeof element === 'string' || typeof element === "number" || element instanceof Date || !element) {
newResult.Response[newTKey] = typeof element === 'string' ? element : JSON.stringify(element); newResult.Response[newTKey] = element;
} } else {
else { newResult.Response[newTKey] = JSON.stringify(element);
newResult.Response[newTKey] = Number(element);
} }
} else { } else {
if (typeof element === 'string') { if (typeof element === 'string' || typeof element === "number" || element instanceof Date || !element) {
newResult.Response[instanceSet] = element; newResult.Response[instanceSet] = element;
} else if (element instanceof Array) { } else if (element instanceof Array) {
newResult.Response[instanceSet] = []; newResult.Response[instanceSet] = [];
for (let h = 0; h < element.length; h++) { for (let h = 0; h < element.length; h++) {
const arrayElement = element[h]; const arrayElement = element[h];
if (typeof arrayElement === 'string') { if (typeof arrayElement === 'string' || typeof arrayElement === "number" || arrayElement instanceof Date || !arrayElement) {
newResult.Response[instanceSet].push(arrayElement); newResult.Response[instanceSet].push(arrayElement);
} else if (arrayElement instanceof Array) { } else if (arrayElement instanceof Array) {
newResult.Response[instanceSet].push(JSON.stringify(arrayElement)); newResult.Response[instanceSet].push(JSON.stringify(arrayElement));
...@@ -111,7 +110,11 @@ class APIBase { ...@@ -111,7 +110,11 @@ class APIBase {
const arrayKey = arrayKeys[g]; const arrayKey = arrayKeys[g];
const newArrayKey = await self.InitialToUpperMulti(self, arrayKey); const newArrayKey = await self.InitialToUpperMulti(self, arrayKey);
const tmpArrayKeyData = arrayElement[arrayKey]; const tmpArrayKeyData = arrayElement[arrayKey];
arrayItem[newArrayKey] = typeof tmpArrayKeyData === 'string' || tmpArrayKeyData instanceof Date ? tmpArrayKeyData : JSON.stringify(tmpArrayKeyData); if (typeof tmpArrayKeyData === 'string' || typeof tmpArrayKeyData === "number" || tmpArrayKeyData instanceof Date || !tmpArrayKeyData) {
arrayItem[newArrayKey] = tmpArrayKeyData;
} else {
arrayItem[newArrayKey] = JSON.stringify(tmpArrayKeyData);
}
} }
newResult.Response[instanceSet].push(arrayItem); newResult.Response[instanceSet].push(arrayItem);
} }
...@@ -123,10 +126,10 @@ class APIBase { ...@@ -123,10 +126,10 @@ class APIBase {
const dataKey = dataKeys[j]; const dataKey = dataKeys[j];
const newDataKey = await self.InitialToUpperMulti(self, dataKey); const newDataKey = await self.InitialToUpperMulti(self, dataKey);
const dataElement = element[dataKey]; const dataElement = element[dataKey];
if (dataElement) { if (typeof dataElement === 'string' || typeof dataElement === "number" || dataElement instanceof Date || !dataElement) {
newResult.Response[instanceSet][newDataKey] = typeof dataElement === 'string' ? dataElement : JSON.stringify(dataElement); newResult.Response[instanceSet][newDataKey] = dataElement;
} else { } else {
newResult.Response[instanceSet][newDataKey] = ""; newResult.Response[instanceSet][newDataKey] = JSON.stringify(dataElement);
} }
} }
} }
......
...@@ -96,7 +96,7 @@ class Dao { ...@@ -96,7 +96,7 @@ class Dao {
qc.where = {}; qc.where = {};
if (search) { if (search) {
Object.keys(search).forEach(k => { Object.keys(search).forEach(k => {
console.log(search[k], ":search[k]search[k]search[k]"); // console.log(search[k], ":search[k]search[k]search[k]");
if (search[k] && search[k] != 'undefined' && search[k] != "") { if (search[k] && search[k] != 'undefined' && search[k] != "") {
if ((k.indexOf("Date") >= 0 || k.indexOf("_at") >= 0)) { if ((k.indexOf("Date") >= 0 || k.indexOf("_at") >= 0)) {
if (search[k] != "" && search[k]) { if (search[k] != "" && search[k]) {
...@@ -139,8 +139,6 @@ class Dao { ...@@ -139,8 +139,6 @@ class Dao {
if (attributesObj && attributesObj.length > 0) { if (attributesObj && attributesObj.length > 0) {
qc.attributes = attributesObj; qc.attributes = attributesObj;
} }
console.log("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm");
console.log(qc);
return qc; return qc;
} }
async findAndCountAll(qobj, t) { async findAndCountAll(qobj, t) {
......
...@@ -18,15 +18,10 @@ class DbFactory { ...@@ -18,15 +18,10 @@ class DbFactory {
async initModels() { async initModels() {
var self = this; var self = this;
var modelpath = path.normalize(path.join(__dirname, '../..')) + "/models/"; var modelpath = path.normalize(path.join(__dirname, '../..')) + "/models/";
console.log("modelpath=====================================================");
console.log(modelpath);
var models = glob.sync(modelpath + "/**/*.js"); var models = glob.sync(modelpath + "/**/*.js");
console.log(models.length);
models.forEach(function (m) { models.forEach(function (m) {
console.log(m);
self.db.import(m); self.db.import(m);
}); });
console.log("init models....");
} }
async initRelations() { async initRelations() {
/** /**
......
...@@ -11,8 +11,6 @@ class NeedInfoDao extends Dao { ...@@ -11,8 +11,6 @@ class NeedInfoDao extends Dao {
sql += "where xp.path_code=:path_code and xp.region_id=:region_id"; sql += "where xp.path_code=:path_code and xp.region_id=:region_id";
try { try {
var list = await this.customQuery(sql, obj); var list = await this.customQuery(sql, obj);
console.log(list);
console.log(list[0]);
var rtn = {}; var rtn = {};
if (list && list.length > 0) { if (list && list.length > 0) {
rtn.servicer_code = list[0].servicer_code; rtn.servicer_code = list[0].servicer_code;
...@@ -45,7 +43,6 @@ class NeedInfoDao extends Dao { ...@@ -45,7 +43,6 @@ class NeedInfoDao extends Dao {
params.region_name = region_name; params.region_name = region_name;
} }
var sql = "select * from v_service_allot_business" + (whereSql ? " where " + whereSql : ""); var sql = "select * from v_service_allot_business" + (whereSql ? " where " + whereSql : "");
// console.log('-------------------' + sql);
var result = await this.customQuery(sql, params); var result = await this.customQuery(sql, params);
return result return result
} }
......
...@@ -6,24 +6,24 @@ class OrderInfoDao extends Dao{ ...@@ -6,24 +6,24 @@ class OrderInfoDao extends Dao{
} }
//获取订单列表 //获取订单列表
async getOrderList(ab){ async getOrderList(ab){
var pagesize = ab.pagesize? Number(ab.pagesize) : 10; var pagesize = ab.Pagesize? Number(ab.Pagesize) : 10;
var currentpage = ab.currentpage? Number(ab.currentpage) : 1; var currentpage = ab.Currentpage? Number(ab.Currentpage) : 1;
var offset = pagesize * (currentpage-1); var offset = pagesize * (currentpage-1);
var sortType="desc"; var sortType="desc";
if(ab.sortType && ab.sortType=="asc" ){//排序方式:desc ase if(ab.SortType && ab.SortType=="asc" ){//排序方式:desc ase
sortType = "asc"; sortType = "asc";
} }
var sortItem = "updated_at"; var sortItem = "updated_at";
if(ab.sortItem && ab.sortItem == "payTime"){ if(ab.SortItem && ab.SortItem == "payTime"){
sortItem="pay_time"; sortItem="pay_time";
} }
if(ab.sortItem && ab.sortItem == "endTime"){ if(ab.SortItem && ab.SortItem == "endTime"){
sortItem="end_time"; sortItem="end_time";
} }
var params = { var params = {
product_type:ab.productType, product_type:ab.ProductType,
user_id:ab.user_id, user_id:ab.UserId,
limit:pagesize, limit:pagesize,
offset:offset offset:offset
}; };
...@@ -31,34 +31,34 @@ class OrderInfoDao extends Dao{ ...@@ -31,34 +31,34 @@ class OrderInfoDao extends Dao{
var sql = "SELECT order_num,delivery_status,updated_at,order_snapshot "+ var sql = "SELECT order_num,delivery_status,updated_at,order_snapshot "+
" from v_order_oproduct_odelivery where product_type=:product_type and user_id=:user_id"; " from v_order_oproduct_odelivery where product_type=:product_type and user_id=:user_id";
if(ab.productType=="/ic/gsreg/"){//公司注册筛选条件 if(ab.ProductType=="/ic/gsreg/"){//公司注册筛选条件
if(ab.companyProperties){//公司性质 if(ab.CompanyProperties){//公司性质
sql = sql +" and order_snapshot->'$.companyProperties' =:companyProperties "; sql = sql +" and order_snapshot->'$.companyProperties' =:companyProperties ";
sqlcount = sqlcount +" and order_snapshot->'$.companyProperties' =:companyProperties "; sqlcount = sqlcount +" and order_snapshot->'$.companyProperties' =:companyProperties ";
params["companyProperties"]=ab.companyProperties; params["companyProperties"]=ab.CompanyProperties;
} }
if(ab.taxpayerType){//纳税人类型 if(ab.TaxpayerType){//纳税人类型
sql = sql +" and order_snapshot->'$.taxpayerType' =:taxpayerType "; sql = sql +" and order_snapshot->'$.taxpayerType' =:taxpayerType ";
sqlcount = sqlcount +" and order_snapshot->'$.taxpayerType' =:taxpayerType "; sqlcount = sqlcount +" and order_snapshot->'$.taxpayerType' =:taxpayerType ";
params["taxpayerType"]=ab.taxpayerType; params["taxpayerType"]=ab.TaxpayerType;
} }
} }
if(ab.productType=="/ic/cpreg/"){//云上园区注册 if(ab.ProductType=="/ic/cpreg/"){//云上园区注册
if(ab.taxpayerType){//纳税人类型 if(ab.TaxpayerType){//纳税人类型
sql = sql +" and order_snapshot->'$.taxpayerType' =:taxpayerType "; sql = sql +" and order_snapshot->'$.taxpayerType' =:taxpayerType ";
sqlcount = sqlcount +" and order_snapshot->'$.taxpayerType' =:taxpayerType "; sqlcount = sqlcount +" and order_snapshot->'$.taxpayerType' =:taxpayerType ";
params["taxpayerType"]=ab.taxpayerType; params["taxpayerType"]=ab.TaxpayerType;
} }
if(ab.registeredType){//注册类型 if(ab.RegisteredType){//注册类型
sql = sql +" and order_snapshot->'$.registeredType' =:registeredType "; sql = sql +" and order_snapshot->'$.registeredType' =:registeredType ";
sqlcount = sqlcount +" and order_snapshot->'$.registeredType' =:registeredType "; sqlcount = sqlcount +" and order_snapshot->'$.registeredType' =:registeredType ";
params["registeredType"]=ab.registeredType; params["registeredType"]=ab.RegisteredType;
} }
} }
if(ab.deliveryStatus){//当前状态 if(ab.DeliveryStatus){//当前状态
sql = sql +" and delivery_status =:delivery_status "; sql = sql +" and delivery_status =:delivery_status ";
sqlcount = sqlcount +" and delivery_status =:delivery_status "; sqlcount = sqlcount +" and delivery_status =:delivery_status ";
params["delivery_status"]=ab.deliveryStatus; params["delivery_status"]=ab.DeliveryStatus;
} }
sql = sql +" order by "+sortItem+" "+sortType+" limit :limit offset :offset "; sql = sql +" order by "+sortItem+" "+sortType+" limit :limit offset :offset ";
var list = await this.customQuery(sql,params); var list = await this.customQuery(sql,params);
...@@ -69,23 +69,23 @@ class OrderInfoDao extends Dao{ ...@@ -69,23 +69,23 @@ class OrderInfoDao extends Dao{
} }
//获取资质订单列表 //获取资质订单列表
async getQcOrderList(ab){ async getQcOrderList(ab){
var pagesize = ab.pagesize? Number(ab.pagesize) : 10; var pagesize = ab.Pagesize? Number(ab.Pagesize) : 10;
var currentpage = ab.currentpage? Number(ab.currentpage) : 1; var currentpage = ab.Currentpage? Number(ab.Currentpage) : 1;
var offset = pagesize * (currentpage-1); var offset = pagesize * (currentpage-1);
var sortType="desc"; var sortType="desc";
if(ab.sortType && ab.sortType=="asc" ){//排序方式:desc ase if(ab.SortType && ab.SortType=="asc" ){//排序方式:desc ase
sortType = "asc"; sortType = "asc";
} }
var sortItem = "updated_at"; var sortItem = "updated_at";
if(ab.sortItem && ab.sortItem == "payTime"){ if(ab.SortItem && ab.SortItem == "payTime"){
sortItem="pay_time"; sortItem="pay_time";
} }
if(ab.sortItem && ab.sortItem == "endTime"){ if(ab.SortItem && ab.SortItem == "endTime"){
sortItem="end_time"; sortItem="end_time";
} }
var params = { var params = {
user_id:ab.user_id, user_id:ab.UserId,
limit:pagesize, limit:pagesize,
offset:offset offset:offset
}; };
...@@ -93,25 +93,25 @@ class OrderInfoDao extends Dao{ ...@@ -93,25 +93,25 @@ class OrderInfoDao extends Dao{
var sql = "SELECT product_type,order_num,delivery_status,updated_at,order_snapshot,deliver_content "+ var sql = "SELECT product_type,order_num,delivery_status,updated_at,order_snapshot,deliver_content "+
" from v_order_oproduct_odelivery where (product_type = '/qcfw/icp/' or product_type = '/qcfw/edi/') and user_id=:user_id"; " from v_order_oproduct_odelivery where (product_type = '/qcfw/icp/' or product_type = '/qcfw/edi/') and user_id=:user_id";
if(ab.productType=="/qcfw/icp/"){//icp if(ab.ProductType=="/qcfw/icp/"){//icp
sql = sql +" and product_type = :productType "; sql = sql +" and product_type = :productType ";
sqlcount = sqlcount +" and product_type = :productType "; sqlcount = sqlcount +" and product_type = :productType ";
params["productType"]=ab.productType; params["productType"]=ab.ProductType;
} }
if(ab.productType=="/qcfw/edi/"){//edi if(ab.ProductType=="/qcfw/edi/"){//edi
sql = sql +" and product_type = :productType "; sql = sql +" and product_type = :productType ";
sqlcount = sqlcount +" and product_type = :productType "; sqlcount = sqlcount +" and product_type = :productType ";
params["productType"]=ab.productType; params["productType"]=ab.ProductType;
} }
if(ab.companyName){//公司名称 if(ab.CompanyName){//公司名称
sql = sql +" and deliver_content->'$.proposerInfo' is not null and deliver_content->'$.proposerInfo.businessLicense' is not null and deliver_content->'$.proposerInfo.businessLicense.name' like :companyName "; sql = sql +" and deliver_content->'$.proposerInfo' is not null and deliver_content->'$.proposerInfo.businessLicense' is not null and deliver_content->'$.proposerInfo.businessLicense.name' like :companyName ";
sqlcount = sqlcount +" and deliver_content->'$.proposerInfo' is not null and deliver_content->'$.proposerInfo.businessLicense' is not null and deliver_content->'$.proposerInfo.businessLicense.name' like :companyName "; sqlcount = sqlcount +" and deliver_content->'$.proposerInfo' is not null and deliver_content->'$.proposerInfo.businessLicense' is not null and deliver_content->'$.proposerInfo.businessLicense.name' like :companyName ";
params["companyName"]="%"+ab.companyName+"%"; params["companyName"]="%"+ab.CompanyName+"%";
} }
if(ab.deliveryStatus){//当前状态 if(ab.DeliveryStatus){//当前状态
sql = sql +" and delivery_status =:delivery_status "; sql = sql +" and delivery_status =:delivery_status ";
sqlcount = sqlcount +" and delivery_status =:delivery_status "; sqlcount = sqlcount +" and delivery_status =:delivery_status ";
params["delivery_status"]=ab.deliveryStatus; params["delivery_status"]=ab.DeliveryStatus;
} }
sql = sql +" order by "+sortItem+" "+sortType+" limit :limit offset :offset "; sql = sql +" order by "+sortItem+" "+sortType+" limit :limit offset :offset ";
var list = await this.customQuery(sql,params); var list = await this.customQuery(sql,params);
......
...@@ -28,13 +28,13 @@ class OrderProductDao extends Dao { ...@@ -28,13 +28,13 @@ class OrderProductDao extends Dao {
async entTimeCreate(obj, t) { async entTimeCreate(obj, t) {
if (obj.created_at && obj.time_span && obj.time_unit) { if (obj.created_at && obj.time_span && obj.time_unit) {
if (obj.time_unit == "y") { if (obj.time_unit == "y") {
obj.end_time = obj.created_at.setYear(obj.created_at.getYear() + Number(obj.time_span)) obj.end_time = obj.created_at.setFullYear(obj.created_at.getFullYear() + Number(obj.time_span))
} }
if (obj.time_unit == "m") { if (obj.time_unit == "m") {
obj.end_time = obj.created_at.setMonth(obj.created_at.getMonth() + Number(obj.time_span)) obj.end_time = obj.created_at.setMonth(obj.created_at.getMonth() + Number(obj.time_span))
} }
if (obj.time_unit == "d") { if (obj.time_unit == "d") {
obj.end_time = obj.created_at.setYear(obj.created_at.getYear() + Number(obj.time_span)) obj.end_time = obj.created_at.setDate(obj.created_at.getDate() + Number(obj.time_span))
} }
} }
return await this.create(obj, t); return await this.create(obj, t);
......
...@@ -71,6 +71,7 @@ class TxPushLogService extends ServiceBase { ...@@ -71,6 +71,7 @@ class TxPushLogService extends ServiceBase {
if (!pobj.interface.para.resourceId) { if (!pobj.interface.para.resourceId) {
return self.returnTX(-1, "cgateway", "参数错误", null) return self.returnTX(-1, "cgateway", "参数错误", null)
} }
} }
async queryResources(pobj){ async queryResources(pobj){
......
...@@ -19,23 +19,23 @@ class ApplyInfoService extends ServiceBase { ...@@ -19,23 +19,23 @@ class ApplyInfoService extends ServiceBase {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
var ab = pobj.actionBody; var ab = pobj.actionBody;
if (!ab.userId) { if (!ab.UserId) {
return system.getResultFail(-102, "用户id不能为空"); return system.getResultFail(-102, "用户id不能为空");
} }
if (!ab.applyType) { if (!ab.ApplyType) {
return system.getResultFail(-103, "申请主体类型不能为空"); return system.getResultFail(-103, "申请主体类型不能为空");
} }
var limit = ab.pageSize ? Number(ab.pageSize) : 10; var limit = ab.PageSize ? Number(ab.PageSize) : 10;
var offset = ab.currentPage ? (Number(ab.currentPage) - 1) * limit : 0 var offset = ab.CurrentPage ? (Number(ab.CurrentPage) - 1) * limit : 0
var countObj = { apply_type: ab.applyType, user_id: ab.userId }; var countObj = { apply_type: ab.ApplyType, user_id: ab.UserId };
var whereObj = { apply_type: ab.applyType, user_id: ab.userId }; var whereObj = { apply_type: ab.ApplyType, user_id: ab.UserId };
if (ab.applyName) { if (ab.ApplyName) {
whereObj["apply_name"] = { [this.db.Op.like]: "%" + ab.applyName + "%" }; whereObj["apply_name"] = { [this.db.Op.like]: "%" + ab.ApplyName + "%" };
countObj["apply_name"] = { [this.db.Op.like]: "%" + ab.applyName + "%" }; countObj["apply_name"] = { [this.db.Op.like]: "%" + ab.ApplyName + "%" };
} }
if (ab.domicile) { if (ab.Domicile) {
whereObj["domicile"] = { [this.db.Op.like]: "%" + ab.domicile + "%" }; whereObj["domicile"] = { [this.db.Op.like]: "%" + ab.Domicile + "%" };
countObj["domicile"] = { [this.db.Op.like]: "%" + ab.domicile + "%" }; countObj["domicile"] = { [this.db.Op.like]: "%" + ab.Domicile + "%" };
} }
var count = await this.dao.findCount({ where: countObj }); var count = await this.dao.findCount({ where: countObj });
var list = await this.dao.model.findAll({ var list = await this.dao.model.findAll({
...@@ -68,14 +68,14 @@ class ApplyInfoService extends ServiceBase { ...@@ -68,14 +68,14 @@ class ApplyInfoService extends ServiceBase {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
var ab = pobj.actionBody; var ab = pobj.actionBody;
if (!ab.userId) { if (!ab.UserId) {
return system.getResultFail(-102, "用户id不能为空"); return system.getResultFail(-102, "用户id不能为空");
} }
if (!ab.creditCode) { if (!ab.CreditCode) {
return system.getResultFail(-103, "社会统一信用代码不能为空"); return system.getResultFail(-103, "社会统一信用代码不能为空");
} }
var applyinfo = await this.dao.model.findOne({ var applyinfo = await this.dao.model.findOne({
where: { user_id: ab.userId, credit_code: ab.creditCode }, where: { user_id: ab.UserId, credit_code: ab.CreditCode },
attributes: [ attributes: [
"user_id", "user_id",
"apply_name", "apply_name",
...@@ -94,7 +94,7 @@ class ApplyInfoService extends ServiceBase { ...@@ -94,7 +94,7 @@ class ApplyInfoService extends ServiceBase {
if (!applyinfo || !applyinfo.credit_code) { if (!applyinfo || !applyinfo.credit_code) {
return system.getResultFail(-300, "未知申请实体信息"); return system.getResultFail(-300, "未知申请实体信息");
} }
var list = await this.orderProductDao.findByCompanyAndUser(applyinfo.credit_code, ab.userId); var list = await this.orderProductDao.findByCompanyAndUser(applyinfo.credit_code, ab.UserId);
// var list = await this.dao.getPaidSolutionByApplyInfo(applyinfo); // var list = await this.dao.getPaidSolutionByApplyInfo(applyinfo);
var result = { applyInfo: applyinfo, productList: list }; var result = { applyInfo: applyinfo, productList: list };
return system.getResultSuccess(result); return system.getResultSuccess(result);
...@@ -107,22 +107,22 @@ class ApplyInfoService extends ServiceBase { ...@@ -107,22 +107,22 @@ class ApplyInfoService extends ServiceBase {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
var ab = pobj.actionBody; var ab = pobj.actionBody;
if (!ab.userId) { if (!ab.UserId) {
return system.getResultFail(-102, "用户id不能为空"); return system.getResultFail(-102, "用户id不能为空");
} }
if (!ab.productTypeOne) {//产品大类 if (!ab.ProductTypeOne) {//产品大类
return system.getResultFail(-103, "产品大类编码不能为空"); return system.getResultFail(-103, "产品大类编码不能为空");
} }
var productTypeOne = "/" + ab.productTypeOne + "/" var productTypeOne = "/" + ab.ProductTypeOne + "/"
// { [this.db.Op.like]: productTypeOne } // { [this.db.Op.like]: productTypeOne }
var companyCount = await this.dao.findCount({ where: { apply_type: 1, user_id: ab.userId } });//公司数量 var companyCount = await this.dao.findCount({ where: { apply_type: 1, user_id: ab.UserId } });//公司数量
var selfEmployedPersonCount = await this.dao.findCount({ where: { apply_type: 2, user_id: ab.userId } });//个体户数量 var selfEmployedPersonCount = await this.dao.findCount({ where: { apply_type: 2, user_id: ab.UserId } });//个体户数量
var waitConfirmCount = await this.needInfoDao.findCount({ where: { status: 3, user_id: ab.userId, consult_type: { [this.db.Op.like]: productTypeOne } } });//待确认方案数量 var waitConfirmCount = await this.needInfoDao.findCount({ where: { status: 3, user_id: ab.UserId, consult_type: { [this.db.Op.like]: productTypeOne } } });//待确认方案数量
var waitReceiveFileOrderCount = await this.orderDeliveryDao.findOverviewCount(13, ab.userId, ab.productTypeOne);//待收文件数量 var waitReceiveFileOrderCount = await this.orderDeliveryDao.findOverviewCount(13, ab.UserId, ab.ProductTypeOne);//待收文件数量
// var unpaidCount = await this.orderInfoDao.findCount({where:{order_status:0}});//待支付订单数量 // var unpaidCount = await this.orderInfoDao.findCount({where:{order_status:0}});//待支付订单数量
if(ab.productTypeOne == "qcfw"){//资质证照 if(ab.ProductTypeOne == "qcfw"){//资质证照
var icpCount = await this.orderInfoDao.findOrderCountByProductPathCode("/qcfw/icp/",ab.userId);//icp数量 var icpCount = await this.orderInfoDao.findOrderCountByProductPathCode("/qcfw/icp/",ab.UserId);//icp数量
var ediCount = await this.orderInfoDao.findOrderCountByProductPathCode("/qcfw/edi/",ab.userId);//edi数量 var ediCount = await this.orderInfoDao.findOrderCountByProductPathCode("/qcfw/edi/",ab.UserId);//edi数量
var resultObj = { var resultObj = {
icpCount: icpCount, waitConfirmCount: waitConfirmCount, ediCount: ediCount, icpCount: icpCount, waitConfirmCount: waitConfirmCount, ediCount: ediCount,
waitReceiveFileOrderCount: waitReceiveFileOrderCount waitReceiveFileOrderCount: waitReceiveFileOrderCount
......
...@@ -69,13 +69,13 @@ class OrderDeliveryService extends ServiceBase { ...@@ -69,13 +69,13 @@ class OrderDeliveryService extends ServiceBase {
return system.getResultFail(-100,"参数错误"); return system.getResultFail(-100,"参数错误");
} }
var ab = pobj.actionBody; var ab = pobj.actionBody;
if(!ab.userId){ if(!ab.UserId){
return system.getResultFail(-101,"用户id不能为空"); return system.getResultFail(-101,"用户id不能为空");
} }
if(!ab.status){ if(!ab.Status){
return system.getResultFail(-102,"订单状态不能为空"); return system.getResultFail(-102,"订单状态不能为空");
} }
var list = await this.dao.getOrderListByStatus(ab.userId,ab.status); var list = await this.dao.getOrderListByStatus(ab.UserId,ab.Status);
return system.getResultSuccess(list); return system.getResultSuccess(list);
} }
......
...@@ -17,14 +17,14 @@ class OrderInfoService extends ServiceBase { ...@@ -17,14 +17,14 @@ class OrderInfoService extends ServiceBase {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
var ab = pobj.actionBody; var ab = pobj.actionBody;
if (!ab.orderNum) { if (!ab.OrderNum) {
return system.getResultFail(-101, "订单号不能为空"); return system.getResultFail(-101, "订单号不能为空");
} }
if (!ab.user_id) { if (!ab.UserId) {
return system.getResultFail(-102, "用户id不能为空"); return system.getResultFail(-102, "用户id不能为空");
} }
var queryParam = { var queryParam = {
where: { order_num: ab.orderNum, user_id: ab.user_id }, where: { order_num: ab.OrderNum, user_id: ab.UserId },
attributes: [ attributes: [
"order_num", "order_num",
"tx_orders_num", //腾讯主订单号 "tx_orders_num", //腾讯主订单号
...@@ -46,7 +46,7 @@ class OrderInfoService extends ServiceBase { ...@@ -46,7 +46,7 @@ class OrderInfoService extends ServiceBase {
return system.getResultFail(-300, "未知订单信息"); return system.getResultFail(-300, "未知订单信息");
} }
var deliveryParams = { var deliveryParams = {
where: { order_num: ab.orderNum }, where: { order_num: ab.OrderNum },
attributes: ["deliver_content", "created_at", "updated_at", "delivery_status", "delivery_status_name"], attributes: ["deliver_content", "created_at", "updated_at", "delivery_status", "delivery_status_name"],
raw: true raw: true
}; };
...@@ -60,10 +60,10 @@ class OrderInfoService extends ServiceBase { ...@@ -60,10 +60,10 @@ class OrderInfoService extends ServiceBase {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
var ab = pobj.actionBody; var ab = pobj.actionBody;
if (!ab.user_id) { if (!ab.UserId) {
return system.getResultFail(-102, "用户id不能为空"); return system.getResultFail(-102, "用户id不能为空");
} }
if (!ab.productType) { if (!ab.ProductType) {
return system.getResultFail(-103, "产品类型不能为空"); return system.getResultFail(-103, "产品类型不能为空");
} }
var result = await this.dao.getOrderList(ab); var result = await this.dao.getOrderList(ab);
...@@ -76,7 +76,7 @@ class OrderInfoService extends ServiceBase { ...@@ -76,7 +76,7 @@ class OrderInfoService extends ServiceBase {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
var ab = pobj.actionBody; var ab = pobj.actionBody;
if (!ab.user_id) { if (!ab.UserId) {
return system.getResultFail(-102, "用户id不能为空"); return system.getResultFail(-102, "用户id不能为空");
} }
var result = await this.dao.getQcOrderList(ab); var result = await this.dao.getQcOrderList(ab);
...@@ -312,13 +312,13 @@ class OrderInfoService extends ServiceBase { ...@@ -312,13 +312,13 @@ class OrderInfoService extends ServiceBase {
return system.getResultFail(-101, "txorder is error"); return system.getResultFail(-101, "txorder is error");
} }
var txorderdetail = txorder.data.deals[0]; var txorderdetail = txorder.data.deals[0];
console.log(txorderdetail.goodsDetail); console.log(txorderdetail.goodsDetail,"....txorderdetail.goodsDetail.....1");
var self = this; var self = this;
var corder = await self.db.transaction(async function (t) { var corder = await self.db.transaction(async function (t) {
var oldorder = await self.findOne({}) var oldorder = await self.findOne({})
//创建订单 //创建订单
var txorderdetail = txorder.data.deals[0]; var txorderdetail = txorder.data.deals[0];
console.log(txorderdetail.goodsDetail); console.log(txorderdetail.goodsDetail,"....txorderdetail.goodsDetail...2");
var orderobj = { var orderobj = {
tx_orders_num: pobj.actionBody.interface.para.bigDealId, tx_orders_num: pobj.actionBody.interface.para.bigDealId,
order_num: pobj.actionBody.interface.para.dealName, order_num: pobj.actionBody.interface.para.dealName,
...@@ -434,7 +434,7 @@ class OrderInfoService extends ServiceBase { ...@@ -434,7 +434,7 @@ class OrderInfoService extends ServiceBase {
if (!pobj.actionBody.registeredType) { if (!pobj.actionBody.registeredType) {
return system.getResultFail(-101, "registeredType is empty"); return system.getResultFail(-101, "registeredType is empty");
} }
priceName = pobj.actionBody.companyProperties; priceName = pobj.actionBody.registeredType;
} }
//刻章服务 //刻章服务
if (pobj.actionBody.pathCode == "/ic/kzfw/") { if (pobj.actionBody.pathCode == "/ic/kzfw/") {
...@@ -635,70 +635,8 @@ class OrderInfoService extends ServiceBase { ...@@ -635,70 +635,8 @@ class OrderInfoService extends ServiceBase {
"url": "https://buy.cloud.tencent.com/order/check", "url": "https://buy.cloud.tencent.com/order/check",
"param": so "param": so
} }
console.log(so);
return system.getResultSuccess(robj); return system.getResultSuccess(robj);
} }
// //创建申请实体
// async createApplyInfo(orderNum) {
// try {
// var orderProduct = await this.orderProductDao.model.findOne({
// where: { order_num: orderNum },
// raw: true
// });
// if (orderProduct && orderProduct.order_snapshot && orderProduct.user_id) {
// var order_snapshot = orderProduct.order_snapshot;
// if (order_snapshot.creditCode) {
// var applyinfo = await this.applyInfoDao.model.findOne({
// where: { credit_code: order_snapshot.creditCode, user_id: orderProduct.user_id },
// raw: true
// });
// if (!applyinfo || !applyinfo.id) {//创建申请实体
// var newObj = {
// servicer_code: orderProduct.servicer_code,
// servicer_name: orderProduct.servicer_name,
// user_id: orderProduct.user_id,
// user_name: orderProduct.user_name,
// apply_name: order_snapshot.companyName,
// credit_code: order_snapshot.creditCode,
// apply_type: order_snapshot.companyType == "个体工商户" ? 2 : 1,
// operator: order_snapshot.shareholderName,
// regist_capital: order_snapshot.registeredCapital,
// business_term_start: order_snapshot.businessTerm,
// establish_time: order_snapshot.establishedTime,
// business_term_end: order_snapshot.businessTerm,
// domicile: order_snapshot.residenceAddress,
// ent_type: order_snapshot.companyType,
// business_scope: order_snapshot.businessScope
// };
// applyinfo = await this.applyInfoDao.create(newObj);
// } else {//更新实体信息
// var updateObj = {
// apply_name: order_snapshot.companyName,
// credit_code: order_snapshot.creditCode,
// apply_type: order_snapshot.companyType == "个体工商户" ? 2 : 1,
// operator: order_snapshot.shareholderName,
// regist_capital: order_snapshot.registeredCapital,
// business_term_start: order_snapshot.businessTerm,
// establish_time: order_snapshot.establishedTime,
// business_term_end: order_snapshot.businessTerm,
// domicile: order_snapshot.residenceAddress,
// ent_type: order_snapshot.companyType,
// business_scope: order_snapshot.businessScope
// };
// await this.applyInfoDao.dao.update(updateObj, { where: { id: applyinfo.id } });//更新主体信息
// }
// }
// }
// } catch (e) {
// console.log(e,"创建申请实体异常");
// }
// }
} }
module.exports = OrderInfoService; module.exports = OrderInfoService;
......
...@@ -18,22 +18,22 @@ class QualificationCertificateService extends ServiceBase { ...@@ -18,22 +18,22 @@ class QualificationCertificateService extends ServiceBase {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
var ab = pobj.actionBody; var ab = pobj.actionBody;
if (!ab.userId) { if (!ab.UserId) {
return system.getResultFail(-102, "用户id不能为空"); return system.getResultFail(-102, "用户id不能为空");
} }
if (!ab.licenseType) { if (!ab.LicenseType) {
return system.getResultFail(-103, "证照类型不能为空"); return system.getResultFail(-103, "证照类型不能为空");
} }
var limit = ab.pageSize ? Number(ab.pageSize) : 10; var limit = ab.PageSize ? Number(ab.PageSize) : 10;
var offset = ab.currentPage ? (Number(ab.currentPage) - 1) * limit : 0 var offset = ab.CurrentPage ? (Number(ab.CurrentPage) - 1) * limit : 0
var countObj = { license_type: ab.licenseType, user_id: ab.userId }; var countObj = { license_type: ab.LicenseType, user_id: ab.UserId };
var whereObj = { license_type: ab.licenseType, user_id: ab.userId }; var whereObj = { license_type: ab.LicenseType, user_id: ab.UserId };
if (ab.companyName) { if (ab.CompanyName) {
whereObj["company_name"] = { [this.db.Op.like]: "%" + ab.companyName + "%" }; whereObj["company_name"] = { [this.db.Op.like]: "%" + ab.CompanyName + "%" };
countObj["company_name"] = { [this.db.Op.like]: "%" + ab.companyName + "%" }; countObj["company_name"] = { [this.db.Op.like]: "%" + ab.CompanyName + "%" };
} }
var sortType = "desc"; var sortType = "desc";
if(ab.sortType && ab.sortType=="asc"){ if(ab.SortType && ab.SortType=="asc"){
sortType = "asc"; sortType = "asc";
} }
var count = await this.dao.findCount({ where: countObj }); var count = await this.dao.findCount({ where: countObj });
...@@ -73,15 +73,15 @@ class QualificationCertificateService extends ServiceBase { ...@@ -73,15 +73,15 @@ class QualificationCertificateService extends ServiceBase {
return system.getResultFail(-100, "参数错误"); return system.getResultFail(-100, "参数错误");
} }
var ab = pobj.actionBody; var ab = pobj.actionBody;
if (!ab.userId) { if (!ab.UserId) {
return system.getResultFail(-102, "用户id不能为空"); return system.getResultFail(-102, "用户id不能为空");
} }
if (!ab.certificateNo) { if (!ab.CertificateNo) {
return system.getResultFail(-103, "证书编号不能为空"); return system.getResultFail(-103, "证书编号不能为空");
} }
//获取资质证照信息 //获取资质证照信息
var qualificationCertificate = await this.dao.model.findOne({ var qualificationCertificate = await this.dao.model.findOne({
where: { user_id: ab.userId, certificate_no: ab.certificateNo }, where: { user_id: ab.UserId, certificate_no: ab.CertificateNo },
attributes: [ attributes: [
"user_id", "user_id",
"certificate_no", "certificate_no",
...@@ -102,7 +102,7 @@ class QualificationCertificateService extends ServiceBase { ...@@ -102,7 +102,7 @@ class QualificationCertificateService extends ServiceBase {
} }
var result = { qualificationCertificate: qualificationCertificate, businessLicenseInfo: null, annualReportList:null}; var result = { qualificationCertificate: qualificationCertificate, businessLicenseInfo: null, annualReportList:null};
//获取营业执照信息及腾讯订单号 //获取营业执照信息及腾讯订单号
var businessLicenseInfo = await this.orderDeliveryDao.findByCertificateNoAndUser(qualificationCertificate.certificate_no, ab.userId); var businessLicenseInfo = await this.orderDeliveryDao.findByCertificateNoAndUser(qualificationCertificate.certificate_no, ab.UserId);
if(businessLicenseInfo && businessLicenseInfo.length>0){ if(businessLicenseInfo && businessLicenseInfo.length>0){
result.businessLicenseInfo = businessLicenseInfo[0]; result.businessLicenseInfo = businessLicenseInfo[0];
} }
......
...@@ -217,7 +217,7 @@ class System { ...@@ -217,7 +217,7 @@ class System {
try { try {
ClassObj = require(objabspath); ClassObj = require(objabspath);
} catch (e) { } catch (e) {
// console.log(e) console.log(e.stack, "......getObject......");
let fname = objsettings[packageName + "base"]; let fname = objsettings[packageName + "base"];
ClassObj = require(fname); ClassObj = require(fname);
} }
...@@ -225,9 +225,6 @@ class System { ...@@ -225,9 +225,6 @@ class System {
let modelname = filename.substring(0, filename.lastIndexOf("Dao")) let modelname = filename.substring(0, filename.lastIndexOf("Dao"))
return System.register(objabspath, ClassObj, modelname); return System.register(objabspath, ClassObj, modelname);
} }
if (ClassObj.name.indexOf("Ctl") >= 0) {
console.log(ClassObj.name);
}
return System.register(objabspath, ClassObj, groupName, filename); return System.register(objabspath, ClassObj, groupName, filename);
} }
} }
......
var childproc = require('child_process'); var childproc = require('child_process');
const system = require("../system");
const util = require('util'); const util = require('util');
const exec = util.promisify(require('child_process').exec); const exec = util.promisify(require('child_process').exec);
const settings = require("../../../app/config/settings"); const settings = require("../../../app/config/settings");
...@@ -107,7 +108,6 @@ class ExecClient { ...@@ -107,7 +108,6 @@ class ExecClient {
*/ */
async execGet(params, url, headData) { async execGet(params, url, headData) {
let cmd = this.FetchGetCmd(params, url, headData); let cmd = this.FetchGetCmd(params, url, headData);
console.log(cmd);
var result = await this.exec(cmd); var result = await this.exec(cmd);
return result; return result;
} }
...@@ -177,7 +177,6 @@ class ExecClient { ...@@ -177,7 +177,6 @@ class ExecClient {
FetchGetCmd(params, url, headData) { FetchGetCmd(params, url, headData) {
var cmd = this.cmdGetPattern.replace( var cmd = this.cmdGetPattern.replace(
/\{data\}/g, params).replace(/\{url\}/g, url); /\{data\}/g, params).replace(/\{url\}/g, url);
console.log(cmd);
return cmd; return cmd;
} }
FetchPostCmd(params, url, ContentType, headData) { FetchPostCmd(params, url, ContentType, headData) {
......
...@@ -20,7 +20,6 @@ module.exports = function (app) { ...@@ -20,7 +20,6 @@ module.exports = function (app) {
console.log(err); console.log(err);
res.send("文件不存在!"); res.send("文件不存在!");
} else { } else {
console.log(data);
str = marked(data.toString()); str = marked(data.toString());
res.render('apidoc', { str }); res.render('apidoc', { str });
} }
...@@ -35,7 +34,6 @@ module.exports = function (app) { ...@@ -35,7 +34,6 @@ module.exports = function (app) {
console.log(err); console.log(err);
res.send("文件不存在!"); res.send("文件不存在!");
} else { } else {
console.log(data);
str = marked(data.toString()); str = marked(data.toString());
res.render('apidoc', { str }); res.render('apidoc', { str });
} }
...@@ -66,9 +64,7 @@ module.exports = function (app) { ...@@ -66,9 +64,7 @@ module.exports = function (app) {
console.log(err); console.log(err);
res.send("文件不存在!"); res.send("文件不存在!");
} else { } else {
console.log(data);
str = marked(data.toString()); str = marked(data.toString());
console.log(str);
res.render('apidoc', { str }); res.render('apidoc', { str });
} }
}); });
......
This source diff could not be displayed because it is too large. You can view the blob instead.
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