Commit c7065bd9 by 宋毅

增加产品id

parent 3d97e9e2
var APIBase = require("../../api.base"); var APIBase = require("../../api.base");
var system = require("../../../system"); var system = require("../../../system");
var settings = require("../../../../config/settings"); var settings = require("../../../../config/settings");
class IcAPI extends APIBase { class IcAPI extends APIBase {
constructor() { constructor() {
super(); super();
...@@ -8,12 +9,13 @@ class IcAPI extends APIBase { ...@@ -8,12 +9,13 @@ class IcAPI extends APIBase {
this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve"); this.needsolutionSve = system.getObject("service.dbneed.needsolutionSve");
this.needinfoSve2 = system.getObject("service.dbneed.needinfoSve2"); this.needinfoSve2 = system.getObject("service.dbneed.needinfoSve2");
} }
/** /**
* 接口跳转-POST请求 * 接口跳转-POST请求
* action_process 执行的流程 * action_process 执行的流程
* action_type 执行的类型 * action_type 执行的类型
* action_body 执行的参数 * action_body 执行的参数
*/ */
async springBoard(pobj, qobj, req) { async springBoard(pobj, qobj, req) {
if (!pobj.actionType) { if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空"); return system.getResult(null, "actionType参数不能为空");
...@@ -29,6 +31,7 @@ class IcAPI extends APIBase { ...@@ -29,6 +31,7 @@ class IcAPI extends APIBase {
var result = await this.opActionProcess(pobj, pobj.actionType, req); var result = await this.opActionProcess(pobj, pobj.actionType, req);
return result; return result;
} }
async opActionProcess(pobj, action_type, req) { async opActionProcess(pobj, action_type, req) {
var opResult = null; var opResult = null;
switch (action_type) { switch (action_type) {
...@@ -87,5 +90,9 @@ class IcAPI extends APIBase { ...@@ -87,5 +90,9 @@ class IcAPI extends APIBase {
return opResult; return opResult;
} }
async getNeedItemByChannelNeedNo(pobj, qobj, req) {
return await this.needinfoSve.getItemByChannelNeedNo(pobj);
}
} }
module.exports = IcAPI; module.exports = IcAPI;
\ No newline at end of file
...@@ -11,7 +11,7 @@ class OpPayOrder extends APIBase { ...@@ -11,7 +11,7 @@ class OpPayOrder extends APIBase {
var result = await this.orderinfoSve.opOrderPayCallBackTl(pobj, pobj.appInfo); var result = await this.orderinfoSve.opOrderPayCallBackTl(pobj, pobj.appInfo);
return result; return result;
} }
async receivePayCallBackNotifyByAliDing(pobj, qobj, req) { async receivePayCallBackNotifyByAliDing(pobj, qobj, req) {//钉钉接入的搁浅
var result = await this.orderinfoSve.opOrderPayCallBackAliDing(pobj, pobj.appInfo); var result = await this.orderinfoSve.opOrderPayCallBackAliDing(pobj, pobj.appInfo);
return result; return result;
} }
......
const system = require("../../../system"); const system = require("../../../system");
const Dao = require("../../dao.base"); const Dao = require("../../dao.base");
const {Op} = require("sequelize"); const {Op} = require("sequelize");
class NeedinfoDao extends Dao { class NeedinfoDao extends Dao {
constructor() { constructor() {
super(Dao.getModelName(NeedinfoDao)); super(Dao.getModelName(NeedinfoDao));
} }
async getItemByNeedNo(needNo) {
return await this.model.findOne({ async getItemByNeedNo(needNo) {
where: { return await this.model.findOne({
needNo: needNo where: {
}, needNo: needNo
attributes: [ },
"id", attributes: [
"uapp_id", "id",
"needNo", "uapp_id",
"channelNeedNo", "needNo",
"channelUserId", "channelNeedNo",
"followManUserId", "channelUserId",
"followManMobile", "followManUserId",
"city", "followManMobile",
"province", "city",
"publishContent", "province",
"publishName", "publishContent",
"publishMobile", "publishName",
"notes", "publishMobile",
"followContent", "notes",
"disposeNotes", "followContent",
"status", "disposeNotes",
"statusName", "status",
"typeCode", "statusName",
"typeName", "typeCode",
"channelTypeCode", "typeName",
"channelTypeName", "channelTypeCode",
"publisherOnlyCode", "channelTypeName",
"followManName", "publisherOnlyCode",
"followManOnlyCode", "followManName",
"created_at"], "followManOnlyCode",
raw: true "created_at",
}); "appName",
} "serviceProductId"],
async getItemByChannelNeedNo(channelNeedNo) { raw: true
return await this.model.findOne({ });
where: { }
channelNeedNo: channelNeedNo
},
attributes: [
"id",
"uapp_id",
"needNo",
"channelNeedNo",
"channelUserId",
"followManUserId",
"followManMobile",
"city",
"province",
"publishContent",
"publishName",
"publishMobile",
"notes",
"followContent",
"disposeNotes",
"status",
"typeCode",
"typeName",
"channelTypeCode",
"channelTypeName",
"publisherOnlyCode",
"followManName",
"followManOnlyCode",
"created_at"
],
raw: true
});
}
/** async getItemByChannelNeedNo(channelNeedNo) {
* 根据ids 获取需求 return await this.model.findOne({
* @param ids where: {
* @returns {Promise<void>} channelNeedNo: channelNeedNo
*/ },
async getNeedsByIds(ids){ attributes: [
let needs = await this.findAll({ "id",
where: { "uapp_id",
channelNeedNo: { "needNo",
[Op.in]:ids "channelNeedNo",
} "channelUserId",
} "followManUserId",
}) "followManMobile",
return needs; "city",
} "province",
"publishContent",
"publishName",
"publishMobile",
"notes",
"followContent",
"disposeNotes",
"status",
"typeCode",
"typeName",
"channelTypeCode",
"channelTypeName",
"publisherOnlyCode",
"followManName",
"followManOnlyCode",
"created_at",
"appName",
"serviceProductId"],
raw: true
});
}
/** /**
* 批量更新 * 根据ids 获取需求
* @param needs * @param ids
* @returns {Promise<Array<Model>|*>} * @returns {Promise<void>}
*/ */
async bulkUpdate(needs){ async getNeedsByIds(ids) {
let result = await this.bulkCreate(needs,{ let needs = await this.findAll({
fields:["id", "status","statusName"] , where: {
updateOnDuplicate: ["status","statusName"] channelNeedNo: {
}); [Op.in]: ids
return result; }
} }
})
return needs;
}
/** /**
* 批量更新 * 批量更新
* @param needs * @param needs
* @returns {Promise<Array<Model>|*>} * @returns {Promise<Array<Model>|*>}
*/ */
async bulkUpdateStatus(status,statusName,ids){ async bulkUpdate(needs) {
let result = await this.updateByWhere({status:status,statusName:statusName},{ let result = await this.bulkCreate(needs, {
where : { fields: ["id", "status", "statusName"],
channelNeedNo:{ updateOnDuplicate: ["status", "statusName"]
[Op.in]:ids });
} return result;
} }
});
return result; /**
} * 批量更新
* @param needs
* @returns {Promise<Array<Model>|*>}
*/
async bulkUpdateStatus(status, statusName, ids) {
let result = await this.updateByWhere({status: status, statusName: statusName}, {
where: {
channelNeedNo: {
[Op.in]: ids
}
}
});
return result;
}
} }
module.exports = NeedinfoDao; module.exports = NeedinfoDao;
...@@ -38,6 +38,8 @@ module.exports = (db, DataTypes) => { ...@@ -38,6 +38,8 @@ module.exports = (db, DataTypes) => {
channelTypeName: DataTypes.STRING(255), //渠道产品类型名称', channelTypeName: DataTypes.STRING(255), //渠道产品类型名称',
level: DataTypes.STRING(20), //商机等级 level: DataTypes.STRING(20), //商机等级
probability: DataTypes.STRING(20), //商机概率 probability: DataTypes.STRING(20), //商机概率
appName: DataTypes.STRING(255), //渠道名称',
serviceProductId: DataTypes.STRING(255), //服务商产品id',
}, { }, {
paranoid: true,//假的删除 paranoid: true,//假的删除
underscored: true, underscored: true,
......
...@@ -1866,7 +1866,7 @@ class OrderInfoService extends ServiceBase { ...@@ -1866,7 +1866,7 @@ class OrderInfoService extends ServiceBase {
return system.getResultSuccess(resultParams); return system.getResultSuccess(resultParams);
} }
async opOrderPayCallBackAliDing(parmas, appInfo) {//操作订单付款回调---阿里钉钉 async opOrderPayCallBackAliDing(parmas, appInfo) {//操作订单付款回调---阿里钉钉-钉钉接入的搁浅
var item = await this.dao.getItemStatusByOrderNo(parmas.orderNo) var item = await this.dao.getItemStatusByOrderNo(parmas.orderNo)
if (!item) { if (!item) {
return system.getResult(null, "order data is empty!"); return system.getResult(null, "order data is empty!");
......
...@@ -16,7 +16,7 @@ class NeedinfoService extends ServiceBase { ...@@ -16,7 +16,7 @@ class NeedinfoService extends ServiceBase {
} }
async getItemByNeedNo(pobj) { async getItemByNeedNo(pobj) {
var item = await this.dao.getItemByNeedNo(pobj.actionBody.needNo); var item = await this.dao.getItemByNeedNo(pobj.actionBody.needNo);
console.log(system.getResultSuccess(item)); // console.log(system.getResultSuccess(item));
if (!item) { if (!item) {
return system.getResult(null, "需求数据为空,30210"); return system.getResult(null, "需求数据为空,30210");
} }
...@@ -101,6 +101,8 @@ class NeedinfoService extends ServiceBase { ...@@ -101,6 +101,8 @@ class NeedinfoService extends ServiceBase {
status: "wts", status: "wts",
level: actionBody.level || "", level: actionBody.level || "",
probability: actionBody.probability || "", probability: actionBody.probability || "",
appName: actionBody.appName,
serviceProductId: actionBody.service_product_id,
notes: actionBody.notes notes: actionBody.notes
} }
if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) { if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) {
...@@ -144,6 +146,8 @@ class NeedinfoService extends ServiceBase { ...@@ -144,6 +146,8 @@ class NeedinfoService extends ServiceBase {
typeName: actionBody.type_name, typeName: actionBody.type_name,
channelTypeCode: actionBody.channel_type_code, channelTypeCode: actionBody.channel_type_code,
channelTypeName: actionBody.channel_type_name, channelTypeName: actionBody.channel_type_name,
appName: actionBody.appName,
serviceProductId: actionBody.service_product_id,
status: "wts" status: "wts"
} }
if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) { if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) {
...@@ -397,9 +401,9 @@ class NeedinfoService extends ServiceBase { ...@@ -397,9 +401,9 @@ class NeedinfoService extends ServiceBase {
"created_at": item.createdAt "created_at": item.createdAt
}; };
if(["icp","edi","icp年报","edi年报"].includes(item.productType)){ if(["icp","edi","icp年报","edi年报"].includes(item.productType)){
obj.province = item.area; obj.province = item.area || "";
}else{ }else{
obj.city = item.area; obj.city = item.area || "";
} }
if(!existIds.includes(item.number)){ if(!existIds.includes(item.number)){
needsArr.push(obj); needsArr.push(obj);
......
...@@ -80,7 +80,7 @@ class NeedinfoService2 extends ServiceBase { ...@@ -80,7 +80,7 @@ class NeedinfoService2 extends ServiceBase {
publishName: actionBody.userName, publishName: actionBody.userName,
publishContent: actionBody.description, publishContent: actionBody.description,
publishMobile: actionBody.mobile, publishMobile: actionBody.mobile,
city: actionBody.area, city: actionBody.area || "",
// disposeNotes: actionBody.ext, // disposeNotes: actionBody.ext,
typeCode: actionBody.type_code, typeCode: actionBody.type_code,
typeName: actionBody.type_name, typeName: actionBody.type_name,
...@@ -127,7 +127,7 @@ class NeedinfoService2 extends ServiceBase { ...@@ -127,7 +127,7 @@ class NeedinfoService2 extends ServiceBase {
publishName: actionBody.userName, publishName: actionBody.userName,
publishContent: actionBody.description, publishContent: actionBody.description,
publishMobile: actionBody.mobile, publishMobile: actionBody.mobile,
city: actionBody.area, city: actionBody.area || "",
typeCode: actionBody.type_code, typeCode: actionBody.type_code,
typeName: actionBody.type_name, typeName: actionBody.type_name,
channelTypeCode: actionBody.channel_type_code, channelTypeCode: actionBody.channel_type_code,
...@@ -135,7 +135,7 @@ class NeedinfoService2 extends ServiceBase { ...@@ -135,7 +135,7 @@ class NeedinfoService2 extends ServiceBase {
status: "wts" status: "wts"
} }
if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) { if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) {
nobj.province = nobj.city, nobj.province = nobj.city || "",
nobj.city = ""; nobj.city = "";
} }
await this.dao.create(nobj); await this.dao.create(nobj);
...@@ -283,7 +283,7 @@ class NeedinfoService2 extends ServiceBase { ...@@ -283,7 +283,7 @@ class NeedinfoService2 extends ServiceBase {
publishName: actionBody.UserName, publishName: actionBody.UserName,
publishContent: actionBody.Description, publishContent: actionBody.Description,
publishMobile: actionBody.Mobile, publishMobile: actionBody.Mobile,
city: actionBody.Area, city: actionBody.Area || "",
typeCode: actionBody.type_code, typeCode: actionBody.type_code,
typeName: actionBody.type_name, typeName: actionBody.type_name,
channelTypeCode: actionBody.channel_type_code, channelTypeCode: actionBody.channel_type_code,
...@@ -291,7 +291,7 @@ class NeedinfoService2 extends ServiceBase { ...@@ -291,7 +291,7 @@ class NeedinfoService2 extends ServiceBase {
status: "wts" status: "wts"
} }
if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) { if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) {
nobj.province = nobj.city, nobj.province = nobj.city || "",
nobj.city = ""; nobj.city = "";
} }
await this.dao.create(nobj); await this.dao.create(nobj);
......
...@@ -448,7 +448,7 @@ class NeedsolutionService extends ServiceBase { ...@@ -448,7 +448,7 @@ class NeedsolutionService extends ServiceBase {
solution = { solution = {
"companyName": ab.companyName, "companyName": ab.companyName,
"area": ab.area, "area": ab.area,
"city": ab.city, "city": ab.city || "",
"companyCategory": ab.companyCategory, "companyCategory": ab.companyCategory,
"companyType": ab.companyType, "companyType": ab.companyType,
"orgType": ab.orgType, "orgType": ab.orgType,
......
...@@ -43,6 +43,8 @@ class NeedinfoService extends ServiceBase { ...@@ -43,6 +43,8 @@ class NeedinfoService extends ServiceBase {
typeName: actionBody.type_name, typeName: actionBody.type_name,
channelTypeCode: actionBody.channel_type_code, channelTypeCode: actionBody.channel_type_code,
channelTypeName: actionBody.channel_type_name, channelTypeName: actionBody.channel_type_name,
appName: actionBody.appName,
serviceProductId: actionBody.service_product_id,
status: "wts" status: "wts"
} }
var r = await this.dao.create(nobj); var r = await this.dao.create(nobj);
...@@ -474,7 +476,7 @@ class NeedinfoService extends ServiceBase { ...@@ -474,7 +476,7 @@ class NeedinfoService extends ServiceBase {
if(!existIds.includes(fqNeed.channelNeedNo)){ if(!existIds.includes(fqNeed.channelNeedNo)){
let obj = { let obj = {
channelNeedNo:fqNeed.channelNeedNo, channelNeedNo:fqNeed.channelNeedNo,
city:fqNeed.city, city:fqNeed.city || "",
province:fqNeed.province, province:fqNeed.province,
publishMobile:fqNeed.publishMobile, publishMobile:fqNeed.publishMobile,
disposeNotes:fqNeed.disposeNotes, disposeNotes:fqNeed.disposeNotes,
......
...@@ -85,7 +85,7 @@ class RegCenterOrderService{ ...@@ -85,7 +85,7 @@ class RegCenterOrderService{
publishName: actionBody.userName, publishName: actionBody.userName,
publishContent: actionBody.description, publishContent: actionBody.description,
publishMobile: actionBody.mobile, publishMobile: actionBody.mobile,
city: actionBody.area, city: actionBody.area || "",
// disposeNotes: actionBody.ext, // disposeNotes: actionBody.ext,
typeCode: actionBody.type_code, typeCode: actionBody.type_code,
typeName: actionBody.type_name, typeName: actionBody.type_name,
...@@ -94,6 +94,8 @@ class RegCenterOrderService{ ...@@ -94,6 +94,8 @@ class RegCenterOrderService{
status: "wts", status: "wts",
level: actionBody.level || "", level: actionBody.level || "",
probability: actionBody.probability || "", probability: actionBody.probability || "",
appName: actionBody.appName,
serviceProductId: actionBody.service_product_id,
notes: actionBody.notes || "" notes: actionBody.notes || ""
} }
// if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) { // if (nobj.channelTypeCode == 7 || nobj.channelTypeCode == 5) {
......
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