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,6 +9,7 @@ class IcAPI extends APIBase { ...@@ -8,6 +9,7 @@ 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 执行的流程
...@@ -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) { async getItemByNeedNo(needNo) {
return await this.model.findOne({ return await this.model.findOne({
where: { where: {
...@@ -35,10 +37,13 @@ class NeedinfoDao extends Dao { ...@@ -35,10 +37,13 @@ class NeedinfoDao extends Dao {
"publisherOnlyCode", "publisherOnlyCode",
"followManName", "followManName",
"followManOnlyCode", "followManOnlyCode",
"created_at"], "created_at",
"appName",
"serviceProductId"],
raw: true raw: true
}); });
} }
async getItemByChannelNeedNo(channelNeedNo) { async getItemByChannelNeedNo(channelNeedNo) {
return await this.model.findOne({ return await this.model.findOne({
where: { where: {
...@@ -68,8 +73,9 @@ class NeedinfoDao extends Dao { ...@@ -68,8 +73,9 @@ class NeedinfoDao extends Dao {
"publisherOnlyCode", "publisherOnlyCode",
"followManName", "followManName",
"followManOnlyCode", "followManOnlyCode",
"created_at" "created_at",
], "appName",
"serviceProductId"],
raw: true raw: true
}); });
} }
...@@ -79,11 +85,11 @@ class NeedinfoDao extends Dao { ...@@ -79,11 +85,11 @@ class NeedinfoDao extends Dao {
* @param ids * @param ids
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async getNeedsByIds(ids){ async getNeedsByIds(ids) {
let needs = await this.findAll({ let needs = await this.findAll({
where: { where: {
channelNeedNo: { channelNeedNo: {
[Op.in]:ids [Op.in]: ids
} }
} }
}) })
...@@ -95,10 +101,10 @@ class NeedinfoDao extends Dao { ...@@ -95,10 +101,10 @@ class NeedinfoDao extends Dao {
* @param needs * @param needs
* @returns {Promise<Array<Model>|*>} * @returns {Promise<Array<Model>|*>}
*/ */
async bulkUpdate(needs){ async bulkUpdate(needs) {
let result = await this.bulkCreate(needs,{ let result = await this.bulkCreate(needs, {
fields:["id", "status","statusName"] , fields: ["id", "status", "statusName"],
updateOnDuplicate: ["status","statusName"] updateOnDuplicate: ["status", "statusName"]
}); });
return result; return result;
} }
...@@ -108,15 +114,16 @@ class NeedinfoDao extends Dao { ...@@ -108,15 +114,16 @@ class NeedinfoDao extends Dao {
* @param needs * @param needs
* @returns {Promise<Array<Model>|*>} * @returns {Promise<Array<Model>|*>}
*/ */
async bulkUpdateStatus(status,statusName,ids){ async bulkUpdateStatus(status, statusName, ids) {
let result = await this.updateByWhere({status:status,statusName:statusName},{ let result = await this.updateByWhere({status: status, statusName: statusName}, {
where : { where: {
channelNeedNo:{ channelNeedNo: {
[Op.in]:ids [Op.in]: ids
} }
} }
}); });
return result; 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