Commit c7065bd9 by 宋毅

增加产品id

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